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
19ddaf6d
Kaydet (Commit)
19ddaf6d
authored
Nis 14, 2015
tarafından
Andrew Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge from 3.4
üst
467a546b
b3c30d91
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
gettext.py
Lib/gettext.py
+2
-1
test_gettext.py
Lib/test/test_gettext.py
+27
-0
NEWS
Misc/NEWS
+2
-2
No files found.
Lib/gettext.py
Dosyayı görüntüle @
19ddaf6d
...
@@ -275,11 +275,12 @@ class GNUTranslations(NullTranslations):
...
@@ -275,11 +275,12 @@ class GNUTranslations(NullTranslations):
# See if we're looking at GNU .mo conventions for metadata
# See if we're looking at GNU .mo conventions for metadata
if
mlen
==
0
:
if
mlen
==
0
:
# Catalog description
# Catalog description
lastk
=
k
=
None
lastk
=
None
for
b_item
in
tmsg
.
split
(
'
\n
'
.
encode
(
"ascii"
)):
for
b_item
in
tmsg
.
split
(
'
\n
'
.
encode
(
"ascii"
)):
item
=
b_item
.
decode
()
.
strip
()
item
=
b_item
.
decode
()
.
strip
()
if
not
item
:
if
not
item
:
continue
continue
k
=
v
=
None
if
':'
in
item
:
if
':'
in
item
:
k
,
v
=
item
.
split
(
':'
,
1
)
k
,
v
=
item
.
split
(
':'
,
1
)
k
=
k
.
strip
()
.
lower
()
k
=
k
.
strip
()
.
lower
()
...
...
Lib/test/test_gettext.py
Dosyayı görüntüle @
19ddaf6d
...
@@ -134,6 +134,12 @@ class GettextBaseTest(unittest.TestCase):
...
@@ -134,6 +134,12 @@ class GettextBaseTest(unittest.TestCase):
del
self
.
env
del
self
.
env
support
.
rmtree
(
os
.
path
.
split
(
LOCALEDIR
)[
0
])
support
.
rmtree
(
os
.
path
.
split
(
LOCALEDIR
)[
0
])
GNU_MO_DATA_ISSUE_17898
=
b
'''
\
3hIElQAAAAABAAAAHAAAACQAAAAAAAAAAAAAAAAAAAAsAAAAggAAAC0AAAAAUGx1cmFsLUZvcm1z
OiBucGx1cmFscz0yOyBwbHVyYWw9KG4gIT0gMSk7CiMtIy0jLSMtIyAgbWVzc2FnZXMucG8gKEVk
WCBTdHVkaW8pICAjLSMtIy0jLSMKQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PVVU
Ri04CgA=
'''
class
GettextTestCase1
(
GettextBaseTest
):
class
GettextTestCase1
(
GettextBaseTest
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -360,6 +366,14 @@ class PluralFormsTestCase(GettextBaseTest):
...
@@ -360,6 +366,14 @@ class PluralFormsTestCase(GettextBaseTest):
# Test for a dangerous expression
# Test for a dangerous expression
raises
(
ValueError
,
gettext
.
c2py
,
"os.chmod('/etc/passwd',0777)"
)
raises
(
ValueError
,
gettext
.
c2py
,
"os.chmod('/etc/passwd',0777)"
)
class
GNUTranslationParsingTest
(
GettextBaseTest
):
def
test_plural_form_error_issue17898
(
self
):
with
open
(
MOFILE
,
'wb'
)
as
fp
:
fp
.
write
(
base64
.
decodebytes
(
GNU_MO_DATA_ISSUE_17898
))
with
open
(
MOFILE
,
'rb'
)
as
fp
:
# If this runs cleanly, the bug is fixed.
t
=
gettext
.
GNUTranslations
(
fp
)
class
UnicodeTranslationsTest
(
GettextBaseTest
):
class
UnicodeTranslationsTest
(
GettextBaseTest
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -535,3 +549,16 @@ msgstr ""
...
@@ -535,3 +549,16 @@ msgstr ""
"Content-Transfer-Encoding: quoted-printable
\n
"
"Content-Transfer-Encoding: quoted-printable
\n
"
"Generated-By: pygettext.py 1.3
\n
"
"Generated-By: pygettext.py 1.3
\n
"
'''
'''
#
# messages.po, used for bug 17898
#
'''
# test file for http://bugs.python.org/issue17898
msgid ""
msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);
\n
"
"#-#-#-#-# messages.po (EdX Studio) #-#-#-#-#
\n
"
"Content-Type: text/plain; charset=UTF-8
\n
"
'''
Misc/NEWS
Dosyayı görüntüle @
19ddaf6d
...
@@ -47,8 +47,8 @@ Library
...
@@ -47,8 +47,8 @@ Library
- Issue #21859: Added Python implementation of io.FileIO.
- Issue #21859: Added Python implementation of io.FileIO.
- Issue #23865: close() methods in multiple modules now are idempotent and more
- Issue #23865: close() methods in multiple modules now are idempotent and more
robust
at
shutdown
.
If
needs
to
release
multiple
resources
,
they
are
released
robust at shutdown. If
they need to release multiple resources, all are
even
if
errors
are
occured
.
released even if errors occur
.
- Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not
- Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not
available. Patch by Davin Potts.
available. Patch by Davin Potts.
...
...
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