[issue8183] warn crashes if warning's __str__ returns Unicode

2010-03-20 Thread Ben Artin

New submission from Ben Artin :

Running the following script crashes my 2.6.1 interpreter on two different 
platforms:

from warnings import warn

class TestWarning(Warning):
def __str__(self):
return u'\u00ae'

warn(TestWarning())

Platforms I tried this on:

Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin

Python 2.6.1 (r261:67515, Dec 17 2008, 20:25:07) 
[GCC 3.4.6 [FreeBSD] 20060305] on freebsd6

Crash backtrace on Mac OS X:

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   org.python.python   0x000100059e4c PyTuple_Pack + 154
1   org.python.python   0x0001000794c1 PyErr_Warn + 468
2   org.python.python   0x00010007922b 
_PyUnicodeUCS2_IsNumeric + 5504
3   org.python.python   0x000100079fc8 PyErr_WarnExplicit + 
1113
4   org.python.python   0x0001000951df PyEval_EvalFrameEx + 
15001
5   org.python.python   0x000100096ccf PyEval_EvalCodeEx + 
1803
6   org.python.python   0x000100096d62 PyEval_EvalCode + 54
7   org.python.python   0x0001000ae65a Py_CompileString + 78
8   org.python.python   0x0001000b04dd 
PyRun_InteractiveOneFlags + 503
9   org.python.python   0x0001000b0615 
PyRun_InteractiveLoopFlags + 206
10  org.python.python   0x0001000b0685 PyRun_AnyFileExFlags 
+ 76
11  org.python.python   0x0001000bc286 Py_Main + 2718
12  python  0x00010e6c start + 52

--
components: Library (Lib)
messages: 101379
nosy: bromine
severity: normal
status: open
title: warn crashes if warning's __str__ returns Unicode
type: crash
versions: Python 2.6

___
Python tracker 
<http://bugs.python.org/issue8183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4696] email module does not fold headers

2008-12-18 Thread Ben Artin

New submission from Ben Artin :

RFC 2822 allows for certain headers to be spread across multiple lines 
(section 2.2.3). In particular, subject, comments, and keywords headers 
behave this way (section 3.6.5). 

I think the email module should unfold such headers. See attached patch.

--
components: Library (Lib)
files: feedparser.diff
keywords: patch
messages: 78042
nosy: bromine
severity: normal
status: open
title: email module does not fold headers
type: behavior
versions: Python 2.5.3, Python 2.6
Added file: http://bugs.python.org/file12399/feedparser.diff

___
Python tracker 
<http://bugs.python.org/issue4696>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com