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

Fix missing basestring on python3 #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

umlaeute
Copy link

python3 lacks the 'basestring' class, instead all strings are unicode and of type 'str'.
this patch makes easywebdav py3-able

python3 lacks the 'basestring' class, instead all strings are unicode and of type 'str'.
this patch makes easywebdav py3-able
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
would be cool if you apply this fix

@afsneto
Copy link

afsneto commented Nov 24, 2017

Just insert at the beginning of the code (after import statements):

try:
    unicode = unicode
except NameError:
    # 'unicode' is undefined, must be Python 3
    str = str
    unicode = str
    bytes = bytes
    basestring = (str,bytes)
else:
    # 'unicode' exists, must be Python 2
    str = str
    unicode = unicode
    bytes = str
    basestring = basestring

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

Successfully merging this pull request may close these issues.

2 participants