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
65f64b19
Kaydet (Commit)
65f64b19
authored
Mar 15, 2019
tarafından
Rémi Lapeyre
Kaydeden (comit)
Vinay Sajip
Mar 15, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36272: Logging now propagates RecursionError (GH-12312)
üst
1c668d16
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
__init__.py
Lib/logging/__init__.py
+4
-0
test_logging.py
Lib/test/test_logging.py
+16
-1
2019-03-13-14-14-36.bpo-36272.f3l2IG.rst
...S.d/next/Library/2019-03-13-14-14-36.bpo-36272.f3l2IG.rst
+2
-0
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
65f64b19
...
@@ -1032,6 +1032,8 @@ class Handler(Filterer):
...
@@ -1032,6 +1032,8 @@ class Handler(Filterer):
sys
.
stderr
.
write
(
'Message:
%
r
\n
'
sys
.
stderr
.
write
(
'Message:
%
r
\n
'
'Arguments:
%
s
\n
'
%
(
record
.
msg
,
'Arguments:
%
s
\n
'
%
(
record
.
msg
,
record
.
args
))
record
.
args
))
except
RecursionError
:
# See issue 36272
raise
except
Exception
:
except
Exception
:
sys
.
stderr
.
write
(
'Unable to print the message and arguments'
sys
.
stderr
.
write
(
'Unable to print the message and arguments'
' - possible formatting error.
\n
Use the'
' - possible formatting error.
\n
Use the'
...
@@ -1094,6 +1096,8 @@ class StreamHandler(Handler):
...
@@ -1094,6 +1096,8 @@ class StreamHandler(Handler):
# issue 35046: merged two stream.writes into one.
# issue 35046: merged two stream.writes into one.
stream
.
write
(
msg
+
self
.
terminator
)
stream
.
write
(
msg
+
self
.
terminator
)
self
.
flush
()
self
.
flush
()
except
RecursionError
:
# See issue 36272
raise
except
Exception
:
except
Exception
:
self
.
handleError
(
record
)
self
.
handleError
(
record
)
...
...
Lib/test/test_logging.py
Dosyayı görüntüle @
65f64b19
...
@@ -41,7 +41,7 @@ import socket
...
@@ -41,7 +41,7 @@ import socket
import
struct
import
struct
import
sys
import
sys
import
tempfile
import
tempfile
from
test.support.script_helper
import
assert_python_ok
from
test.support.script_helper
import
assert_python_ok
,
assert_python_failure
from
test
import
support
from
test
import
support
import
textwrap
import
textwrap
import
threading
import
threading
...
@@ -4142,6 +4142,21 @@ class ModuleLevelMiscTest(BaseTest):
...
@@ -4142,6 +4142,21 @@ class ModuleLevelMiscTest(BaseTest):
self
.
assertIn
(
"exception in __del__"
,
err
)
self
.
assertIn
(
"exception in __del__"
,
err
)
self
.
assertIn
(
"ValueError: some error"
,
err
)
self
.
assertIn
(
"ValueError: some error"
,
err
)
def
test_recursion_error
(
self
):
# Issue 36272
code
=
"""if 1:
import logging
def rec():
logging.error("foo")
rec()
rec()"""
rc
,
out
,
err
=
assert_python_failure
(
"-c"
,
code
)
err
=
err
.
decode
()
self
.
assertNotIn
(
"Cannot recover from stack overflow."
,
err
)
self
.
assertEqual
(
rc
,
1
)
class
LogRecordTest
(
BaseTest
):
class
LogRecordTest
(
BaseTest
):
def
test_str_rep
(
self
):
def
test_str_rep
(
self
):
...
...
Misc/NEWS.d/next/Library/2019-03-13-14-14-36.bpo-36272.f3l2IG.rst
0 → 100644
Dosyayı görüntüle @
65f64b19
:mod:`logging` does not silently ignore RecursionError anymore. Patch
contributed by Rémi Lapeyre.
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