[issue7309] crasher in str(Exception())

2009-11-12 Thread Armin Rigo

New submission from Armin Rigo :

The __str__ method of some exception classes reads attributes without
typechecking them.  Alternatively, the issue could be that the user is
allowed to set the value of these attributes directly, without
typecheck.  The typechecking is only done when we create the exception,
but not later.  Example:

>>> u=UnicodeTranslateError(u'x', 1, 5, 'bah')
>>> u.reason = 0x345345345345345345  
>>> str(u)
"can't translate characters in position 1-4: E\x03"

The 'E\x03' comes from PyString_AS_STRING(reason).  By playing enough it
is probably possible to come up with a real crasher.

--
components: Interpreter Core
messages: 95159
nosy: arigo
severity: normal
status: open
title: crasher in str(Exception())
versions: Python 2.7

___
Python tracker 

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



[issue7310] Unhelpful __repr__() in os.environ

2009-11-12 Thread Kent Johnson

New submission from Kent Johnson :

In Python 2.x, os.environ extends UserDict.IterableUserDict and
therefore os.environ.__repr__() shows the environment. This makes it
easy and intuitive to view the entire environment in the interactive
interpreter.

In Python 3.1, os.environ extends _abcoll.MutableMapping and uses
object.__repr__(). This is a much less useful representation.

I suggest adding this __repr__() method to class os._Environ (os.py line
380):

def __repr__(self): return repr(self.data)

--
components: Library (Lib)
messages: 95160
nosy: kjohnson
severity: normal
status: open
title: Unhelpful __repr__() in os.environ
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue7191] Odd behaviour with zlib.decompressobj optional parameter "wbits"

2009-11-12 Thread Anand B Pillai

Anand B Pillai  added the comment:

Ok, so you think a documentation update is enough ? Thanks.

--

___
Python tracker 

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



[issue7311] Bug on regexp of HTMLParser

2009-11-12 Thread Chiyuan Zhang

New submission from Chiyuan Zhang :

Hi all,

I'm using BeautifulSoup to parsing an HTML page and find it refused to
parse the page. By looking at the backtrace, I found it is a problem
with the python built-in HTMLParser.py. In fact, the web page I'm
parsing is with some Chinese characters. there is a tag like  , note this is legacy html page where the
attributes are not quoted. However, the regexp defined in
HTMLParser.py is :

 attrfind = re.compile(
r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*'
r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./,:;+*%?!&$\(\)_...@]*))?')

Note that the Chinese character (also any other non-english
characters), so it fire an error parsing this. I'm not sure whether
the HTML standard allow un-quoted non-ASCII characters in the
attributes. If it allows, this seems to be a bug. and the regexp to
better be [^>\s] IMHO.

BTW: It seems something like :


var st = "
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7307] test_distutils failure under Windows 7

2009-11-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This is the same as issue7293.

--
nosy: +amaury.forgeotdarc
resolution:  -> duplicate
status: open -> closed
superseder:  -> test_msvc9compiler test_reg_class failure on new Windows box

___
Python tracker 

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



[issue1479099] 'compile' built-in function failures when missing EOL

2009-11-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in r76231.

--
nosy: +benjamin.peterson
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue7312] Run some tests in a loop until failure

2009-11-12 Thread Antoine Pitrou

New submission from Antoine Pitrou :

It can be useful to run one or several of the regression tests in a
loop, until one of the tests fail. Here is a patch to do that.

(interesting thing, by the way: you can combine it with -j, in order to
run several instance of the test at once)

--
components: Tests
files: looptests.patch
keywords: patch
messages: 95166
nosy: jnoller, pitrou, r.david.murray
priority: normal
severity: normal
stage: patch review
status: open
title: Run some tests in a loop until failure
type: behavior
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file15317/looptests.patch

___
Python tracker 

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



[issue7312] Run some tests in a loop until failure

2009-11-12 Thread Jesse Noller

Jesse Noller  added the comment:

+1 I wanted to do this in +1

This is what I wanted to do in http://bugs.python.org/issue7134

I would put this in 2.x and 3.x :)

There was some feedback in this ML thread: 
http://mail.python.org/pipermail/python-dev/2009-June/090238.html

--

___
Python tracker 

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



[issue7134] Add looping capability to regrtest

2009-11-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Run some tests in a loop until failure

___
Python tracker 

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



[issue7312] Run some tests in a loop until failure

2009-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> This is what I wanted to do in http://bugs.python.org/issue7134

Ah, sorry, I hadn't seen it.

--

___
Python tracker 

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



[issue7312] Run some tests in a loop until failure

2009-11-12 Thread Jesse Noller

Jesse Noller  added the comment:

Oh, no apologies needed. You have a patch! :)

--

___
Python tracker 

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



[issue4628] No universal newline support for compile() when using bytes

2009-11-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Finally got around to fixing this. r76230

--
nosy: +benjamin.peterson
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue7312] Run some tests in a loop until failure

2009-11-12 Thread R. David Murray

R. David Murray  added the comment:

The patch generally looks good to me, but I think you overlooked line
507, where you do a pending.clear() in case of keyboard interrupt in -j
mode.  I tested it on trunk and it seems to work great, except when I
press ctl-C :)

--

___
Python tracker 

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



[issue6551] test_codecs fails when ran after test_zipimport and test_mailbox.

2009-11-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch.

--
nosy: +pitrou
stage: needs patch -> patch review

___
Python tracker 

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



[issue6551] test_codecs fails when ran after test_zipimport and test_mailbox.

2009-11-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
keywords: +patch
Added file: http://bugs.python.org/file15318/modcleanup.patch

___
Python tracker 

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



[issue6551] test_codecs fails when ran after test_zipimport and test_mailbox.

2009-11-12 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

The patch looks good to me.

--
resolution:  -> accepted

___
Python tracker 

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



[issue7060] test_multiprocessing dictionary changed size errors and hang

2009-11-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

If this is not ported by the time we get to a 2.7 or 3.2 release, I'd
like to back it out.

--
priority: normal -> release blocker

___
Python tracker 

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



[issue1294] Management of KeyboardInterrupt in cmd.py

2009-11-12 Thread Ilya Sandler

Ilya Sandler  added the comment:

> But currently, CTRL-C terminates the session instead of propagating
upstream

I am not sure I understand: currently Ctrl-C generates a
KeyboardInterrupt, which can be caught by the  application which can
then decide how to proceed (in particular it  can start another command
loop or exit with a meaningful message or anything else).

This patch would suppress KeyboardInterrupt and thus interfere with such
applications. Or am I missing something?

--

___
Python tracker 

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