+ stream.file_selector.fd = openfile(stream.file_selector.name.encode(sys.getfilesystemencoding()), 'ab') # open doesn't seek to END in append mode on win32, but openfile does
self.offset = stream.file_selector.fd.tell()
self.hash = prev_file.partial_hash
except (KeyError, EnvironmentError, ValueError):
for name in UniqueFilenameGenerator.generate(os.path.join(directory, os.path.basename(stream.file_selector.name))):