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
35de5ac4
Kaydet (Commit)
35de5ac4
authored
May 19, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
packaging: don't use locale encoding to compute MD5 checksums
Open the file in binary mode or use UTF-8 encoding.
üst
cd0f7bfd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
install_distinfo.py
Lib/packaging/command/install_distinfo.py
+2
-2
create.py
Lib/packaging/create.py
+3
-3
test_command_install_distinfo.py
Lib/packaging/tests/test_command_install_distinfo.py
+2
-2
No files found.
Lib/packaging/command/install_distinfo.py
Dosyayı görüntüle @
35de5ac4
...
@@ -133,9 +133,9 @@ class install_distinfo(Command):
...
@@ -133,9 +133,9 @@ class install_distinfo(Command):
writer
.
writerow
((
fpath
,
''
,
''
))
writer
.
writerow
((
fpath
,
''
,
''
))
else
:
else
:
size
=
os
.
path
.
getsize
(
fpath
)
size
=
os
.
path
.
getsize
(
fpath
)
with
open
(
fpath
,
'r'
)
as
fp
:
with
open
(
fpath
,
'r
b
'
)
as
fp
:
hash
=
hashlib
.
md5
()
hash
=
hashlib
.
md5
()
hash
.
update
(
fp
.
read
()
.
encode
()
)
hash
.
update
(
fp
.
read
())
md5sum
=
hash
.
hexdigest
()
md5sum
=
hash
.
hexdigest
()
writer
.
writerow
((
fpath
,
md5sum
,
size
))
writer
.
writerow
((
fpath
,
md5sum
,
size
))
...
...
Lib/packaging/create.py
Dosyayı görüntüle @
35de5ac4
...
@@ -400,10 +400,10 @@ class MainProgram:
...
@@ -400,10 +400,10 @@ class MainProgram:
self
.
data
[
'description'
])
.
lower
()
.
encode
())
self
.
data
[
'description'
])
.
lower
()
.
encode
())
ref
=
ref
.
digest
()
ref
=
ref
.
digest
()
for
readme
in
glob
.
glob
(
'README*'
):
for
readme
in
glob
.
glob
(
'README*'
):
with
open
(
readme
)
as
fp
:
with
open
(
readme
,
encoding
=
'utf-8'
)
as
fp
:
contents
=
fp
.
read
()
contents
=
fp
.
read
()
val
=
md5
(
re
.
sub
(
'
\
s'
,
''
,
contents
=
re
.
sub
(
'
\
s'
,
''
,
contents
.
lower
())
.
encode
()
contents
.
lower
())
.
encode
()
)
.
digest
()
val
=
md5
(
contents
)
.
digest
()
if
val
==
ref
:
if
val
==
ref
:
del
data
[
'description'
]
del
data
[
'description'
]
data
[
'description-file'
]
=
readme
data
[
'description-file'
]
=
readme
...
...
Lib/packaging/tests/test_command_install_distinfo.py
Dosyayı görüntüle @
35de5ac4
...
@@ -168,8 +168,8 @@ class InstallDistinfoTestCase(support.TempdirManager,
...
@@ -168,8 +168,8 @@ class InstallDistinfoTestCase(support.TempdirManager,
else
:
else
:
size
=
os
.
path
.
getsize
(
f
)
size
=
os
.
path
.
getsize
(
f
)
md5
=
hashlib
.
md5
()
md5
=
hashlib
.
md5
()
with
open
(
f
)
as
fp
:
with
open
(
f
,
'rb'
)
as
fp
:
md5
.
update
(
fp
.
read
()
.
encode
()
)
md5
.
update
(
fp
.
read
())
hash
=
md5
.
hexdigest
()
hash
=
md5
.
hexdigest
()
expected
.
append
([
f
,
hash
,
str
(
size
)])
expected
.
append
([
f
,
hash
,
str
(
size
)])
...
...
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