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
e16e01fa
Kaydet (Commit)
e16e01fa
authored
Kas 27, 2002
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #639112: fixes for None locale and tz.
üst
e4827eb2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
_strptime.py
Lib/_strptime.py
+13
-5
test_strptime.py
Lib/test/test_strptime.py
+0
-0
No files found.
Lib/_strptime.py
Dosyayı görüntüle @
e16e01fa
...
...
@@ -26,7 +26,6 @@ from re import compile as re_compile
from
re
import
IGNORECASE
from
string
import
whitespace
as
whitespace_string
__version__
=
(
2
,
1
,
6
)
__author__
=
"Brett Cannon"
__email__
=
"drifty@bigfoot.com"
...
...
@@ -287,13 +286,19 @@ class LocaleTime(object):
self
.
__timezone
=
self
.
__pad
(
time
.
tzname
,
0
)
def
__calc_lang
(
self
):
# Set self.lang by using locale.getlocale() or
# locale.getdefaultlocale().
# Set self.__lang by using locale.getlocale() or
# locale.getdefaultlocale(). If both turn up empty, set the attribute
# to ''. This is to stop calls to this method and to make sure
# strptime() can produce an re object correctly.
current_lang
=
locale
.
getlocale
(
locale
.
LC_TIME
)[
0
]
if
current_lang
:
self
.
__lang
=
current_lang
else
:
self
.
__lang
=
locale
.
getdefaultlocale
()[
0
]
current_lang
=
locale
.
getdefaultlocale
()[
0
]
if
current_lang
:
self
.
__lang
=
current_lang
else
:
self
.
__lang
=
''
class
TimeRE
(
dict
):
...
...
@@ -463,7 +468,10 @@ def strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
julian
=
int
(
found_dict
[
'j'
])
elif
group_key
==
'Z'
:
found_zone
=
found_dict
[
'Z'
]
.
lower
()
if
locale_time
.
timezone
[
0
]
.
lower
()
==
found_zone
:
if
locale_time
.
timezone
[
0
]
==
locale_time
.
timezone
[
1
]:
pass
#Deals with bad locale setup where timezone info is
# the same; first found on FreeBSD 4.4 -current
elif
locale_time
.
timezone
[
0
]
.
lower
()
==
found_zone
:
tz
=
0
elif
locale_time
.
timezone
[
1
]
.
lower
()
==
found_zone
:
tz
=
1
...
...
Lib/test/test_strptime.py
Dosyayı görüntüle @
e16e01fa
This diff is collapsed.
Click to expand it.
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