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
E.g.: in a call like put(StringIO(xxx), yyy, mode="0755") (emphasis is on mode string, not the StringIO, which is incidental):
Fatal error: put() encountered an exception while uploading '<StringIO.StringIO instance at 0x9ddfa8>'
Underlying exception:
unsupported operand type(s) for &: 'str' and 'int'
Aborting.
Problem is that whoever added the mode stuff is blindly doing lmode & 07777 which dies whenever lmode is a string. Casting to an int appears to work fine for me in the shell, regardless if one gives e.g. "755", "0755", "00755" etc.
The text was updated successfully, but these errors were encountered:
Many thanks for the fix but I think it needs to be extended to handle the case when mode is passed in as an int or a string. Sorry for posting a diff, I know bad form.
# Handle modes if necessaryif (local_is_pathandmirror_local_mode) or (modeisnotNone):
lmode=os.stat(local_path).st_modeifmirror_local_modeelsemode-lmode=lmode&07777+iftype(lmode) isstr:
+lmode=int(lmode, 8) &07777+else:
+lmode=lmode&07777
E.g.: in a call like
put(StringIO(xxx), yyy, mode="0755")
(emphasis is on mode string, not the StringIO, which is incidental):Problem is that whoever added the mode stuff is blindly doing
lmode & 07777
which dies wheneverlmode
is a string. Casting to an int appears to work fine for me in the shell, regardless if one gives e.g."755"
,"0755"
,"00755"
etc.The text was updated successfully, but these errors were encountered: