Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
58721a90
Commit
58721a90
authored
Apr 08, 2019
by
Mickaël Schoentgen
Committed by
Inada Naoki
Apr 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-35416: fix potential resource warnings in distutils (GH-10918)
parent
7a0630c5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
39 deletions
+44
-39
Lib/distutils/command/bdist_rpm.py
Lib/distutils/command/bdist_rpm.py
+2
-1
Lib/distutils/command/bdist_wininst.py
Lib/distutils/command/bdist_wininst.py
+38
-36
Lib/distutils/command/upload.py
Lib/distutils/command/upload.py
+3
-2
Misc/NEWS.d/next/Library/2018-12-05-09-55-05.bpo-35416.XALKZG.rst
...S.d/next/Library/2018-12-05-09-55-05.bpo-35416.XALKZG.rst
+1
-0
No files found.
Lib/distutils/command/bdist_rpm.py
View file @
58721a90
...
...
@@ -537,7 +537,8 @@ class bdist_rpm(Command):
''
,
'%'
+
rpm_opt
,])
if
val
:
spec_file
.
extend
(
open
(
val
,
'r'
).
read
().
split
(
'
\
n
'
))
with
open
(
val
)
as
f
:
spec_file
.
extend
(
f
.
read
().
split
(
'
\
n
'
))
else
:
spec_file
.
append
(
default
)
...
...
Lib/distutils/command/bdist_wininst.py
View file @
58721a90
...
...
@@ -247,12 +247,13 @@ class bdist_wininst(Command):
self
.
announce
(
"creating %s"
%
installer_name
)
if
bitmap
:
bitmapdata
=
open
(
bitmap
,
"rb"
).
read
()
with
open
(
bitmap
,
"rb"
)
as
f
:
bitmapdata
=
f
.
read
()
bitmaplen
=
len
(
bitmapdata
)
else
:
bitmaplen
=
0
file
=
open
(
installer_name
,
"wb"
)
with
open
(
installer_name
,
"wb"
)
as
file
:
file
.
write
(
self
.
get_exe_bytes
())
if
bitmap
:
file
.
write
(
bitmapdata
)
...
...
@@ -287,7 +288,8 @@ class bdist_wininst(Command):
bitmaplen
,
# number of bytes in bitmap
)
file
.
write
(
header
)
file
.
write
(
open
(
arcname
,
"rb"
).
read
())
with
open
(
arcname
,
"rb"
)
as
f
:
file
.
write
(
f
.
read
())
def
get_installer_filename
(
self
,
fullname
):
# Factored out to allow overriding in subclasses
...
...
Lib/distutils/command/upload.py
View file @
58721a90
...
...
@@ -125,8 +125,9 @@ class upload(PyPIRCCommand):
data
[
'comment'
]
=
''
if
self
.
sign
:
with
open
(
filename
+
".asc"
,
"rb"
)
as
f
:
data
[
'gpg_signature'
]
=
(
os
.
path
.
basename
(
filename
)
+
".asc"
,
open
(
filename
+
".asc"
,
"rb"
)
.
read
())
f
.
read
())
# set up the authentication
user_pass
=
(
self
.
username
+
":"
+
self
.
password
).
encode
(
'ascii'
)
...
...
Misc/NEWS.d/next/Library/2018-12-05-09-55-05.bpo-35416.XALKZG.rst
0 → 100644
View file @
58721a90
Fix potential resource warnings in distutils. Patch by Mickaël Schoentgen.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment