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
9ad23c6c
Commit
9ad23c6c
authored
Sep 27, 2014
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#10510: make distuitls upload/register use HTML standards compliant CRLF.
Patch by Ian Cordasco, approved by Éric Araujo.
parent
1b4b7af1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
6 deletions
+9
-6
Lib/distutils/command/upload.py
Lib/distutils/command/upload.py
+4
-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 @
9ad23c6c
...
@@ -136,8 +136,8 @@ class upload(PyPIRCCommand):
...
@@ -136,8 +136,8 @@ class upload(PyPIRCCommand):
# Build up the MIME payload for the POST data
# Build up the MIME payload for the POST data
boundary
=
'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
boundary
=
'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
sep_boundary
=
'
\
n
--'
+
boundary
sep_boundary
=
'
\
r
\
n
--'
+
boundary
end_boundary
=
sep_boundary
+
'--'
end_boundary
=
sep_boundary
+
'--
\
r
\
n
'
body
=
StringIO
.
StringIO
()
body
=
StringIO
.
StringIO
()
for
key
,
value
in
data
.
items
():
for
key
,
value
in
data
.
items
():
# handle multiple entries for the same name
# handle multiple entries for the same name
...
@@ -151,14 +151,13 @@ class upload(PyPIRCCommand):
...
@@ -151,14 +151,13 @@ class upload(PyPIRCCommand):
fn
=
""
fn
=
""
body
.
write
(
sep_boundary
)
body
.
write
(
sep_boundary
)
body
.
write
(
'
\
n
Content-Disposition: form-data; name="%s"'
%
key
)
body
.
write
(
'
\
r
\
n
Content-Disposition: form-data; name="%s"'
%
key
)
body
.
write
(
fn
)
body
.
write
(
fn
)
body
.
write
(
"
\
n
\
n
"
)
body
.
write
(
"
\
r
\
n
\
r
\
n
"
)
body
.
write
(
value
)
body
.
write
(
value
)
if
value
and
value
[
-
1
]
==
'
\
r
'
:
if
value
and
value
[
-
1
]
==
'
\
r
'
:
body
.
write
(
'
\
n
'
)
# write an extra newline (lurve Macs)
body
.
write
(
'
\
n
'
)
# write an extra newline (lurve Macs)
body
.
write
(
end_boundary
)
body
.
write
(
end_boundary
)
body
.
write
(
"
\
n
"
)
body
=
body
.
getvalue
()
body
=
body
.
getvalue
()
self
.
announce
(
"Submitting %s to %s"
%
(
filename
,
self
.
repository
),
log
.
INFO
)
self
.
announce
(
"Submitting %s to %s"
%
(
filename
,
self
.
repository
),
log
.
INFO
)
...
...
Lib/distutils/tests/test_upload.py
View file @
9ad23c6c
...
@@ -119,7 +119,7 @@ class uploadTestCase(PyPIRCCommandTestCase):
...
@@ -119,7 +119,7 @@ class uploadTestCase(PyPIRCCommandTestCase):
# what did we send ?
# what did we send ?
self
.
assertIn
(
'dédé'
,
self
.
last_open
.
req
.
data
)
self
.
assertIn
(
'dédé'
,
self
.
last_open
.
req
.
data
)
headers
=
dict
(
self
.
last_open
.
req
.
headers
)
headers
=
dict
(
self
.
last_open
.
req
.
headers
)
self
.
assertEqual
(
headers
[
'Content-length'
],
'2
085
'
)
self
.
assertEqual
(
headers
[
'Content-length'
],
'2
159
'
)
self
.
assertTrue
(
headers
[
'Content-type'
].
startswith
(
'multipart/form-data'
))
self
.
assertTrue
(
headers
[
'Content-type'
].
startswith
(
'multipart/form-data'
))
self
.
assertEqual
(
self
.
last_open
.
req
.
get_method
(),
'POST'
)
self
.
assertEqual
(
self
.
last_open
.
req
.
get_method
(),
'POST'
)
self
.
assertEqual
(
self
.
last_open
.
req
.
get_full_url
(),
self
.
assertEqual
(
self
.
last_open
.
req
.
get_full_url
(),
...
...
Misc/ACKS
View file @
9ad23c6c
...
@@ -274,6 +274,7 @@ David M. Cooke
...
@@ -274,6 +274,7 @@ David M. Cooke
Jason R. Coombs
Jason R. Coombs
Garrett Cooper
Garrett Cooper
Greg Copeland
Greg Copeland
Ian Cordasco
Aldo Cortesi
Aldo Cortesi
David Costanzo
David Costanzo
Scott Cotton
Scott Cotton
...
...
Misc/NEWS
View file @
9ad23c6c
...
@@ -22,6 +22,9 @@ Core and Builtins
...
@@ -22,6 +22,9 @@ Core and Builtins
Library
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
-
Issue
#
9850
:
Fixed
macpath
.
join
()
for
empty
first
component
.
Patch
by
Oleg
Oshmyan
.
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