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
dbb718fa
Kaydet (Commit)
dbb718fa
authored
Eyl 21, 2001
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make these modules work when Python is compiled without Unicode support.
üst
11310bf8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
pickle.py
Lib/pickle.py
+10
-4
test_grammar.py
Lib/test/test_grammar.py
+4
-0
zipfile.py
Lib/zipfile.py
+4
-1
No files found.
Lib/pickle.py
Dosyayı görüntüle @
dbb718fa
...
@@ -54,6 +54,12 @@ try:
...
@@ -54,6 +54,12 @@ try:
except
ImportError
:
except
ImportError
:
PyStringMap
=
None
PyStringMap
=
None
try
:
UnicodeType
except
NameError
:
UnicodeType
=
None
MARK
=
'('
MARK
=
'('
STOP
=
'.'
STOP
=
'.'
POP
=
'0'
POP
=
'0'
...
@@ -304,8 +310,8 @@ class Pickler:
...
@@ -304,8 +310,8 @@ class Pickler:
s
=
mdumps
(
l
)[
1
:]
s
=
mdumps
(
l
)[
1
:]
self
.
write
(
BINUNICODE
+
s
+
encoding
)
self
.
write
(
BINUNICODE
+
s
+
encoding
)
else
:
else
:
object
=
object
.
replace
(
u"
\\
"
,
u
"
\\
u005c"
)
object
=
object
.
replace
(
"
\\
"
,
"
\\
u005c"
)
object
=
object
.
replace
(
u"
\n
"
,
u
"
\\
u000a"
)
object
=
object
.
replace
(
"
\n
"
,
"
\\
u000a"
)
self
.
write
(
UNICODE
+
object
.
encode
(
'raw-unicode-escape'
)
+
'
\n
'
)
self
.
write
(
UNICODE
+
object
.
encode
(
'raw-unicode-escape'
)
+
'
\n
'
)
memo_len
=
len
(
memo
)
memo_len
=
len
(
memo
)
...
@@ -334,8 +340,8 @@ class Pickler:
...
@@ -334,8 +340,8 @@ class Pickler:
self
.
write
(
BINSTRING
+
s
+
object
)
self
.
write
(
BINSTRING
+
s
+
object
)
else
:
else
:
if
unicode
:
if
unicode
:
object
=
object
.
replace
(
u"
\\
"
,
u
"
\\
u005c"
)
object
=
object
.
replace
(
"
\\
"
,
"
\\
u005c"
)
object
=
object
.
replace
(
u"
\n
"
,
u
"
\\
u000a"
)
object
=
object
.
replace
(
"
\n
"
,
"
\\
u000a"
)
object
=
object
.
encode
(
'raw-unicode-escape'
)
object
=
object
.
encode
(
'raw-unicode-escape'
)
self
.
write
(
UNICODE
+
object
+
'
\n
'
)
self
.
write
(
UNICODE
+
object
+
'
\n
'
)
else
:
else
:
...
...
Lib/test/test_grammar.py
Dosyayı görüntüle @
dbb718fa
...
@@ -394,11 +394,15 @@ def f():
...
@@ -394,11 +394,15 @@ def f():
if
z
!=
2
:
raise
TestFailed
,
'exec
\'
z=1+1
\'
'
if
z
!=
2
:
raise
TestFailed
,
'exec
\'
z=1+1
\'
'
z
=
None
z
=
None
del
z
del
z
import
types
if
hasattr
(
types
,
"UnicodeType"
):
exec
r"""if 1:
exec u'z=1+1\n'
exec u'z=1+1\n'
if z != 2: raise TestFailed, 'exec u\'z=1+1\'\\n'
if z != 2: raise TestFailed, 'exec u\'z=1+1\'\\n'
del z
del z
exec u'z=1+1'
exec u'z=1+1'
if z != 2: raise TestFailed, 'exec u\'z=1+1\''
if z != 2: raise TestFailed, 'exec u\'z=1+1\''
"""
f
()
f
()
g
=
{}
g
=
{}
exec
'z = 1'
in
g
exec
'z = 1'
in
g
...
...
Lib/zipfile.py
Dosyayı görüntüle @
dbb718fa
...
@@ -66,7 +66,10 @@ _FH_FILENAME_LENGTH = 10
...
@@ -66,7 +66,10 @@ _FH_FILENAME_LENGTH = 10
_FH_EXTRA_FIELD_LENGTH
=
11
_FH_EXTRA_FIELD_LENGTH
=
11
# Used to compare file passed to ZipFile
# Used to compare file passed to ZipFile
_STRING_TYPES
=
(
type
(
's'
),
type
(
u's'
))
import
types
_STRING_TYPES
=
(
types
.
StringType
,)
if
hasattr
(
types
,
"UnicodeType"
):
_STRING_TYPES
=
_STRING_TYPES
+
(
types
.
UnicodeType
,)
def
is_zipfile
(
filename
):
def
is_zipfile
(
filename
):
...
...
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