Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
995c60d2
Kaydet (Commit)
995c60d2
authored
Ock 27, 2018
tarafından
Bo Bayles
Kaydeden (comit)
Éric Araujo
Ock 27, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[3.6] bpo-32304: Fix distutils upload for tar files ending with b'\r' (GH-5264) (GH-5330)
Patch by Bo Bayles.
üst
255dbd21
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
2 deletions
+33
-2
3.6.rst
Doc/whatsnew/3.6.rst
+5
-0
upload.py
Lib/distutils/command/upload.py
+0
-2
test_upload.py
Lib/distutils/tests/test_upload.py
+26
-0
2018-01-21-16-33-53.bpo-32304.TItrNv.rst
...S.d/next/Library/2018-01-21-16-33-53.bpo-32304.TItrNv.rst
+2
-0
No files found.
Doc/whatsnew/3.6.rst
Dosyayı görüntüle @
995c60d2
...
...
@@ -1016,6 +1016,11 @@ attribute defaults to ``['gztar']``. Although not anticipated,
any code relying on the presence of ``default_format`` may
need to be adapted. See :issue:`27819` for more details.
The ``upload`` command now longer tries to change CR end-of-line characters
to CRLF. This fixes a corruption issue with sdists that ended with a byte
equivalent to CR.
(Contributed by Bo Bayles in :issue:`32304`.)
email
-----
...
...
Lib/distutils/command/upload.py
Dosyayı görüntüle @
995c60d2
...
...
@@ -159,8 +159,6 @@ class upload(PyPIRCCommand):
body
.
write
(
title
.
encode
(
'utf-8'
))
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
=
body
.
getvalue
()
...
...
Lib/distutils/tests/test_upload.py
Dosyayı görüntüle @
995c60d2
...
...
@@ -143,6 +143,32 @@ class uploadTestCase(BasePyPIRCCommandTestCase):
results
=
self
.
get_logs
(
INFO
)
self
.
assertEqual
(
results
[
-
1
],
75
*
'-'
+
'
\n
xyzzy
\n
'
+
75
*
'-'
)
# bpo-32304: archives whose last byte was b'\r' were corrupted due to
# normalization intended for Mac OS 9.
def
test_upload_correct_cr
(
self
):
# content that ends with \r should not be modified.
tmp
=
self
.
mkdtemp
()
path
=
os
.
path
.
join
(
tmp
,
'xxx'
)
self
.
write_file
(
path
,
content
=
'yy
\r
'
)
command
,
pyversion
,
filename
=
'xxx'
,
'2.6'
,
path
dist_files
=
[(
command
,
pyversion
,
filename
)]
self
.
write_file
(
self
.
rc
,
PYPIRC_LONG_PASSWORD
)
# other fields that ended with \r used to be modified, now are
# preserved.
pkg_dir
,
dist
=
self
.
create_dist
(
dist_files
=
dist_files
,
description
=
'long description
\r
'
)
cmd
=
upload
(
dist
)
cmd
.
show_response
=
1
cmd
.
ensure_finalized
()
cmd
.
run
()
headers
=
dict
(
self
.
last_open
.
req
.
headers
)
self
.
assertEqual
(
headers
[
'Content-length'
],
'2172'
)
self
.
assertIn
(
b
'long description
\r
'
,
self
.
last_open
.
req
.
data
)
def
test_upload_fails
(
self
):
self
.
next_msg
=
"Not Found"
self
.
next_code
=
404
...
...
Misc/NEWS.d/next/Library/2018-01-21-16-33-53.bpo-32304.TItrNv.rst
0 → 100644
Dosyayı görüntüle @
995c60d2
distutils' upload command no longer corrupts tar files ending with a CR byte,
and no longer tries to convert CR to CRLF in any of the upload text fields.
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