Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: global name 'basestring' is not defined (python 3) #26

Open
minami-o opened this issue Oct 2, 2014 · 4 comments
Open

NameError: global name 'basestring' is not defined (python 3) #26

minami-o opened this issue Oct 2, 2014 · 4 comments

Comments

@minami-o
Copy link

minami-o commented Oct 2, 2014

Hey there,
Nice work you have done, thanks!
I just came across an error while trying to download/upload files with my python3.3 install:

NameError: global name 'basestring' is not defined

After a quick web research, I found the solution mentioned here to work just fine.
I added the lines right after the import lines in client.py.

@SvenFestersen
Copy link

I also would really like to use you library with Python3. As @minami-o mentioned, adding

try:
    basestring
except NameError:
    basestring = str

after all the imports should be sufficient.

The solution in pull request #28 should also work.

@wsw70
Copy link

wsw70 commented Aug 12, 2015

+1: same problem, same solutions

willhaines added a commit to willhaines/scikit-rf that referenced this issue Sep 16, 2015
openstack-gerrit pushed a commit to openstack-archive/nova-zvm-virt-driver that referenced this issue Dec 16, 2015
py3 doesn't support basestring, so we need a new way to decide if
the type of an object is string. The module 'six' could
help us: isinstance(var, six.string_types).
Reference: amnong/easywebdav#26

Change-Id: I79266a3c5612d3b7cbe7c94d71d8f5a6aa7c03ab
openstack-gerrit pushed a commit to openstack-archive/nova-zvm-virt-driver that referenced this issue Dec 18, 2015
py3 doesn't support basestring, so we need a new way to decide if
the type of an object is string. The module 'six' could
help us: isinstance(var, six.string_types).
Reference: amnong/easywebdav#26

Change-Id: I79266a3c5612d3b7cbe7c94d71d8f5a6aa7c03ab
@jcea
Copy link

jcea commented Aug 7, 2016

Same problem here. Could you possibly do a new release, please?

@charreleramis
Copy link

charreleramis commented Apr 7, 2018

In python 3 just add basestring = str

PcoWegenenVerkeer added a commit to PcoWegenenVerkeer/got-your-back that referenced this issue May 24, 2018
In order to get this work under debian and python 3.5 I had to change basestring to str.
I followed instructions from here amnong/easywebdav#26.

Thnx!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants