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
5abca702
Kaydet (Commit)
5abca702
authored
Ock 23, 2015
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #23207: logging.basicConfig() now does additional validation of its arguments.
üst
71e72960
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
__init__.py
Lib/logging/__init__.py
+11
-8
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
5abca702
...
@@ -1723,7 +1723,7 @@ def basicConfig(**kwargs):
...
@@ -1723,7 +1723,7 @@ def basicConfig(**kwargs):
_acquireLock
()
_acquireLock
()
try
:
try
:
if
len
(
root
.
handlers
)
==
0
:
if
len
(
root
.
handlers
)
==
0
:
handlers
=
kwargs
.
get
(
"handlers"
)
handlers
=
kwargs
.
pop
(
"handlers"
,
None
)
if
handlers
is
None
:
if
handlers
is
None
:
if
"stream"
in
kwargs
and
"filename"
in
kwargs
:
if
"stream"
in
kwargs
and
"filename"
in
kwargs
:
raise
ValueError
(
"'stream' and 'filename' should not be "
raise
ValueError
(
"'stream' and 'filename' should not be "
...
@@ -1733,28 +1733,31 @@ def basicConfig(**kwargs):
...
@@ -1733,28 +1733,31 @@ def basicConfig(**kwargs):
raise
ValueError
(
"'stream' or 'filename' should not be "
raise
ValueError
(
"'stream' or 'filename' should not be "
"specified together with 'handlers'"
)
"specified together with 'handlers'"
)
if
handlers
is
None
:
if
handlers
is
None
:
filename
=
kwargs
.
get
(
"filename"
)
filename
=
kwargs
.
pop
(
"filename"
,
None
)
if
filename
:
if
filename
:
mode
=
kwargs
.
get
(
"filemode"
,
'a'
)
mode
=
kwargs
.
pop
(
"filemode"
,
'a'
)
h
=
FileHandler
(
filename
,
mode
)
h
=
FileHandler
(
filename
,
mode
)
else
:
else
:
stream
=
kwargs
.
get
(
"stream"
)
stream
=
kwargs
.
pop
(
"stream"
,
None
)
h
=
StreamHandler
(
stream
)
h
=
StreamHandler
(
stream
)
handlers
=
[
h
]
handlers
=
[
h
]
dfs
=
kwargs
.
get
(
"datefmt"
,
None
)
dfs
=
kwargs
.
pop
(
"datefmt"
,
None
)
style
=
kwargs
.
get
(
"style"
,
'
%
'
)
style
=
kwargs
.
pop
(
"style"
,
'
%
'
)
if
style
not
in
_STYLES
:
if
style
not
in
_STYLES
:
raise
ValueError
(
'Style must be one of:
%
s'
%
','
.
join
(
raise
ValueError
(
'Style must be one of:
%
s'
%
','
.
join
(
_STYLES
.
keys
()))
_STYLES
.
keys
()))
fs
=
kwargs
.
get
(
"format"
,
_STYLES
[
style
][
1
])
fs
=
kwargs
.
pop
(
"format"
,
_STYLES
[
style
][
1
])
fmt
=
Formatter
(
fs
,
dfs
,
style
)
fmt
=
Formatter
(
fs
,
dfs
,
style
)
for
h
in
handlers
:
for
h
in
handlers
:
if
h
.
formatter
is
None
:
if
h
.
formatter
is
None
:
h
.
setFormatter
(
fmt
)
h
.
setFormatter
(
fmt
)
root
.
addHandler
(
h
)
root
.
addHandler
(
h
)
level
=
kwargs
.
get
(
"level"
)
level
=
kwargs
.
pop
(
"level"
,
None
)
if
level
is
not
None
:
if
level
is
not
None
:
root
.
setLevel
(
level
)
root
.
setLevel
(
level
)
if
kwargs
:
keys
=
', '
.
join
(
kwargs
.
keys
())
raise
ValueError
(
'Unrecognised argument(s):
%
s'
%
keys
)
finally
:
finally
:
_releaseLock
()
_releaseLock
()
...
...
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