Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
6d2d1caa
Commit
6d2d1caa
authored
Dec 20, 2009
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #7552: fixed distutils.command.upload failure on very long passwords
parent
6f9d7dc8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
command/upload.py
command/upload.py
+3
-3
tests/test_upload.py
tests/test_upload.py
+22
-1
No files found.
command/upload.py
View file @
6d2d1caa
...
...
@@ -6,7 +6,7 @@ import os
import
socket
import
platform
from
urllib2
import
urlopen
,
Request
,
HTTPError
import
base64
from
base64
import
standard_b64encode
import
urlparse
import
cStringIO
as
StringIO
from
ConfigParser
import
ConfigParser
...
...
@@ -129,8 +129,8 @@ class upload(PyPIRCCommand):
open
(
filename
+
".asc"
).
read
())
# set up the authentication
auth
=
"Basic "
+
base64
.
encodestring
(
self
.
username
+
":"
+
self
.
password
).
strip
(
)
auth
=
"Basic "
+
standard_b64encode
(
self
.
username
+
":"
+
self
.
password
)
# Build up the MIME payload for the POST data
boundary
=
'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
...
...
tests/test_upload.py
View file @
6d2d1caa
...
...
@@ -10,6 +10,25 @@ from distutils.core import Distribution
from
distutils.tests
import
support
from
distutils.tests.test_config
import
PYPIRC
,
PyPIRCCommandTestCase
PYPIRC_LONG_PASSWORD
=
"""
\
[distutils]
index-servers =
server1
server2
[server1]
username:me
password:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[server2]
username:meagain
password: secret
realm:acme
repository:http://another.pypi/
"""
PYPIRC_NOPASSWORD
=
"""
\
[distutils]
...
...
@@ -85,7 +104,7 @@ class uploadTestCase(PyPIRCCommandTestCase):
self
.
write_file
(
path
)
command
,
pyversion
,
filename
=
'xxx'
,
'2.6'
,
path
dist_files
=
[(
command
,
pyversion
,
filename
)]
self
.
write_file
(
self
.
rc
,
PYPIRC
)
self
.
write_file
(
self
.
rc
,
PYPIRC
_LONG_PASSWORD
)
# lets run it
pkg_dir
,
dist
=
self
.
create_dist
(
dist_files
=
dist_files
)
...
...
@@ -101,6 +120,8 @@ class uploadTestCase(PyPIRCCommandTestCase):
self
.
assertEquals
(
self
.
last_open
.
req
.
get_full_url
(),
'http://pypi.python.org/pypi'
)
self
.
assertTrue
(
'xxx'
in
self
.
last_open
.
req
.
data
)
auth
=
self
.
last_open
.
req
.
headers
[
'Authorization'
]
self
.
assertFalse
(
'
\
n
'
in
auth
)
def
test_suite
():
return
unittest
.
makeSuite
(
uploadTestCase
)
...
...
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