mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-14 22:26:39 +00:00
stringutils.py, sftpd.py: Portability fixes for Python <= 2.5.
This commit is contained in:
parent
28ed28a0c2
commit
80a89d3931
@ -311,7 +311,7 @@ class EncryptedTemporaryFile(PrefixingLogMixin):
|
||||
def flush(self):
|
||||
self.file.flush()
|
||||
|
||||
def seek(self, offset, whence=os.SEEK_SET):
|
||||
def seek(self, offset, whence=0): # 0 = SEEK_SET
|
||||
if noisy: self.log(".seek(%r, %r)" % (offset, whence), level=NOISY)
|
||||
self.file.seek(offset, whence)
|
||||
|
||||
|
@ -25,7 +25,7 @@ def _canonical_encoding(encoding):
|
||||
# fail early if this happens
|
||||
try:
|
||||
u"test".encode(encoding)
|
||||
except LookupError:
|
||||
except (LookupError, AttributeError):
|
||||
raise AssertionError("The character encoding '%s' is not supported for conversion." % (encoding,))
|
||||
|
||||
return encoding
|
||||
|
Loading…
x
Reference in New Issue
Block a user