diff options
Diffstat (limited to 'Lib/distutils/command/upload.py')
-rw-r--r-- | Lib/distutils/command/upload.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py index 613ea71..11afa24 100644 --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@ -125,8 +125,9 @@ class upload(PyPIRCCommand): data['comment'] = '' if self.sign: - data['gpg_signature'] = (os.path.basename(filename) + ".asc", - open(filename+".asc", "rb").read()) + with open(filename + ".asc", "rb") as f: + data['gpg_signature'] = (os.path.basename(filename) + ".asc", + f.read()) # set up the authentication user_pass = (self.username + ":" + self.password).encode('ascii') |