Open andybelov opened 7 years ago
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
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.
My bad, I misunderstood the instruction. It was supposed to be inserted after the import statements IN THE ORIGINAL SCRIPT :smiley:
Running upload() on python 3 leads to the error because
basestring
is no longer available in Python 3.Stack trace: