You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running upload() on python 3 leads to the error because basestring is no longer available in Python 3.
Stack trace:
def upload(self, local_path_or_fileobj, remote_path):
--> 153 if isinstance(local_path_or_fileobj, basestring):
154 with open(local_path_or_fileobj, 'rb') as f:
155 self._upload(f, remote_path)
NameError: name 'basestring' is not defined
The text was updated successfully, but these errors were encountered:
Just insert at the beginning of the code (after import statements):
try:
unicode=unicodeexceptNameError:
# 'unicode' is undefined, must be Python 3str=strunicode=strbytes=bytesbasestring= (str,bytes)
else:
# 'unicode' exists, must be Python 2str=strunicode=unicodebytes=strbasestring=basestring
Inserting the code snippet after import statements did not work for me, as it only changes the basestring value for the class it is being imported to, where it should be changed inside the easywebdav.py
As a work around I just cloned easywebdav.py and inserted the code snippet after the checking of py_majversion.
Running upload() on python 3 leads to the error because
basestring
is no longer available in Python 3.Stack trace:
The text was updated successfully, but these errors were encountered: