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
7be5d7d0
Kaydet (Commit)
7be5d7d0
authored
Eki 21, 2013
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 19306: Add extra hints to faulthandler stack dumps that they are upside down.
üst
5c16c2eb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
19 deletions
+30
-19
test_faulthandler.py
Lib/test/test_faulthandler.py
+9
-9
NEWS
Misc/NEWS
+13
-2
traceback.c
Python/traceback.c
+8
-8
No files found.
Lib/test/test_faulthandler.py
Dosyayı görüntüle @
7be5d7d0
...
@@ -72,9 +72,9 @@ class FaultHandlerTests(unittest.TestCase):
...
@@ -72,9 +72,9 @@ class FaultHandlerTests(unittest.TestCase):
Raise an error if the output doesn't match the expected format.
Raise an error if the output doesn't match the expected format.
"""
"""
if
all_threads
:
if
all_threads
:
header
=
'Current thread XXX'
header
=
'Current thread XXX
(most recent call first)
'
else
:
else
:
header
=
'
Traceb
ack (most recent call first)'
header
=
'
St
ack (most recent call first)'
regex
=
"""
regex
=
"""
^Fatal Python error: {name}
^Fatal Python error: {name}
...
@@ -306,7 +306,7 @@ funcA()
...
@@ -306,7 +306,7 @@ funcA()
else
:
else
:
lineno
=
8
lineno
=
8
expected
=
[
expected
=
[
'
Traceb
ack (most recent call first):'
,
'
St
ack (most recent call first):'
,
' File "<string>", line
%
s in funcB'
%
lineno
,
' File "<string>", line
%
s in funcB'
%
lineno
,
' File "<string>", line 11 in funcA'
,
' File "<string>", line 11 in funcA'
,
' File "<string>", line 13 in <module>'
' File "<string>", line 13 in <module>'
...
@@ -338,7 +338,7 @@ def {func_name}():
...
@@ -338,7 +338,7 @@ def {func_name}():
func_name
=
func_name
,
func_name
=
func_name
,
)
)
expected
=
[
expected
=
[
'
Traceb
ack (most recent call first):'
,
'
St
ack (most recent call first):'
,
' File "<string>", line 4 in
%
s'
%
truncated
,
' File "<string>", line 4 in
%
s'
%
truncated
,
' File "<string>", line 6 in <module>'
' File "<string>", line 6 in <module>'
]
]
...
@@ -392,13 +392,13 @@ waiter.join()
...
@@ -392,13 +392,13 @@ waiter.join()
else
:
else
:
lineno
=
10
lineno
=
10
regex
=
"""
regex
=
"""
^Thread 0x[0-9a-f]+:
^Thread 0x[0-9a-f]+
\
(most recent call first
\
)
:
(?: File ".*threading.py", line [0-9]+ in [_a-z]+
(?: File ".*threading.py", line [0-9]+ in [_a-z]+
){{1,3}} File "<string>", line 23 in run
){{1,3}} File "<string>", line 23 in run
File ".*threading.py", line [0-9]+ in _bootstrap_inner
File ".*threading.py", line [0-9]+ in _bootstrap_inner
File ".*threading.py", line [0-9]+ in _bootstrap
File ".*threading.py", line [0-9]+ in _bootstrap
Current thread XXX:
Current thread XXX
\
(most recent call first
\
)
:
File "<string>", line {lineno} in dump
File "<string>", line {lineno} in dump
File "<string>", line 28 in <module>$
File "<string>", line 28 in <module>$
"""
.
strip
()
"""
.
strip
()
...
@@ -461,7 +461,7 @@ if file is not None:
...
@@ -461,7 +461,7 @@ if file is not None:
count
=
loops
count
=
loops
if
repeat
:
if
repeat
:
count
*=
2
count
*=
2
header
=
r'Timeout \(
%
s\)!\nThread 0x[0-9a-f]+:\n'
%
timeout_str
header
=
r'Timeout \(
%
s\)!\nThread 0x[0-9a-f]+
\(most recent call first\)
:\n'
%
timeout_str
regex
=
expected_traceback
(
9
,
20
,
header
,
min_count
=
count
)
regex
=
expected_traceback
(
9
,
20
,
header
,
min_count
=
count
)
self
.
assertRegex
(
trace
,
regex
)
self
.
assertRegex
(
trace
,
regex
)
else
:
else
:
...
@@ -563,9 +563,9 @@ sys.exit(exitcode)
...
@@ -563,9 +563,9 @@ sys.exit(exitcode)
trace
=
'
\n
'
.
join
(
trace
)
trace
=
'
\n
'
.
join
(
trace
)
if
not
unregister
:
if
not
unregister
:
if
all_threads
:
if
all_threads
:
regex
=
'Current thread XXX:
\n
'
regex
=
'Current thread XXX
\
(most recent call first
\
)
:
\n
'
else
:
else
:
regex
=
'
Traceb
ack
\
(most recent call first
\
):
\n
'
regex
=
'
St
ack
\
(most recent call first
\
):
\n
'
regex
=
expected_traceback
(
7
,
28
,
regex
)
regex
=
expected_traceback
(
7
,
28
,
regex
)
self
.
assertRegex
(
trace
,
regex
)
self
.
assertRegex
(
trace
,
regex
)
else
:
else
:
...
...
Misc/NEWS
Dosyayı görüntüle @
7be5d7d0
...
@@ -2,10 +2,21 @@
...
@@ -2,10 +2,21 @@
Python
News
Python
News
+++++++++++
+++++++++++
What
's New in Python 3.4.0 Beta 1?
==================================
Projected release date: 2013-11-24
Core and Builtins
-----------------
- Issue 19306: Add extra hints to the faulthandler module'
s
stack
dumps
that
these
are
"upside down"
.
What
's New in Python 3.4.0 Alpha 4?
What
's New in Python 3.4.0 Alpha 4?
================================
================================
===
Projected r
elease date: 2013-10-20
R
elease date: 2013-10-20
Core and Builtins
Core and Builtins
-----------------
-----------------
...
...
Python/traceback.c
Dosyayı görüntüle @
7be5d7d0
...
@@ -471,13 +471,13 @@ dump_decimal(int fd, int value)
...
@@ -471,13 +471,13 @@ dump_decimal(int fd, int value)
write
(
fd
,
buffer
,
len
);
write
(
fd
,
buffer
,
len
);
}
}
/* Format an integer in range [0; 0xffffffff] to hexdecimal of 'width' digits,
/* Format an integer in range [0; 0xffffffff] to hex
a
decimal of 'width' digits,
and write it into the file fd.
and write it into the file fd.
This function is signal safe. */
This function is signal safe. */
static
void
static
void
dump_hexadecimal
(
int
width
,
unsigned
long
value
,
int
fd
)
dump_hexadecimal
(
int
fd
,
unsigned
long
value
,
int
width
)
{
{
int
len
;
int
len
;
char
buffer
[
sizeof
(
unsigned
long
)
*
2
+
1
];
char
buffer
[
sizeof
(
unsigned
long
)
*
2
+
1
];
...
@@ -544,15 +544,15 @@ dump_ascii(int fd, PyObject *text)
...
@@ -544,15 +544,15 @@ dump_ascii(int fd, PyObject *text)
}
}
else
if
(
ch
<
0xff
)
{
else
if
(
ch
<
0xff
)
{
PUTS
(
fd
,
"
\\
x"
);
PUTS
(
fd
,
"
\\
x"
);
dump_hexadecimal
(
2
,
ch
,
fd
);
dump_hexadecimal
(
fd
,
ch
,
2
);
}
}
else
if
(
ch
<
0xffff
)
{
else
if
(
ch
<
0xffff
)
{
PUTS
(
fd
,
"
\\
u"
);
PUTS
(
fd
,
"
\\
u"
);
dump_hexadecimal
(
4
,
ch
,
fd
);
dump_hexadecimal
(
fd
,
ch
,
4
);
}
}
else
{
else
{
PUTS
(
fd
,
"
\\
U"
);
PUTS
(
fd
,
"
\\
U"
);
dump_hexadecimal
(
8
,
ch
,
fd
);
dump_hexadecimal
(
fd
,
ch
,
8
);
}
}
}
}
if
(
truncated
)
if
(
truncated
)
...
@@ -603,7 +603,7 @@ dump_traceback(int fd, PyThreadState *tstate, int write_header)
...
@@ -603,7 +603,7 @@ dump_traceback(int fd, PyThreadState *tstate, int write_header)
unsigned
int
depth
;
unsigned
int
depth
;
if
(
write_header
)
if
(
write_header
)
PUTS
(
fd
,
"
Traceb
ack (most recent call first):
\n
"
);
PUTS
(
fd
,
"
St
ack (most recent call first):
\n
"
);
frame
=
_PyThreadState_GetFrame
(
tstate
);
frame
=
_PyThreadState_GetFrame
(
tstate
);
if
(
frame
==
NULL
)
if
(
frame
==
NULL
)
...
@@ -641,8 +641,8 @@ write_thread_id(int fd, PyThreadState *tstate, int is_current)
...
@@ -641,8 +641,8 @@ write_thread_id(int fd, PyThreadState *tstate, int is_current)
PUTS
(
fd
,
"Current thread 0x"
);
PUTS
(
fd
,
"Current thread 0x"
);
else
else
PUTS
(
fd
,
"Thread 0x"
);
PUTS
(
fd
,
"Thread 0x"
);
dump_hexadecimal
(
sizeof
(
long
)
*
2
,
(
unsigned
long
)
tstate
->
thread_id
,
fd
);
dump_hexadecimal
(
fd
,
(
unsigned
long
)
tstate
->
thread_id
,
sizeof
(
long
)
*
2
);
PUTS
(
fd
,
":
\n
"
);
PUTS
(
fd
,
"
(most recent call first)
:
\n
"
);
}
}
const
char
*
const
char
*
...
...
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