]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix "upload" command garbling and truncating files on Windows. If it's a
authorPhillip J. Eby <pje@telecommunity.com>
Thu, 7 Jul 2005 15:36:20 +0000 (15:36 +0000)
committerPhillip J. Eby <pje@telecommunity.com>
Thu, 7 Jul 2005 15:36:20 +0000 (15:36 +0000)
binary file, use 'rb'!

Lib/distutils/command/upload.py

index 7b08336c82feae9470f4b06e57c9ab0a7a12f884..3b5a0fc9d9f3c1b29955fcdfccb07e172c04ed81 100644 (file)
@@ -71,7 +71,7 @@ class upload(Command):
                   dry_run=self.dry_run)
 
         # Fill in the data
-        content = open(filename).read()
+        content = open(filename,'rb').read()
         data = {
             ':action':'file_upload',
             'protcol_version':'1',