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

Solution MacOS python3 basestring #58

Open
egophil opened this issue May 15, 2018 · 2 comments
Open

Solution MacOS python3 basestring #58

egophil opened this issue May 15, 2018 · 2 comments

Comments

@egophil
Copy link

egophil commented May 15, 2018

Hi,

basestring is not defined in the client.py file if you use python3.
Workaround:
open client.py and add after line 14 the line: basestring = str
After editing it should look like the following lines.

12: else:
13: from http.client import responses as HTTP_CODES
14 : from urllib.parse import urlparse
15: basestring = str

@tlansec
Copy link

tlansec commented Jun 2, 2020

This issue occurs for all Python3, not just MacOS. Project seems no longer maintained - so people will have to make this change locally.

@Nixellion
Copy link

Another solution that does not require editing of existing files is monkey patching:

https://stackoverflow.com/questions/50667128/is-it-possible-to-fully-monkey-patch-builtin-str-in-python3

Basically:

def monkey_patch_basestring():
    import builtins
    builtins.basestring = str

Or simply

easywebdav.basestring = str
easywebdav.client.basestring = str

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

3 participants