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
3a54c3e3
Commit
3a54c3e3
authored
Sep 27, 2014
by
R David Murray
Browse files
Options
Browse Files
Download
Plain Diff
Merge: #10510: make distuitls upload/register use HTML standards compliant CRLF.
parents
f7fee331
9ce69672
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
Lib/distutils/command/upload.py
Lib/distutils/command/upload.py
+5
-5
Lib/distutils/tests/test_upload.py
Lib/distutils/tests/test_upload.py
+1
-1
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/distutils/command/upload.py
View file @
3a54c3e3
...
...
@@ -141,11 +141,11 @@ class upload(PyPIRCCommand):
# Build up the MIME payload for the POST data
boundary
=
'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
sep_boundary
=
b'
\
n
--'
+
boundary
.
encode
(
'ascii'
)
end_boundary
=
sep_boundary
+
b'--'
sep_boundary
=
b'
\
r
\
n
--'
+
boundary
.
encode
(
'ascii'
)
end_boundary
=
sep_boundary
+
b'--
\
r
\
n
'
body
=
io
.
BytesIO
()
for
key
,
value
in
data
.
items
():
title
=
'
\
n
Content-Disposition: form-data; name="%s"'
%
key
title
=
'
\
r
\
n
Content-Disposition: form-data; name="%s"'
%
key
# handle multiple entries for the same name
if
not
isinstance
(
value
,
list
):
value
=
[
value
]
...
...
@@ -157,12 +157,12 @@ class upload(PyPIRCCommand):
value
=
str
(
value
).
encode
(
'utf-8'
)
body
.
write
(
sep_boundary
)
body
.
write
(
title
.
encode
(
'utf-8'
))
body
.
write
(
b"
\
n
\
n
"
)
body
.
write
(
b"
\
r
\
n
\
r
\
n
"
)
body
.
write
(
value
)
if
value
and
value
[
-
1
:]
==
b'
\
r
'
:
body
.
write
(
b'
\
n
'
)
# write an extra newline (lurve Macs)
body
.
write
(
end_boundary
)
body
.
write
(
b"
\
n
"
)
body
.
write
(
b"
\
r
\
n
"
)
body
=
body
.
getvalue
()
msg
=
"Submitting %s to %s"
%
(
filename
,
self
.
repository
)
...
...
Lib/distutils/tests/test_upload.py
View file @
3a54c3e3
...
...
@@ -127,7 +127,7 @@ class uploadTestCase(PyPIRCCommandTestCase):
# what did we send ?
headers
=
dict
(
self
.
last_open
.
req
.
headers
)
self
.
assertEqual
(
headers
[
'Content-length'
],
'2
087
'
)
self
.
assertEqual
(
headers
[
'Content-length'
],
'2
163
'
)
content_type
=
headers
[
'Content-type'
]
self
.
assertTrue
(
content_type
.
startswith
(
'multipart/form-data'
))
self
.
assertEqual
(
self
.
last_open
.
req
.
get_method
(),
'POST'
)
...
...
Misc/ACKS
View file @
3a54c3e3
...
...
@@ -281,6 +281,7 @@ Jason R. Coombs
Garrett Cooper
Greg Copeland
Aldo Cortesi
Ian Cordasco
David Costanzo
Scott Cotton
Greg Couch
...
...
Misc/NEWS
View file @
3a54c3e3
...
...
@@ -145,6 +145,9 @@ Core and Builtins
Library
-------
-
Issue
#
10510
:
distutils
register
and
upload
methods
now
use
HTML
standards
compliant
CRLF
line
endings
.
-
Issue
#
9850
:
Fixed
macpath
.
join
()
for
empty
first
component
.
Patch
by
Oleg
Oshmyan
.
...
...
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