analytics-python icon indicating copy to clipboard operation
analytics-python copied to clipboard

PyPi v2.2.0 "NameError: name 'string_types' is not defined"

Open ssutrisno opened this issue 3 years ago • 6 comments

Hi there!

We are currently using segment-analytics-python v2.2.0 from PyPi and received the following error when calling analytics.track(): NameError: name 'string_types' is not defined

I noticed that the segment/analytics/client.py has type check on write_key with string_types but I think the master branch is using str instead.

I think this issue is similar to #214 but the pypi is not updated yet?

Could you please help release the latest version in PyPi? Cheers.

Sam

ssutrisno avatar Jul 18 '22 08:07 ssutrisno

@ssutrisno Sorry for the delayed response, could you please check your versions installed to ensure that you currently have the latest 2.2.0? I am not sure how you continue to receive this error. The update changed string_types to str, for you to receive that error tells me that there may be multiple versions or a mismatch of source.
Thanks

nd4p90x avatar Aug 03 '22 14:08 nd4p90x

@nd4p90x I'm receiving the same error. I installed the 2.2.0 version installed in a new project but seems that is using string_types still.

For instance: require('write_key', write_key, string_types)

vitormorales avatar Aug 04 '22 22:08 vitormorales

@vitormorales my apologies, I will look into it as soon as I can.

nd4p90x avatar Aug 04 '22 23:08 nd4p90x

@vitormorales I gravel at your feet for forgiveness. I am still unsure how that old code made it into the 2.2.0 release, regardless, I will resolve this issue as soon as I complete one other dependency upgrade. I will post updates here.

nd4p90x avatar Aug 05 '22 15:08 nd4p90x

@nd4p90x No worries! Thank you to be on top of this. If I can help you lmk!

vitormorales avatar Aug 05 '22 21:08 vitormorales

@nd4p90x News?

vitormorales avatar Aug 10 '22 10:08 vitormorales

@vitormorales Hopefully this resolves all of your issues, thank you. https://pypi.org/project/segment-analytics-python/

nd4p90x avatar Sep 06 '22 23:09 nd4p90x