[issue14034] Add argparse howto

2012-05-07 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe  added the comment:

thanks so much for your rime in reviewing and committing

--

___
Python tracker 

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



[issue14736] Add {encode, decode}_filter_properties() functions to lzma module

2012-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Changeset 9118ef2b651a was broken, but the bug should have been fixed by
> changeset 10ccbb90a8e9. Which revision have you been using?

I used the revision 76809:ab57e29157bb. Yes, now the bug fixed. Thank
you once again.

--
title: Add {encode,decode}_filter_properties() functions to lzma module -> Add 
{encode, decode}_filter_properties() functions to lzma module

___
Python tracker 

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



[issue14695] Tools/parser/unparse.py is out of date.

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f9344a3eaaa6 by Mark Dickinson in branch 'default':
Issue #14695: Run Tools/parser/test_unparse.py as part of test_tools.
http://hg.python.org/cpython/rev/f9344a3eaaa6

--
nosy: +python-dev

___
Python tracker 

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



[issue14695] Tools/parser/unparse.py is out of date.

2012-05-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks, David!

--
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



[issue14739] Add PyArg_Parse format unit like O& but providing context

2012-05-07 Thread Larry Hastings

New submission from Larry Hastings :

If you write a PyArg_Parse "converter", and your conversion hits an error, you 
must raise an exception and error out.  But, since your converter has no 
context about the parameter, it can't provide any helpful information in the 
error.

For example, PyUnicode_FSConverter attempts to convert a PyUnicode object to a 
PyBytes object; if it gets back some other kind of object, it calls
 PyErr_SetString(PyExc_TypeError, "encoder failed to return bytes");
What parameter did this happen with?  When calling what function?  The hapless 
programmer is forced to guess.

In practice, the argument parser generally knows the name of the function and 
the name of the parameter.  It'd be nice to encode those values in the error.  
But that information isn't passed in to the converter.

I propose adding a new format unit, let's call it 'O%', which is identical to 
'O&' except for the signature of the converter function:

int converter(PyObject *o, void *p, PyConverterContext_t *context);

where PyConverterContext_t is defined as

typedef struct {
char *function_name;
char *parameter_name;
} PyConverterContext_t;

If the function name or parameter name is not known, it will be NULL.

--
messages: 160125
nosy: larry
priority: normal
severity: normal
status: open
title: Add PyArg_Parse format unit like O& but providing context

___
Python tracker 

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



[issue14739] Add PyArg_Parse format unit like O& but providing context

2012-05-07 Thread Larry Hastings

Changes by Larry Hastings :


--
assignee:  -> larry

___
Python tracker 

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



[issue14739] Add PyArg_Parse format unit like O& but providing context

2012-05-07 Thread Larry Hastings

Changes by Larry Hastings :


--
components: +Interpreter Core
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue9530] integer undefined behaviors

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c9c2031cf16d by Mark Dickinson in branch 'default':
Add John Regehr to Misc/ACKS for his help with finding integer overflows (issue 
#9530).
http://hg.python.org/cpython/rev/c9c2031cf16d

--

___
Python tracker 

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



[issue14705] Add 'bool' format character to PyArg_ParseTuple*

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e4617650f006 by Larry Hastings in branch 'default':
Issue #14705: Added support for the new 'p' format unit to skipitem().
http://hg.python.org/cpython/rev/e4617650f006

--

___
Python tracker 

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



[issue14739] Add PyArg_Parse format unit like O& but providing context

2012-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It would be better if the functions PyArg_Parse* were wrapped converter's 
exception, in other exception with adding the names of function and parameter 
in the message. This will save us from necessity of the introduction of the new 
interface and immediately give effect to the old code.

--
nosy: +storchaka

___
Python tracker 

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



[issue14695] Tools/parser/unparse.py is out of date.

2012-05-07 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue14722] Overflow in parsing 'float' parameters in PyArg_ParseTuple*

2012-05-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

Closing as "won't fix";  Python is sadly far from consistent about returning 
infinity versus raising OverflowError, in a wide variety of situations.  For 
example, compare:

* float(Decimal('1e310')) with float(Fraction('1e310')), or 

* struct.pack('f', 1e100) with struct.pack(' wont fix
status: open -> closed

___
Python tracker 

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



[issue14700] Integer overflow in classic string formatting

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 064c2d0483f8 by Mark Dickinson in branch 'default':
Issue #14700: Fix two broken and undefined-behaviour-inducing overflow checks 
in old-style string formatting.  Thanks Serhiy Storchaka for report and 
original patch.
http://hg.python.org/cpython/rev/064c2d0483f8

--
nosy: +python-dev

___
Python tracker 

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



[issue14700] Integer overflow in classic string formatting

2012-05-07 Thread Mark Dickinson

Changes by Mark Dickinson :


--
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



[issue13697] python RLock implementation unsafe with signals

2012-05-07 Thread Mike Meyer

Mike Meyer  added the comment:

I just ran into this issue in the logging module using 2.7. Here's the TB in
case it sheds any light on the issue

Traceback (most recent call last):
  File "./crawler.py", line 531, in 
main(argv[1:]1:)
  File "./crawler.py", line 522, in main
MCP(config).run()
  File "./crawler.py", line 332, in run
self.reaper()
  File "./crawler.py", line 359, in reaper
logging.debug('MCP process alive: %s', state)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1600, in debug
root.debug(msg, *args, **kwargs)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1120, in debug
self._log(DEBUG, msg, args, **kwargs)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1250, in _log
self.handle(record)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1260, in handle
self.callHandlers(record)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1300, in 
callHandlers
hdlr.handle(record)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 746, in handle
self.release()
  File "/usr/local/lib/python2.7/logging/__init__.py", line 700, in release
self.lock.release()
  File "/usr/local/lib/python2.7/threading.py", line 147, in release
self.__block.release()
thread.error: release unlocked lock

Since I'm not using threads, getting thread errors was a little bit of
a surprise. I guess trying to make the logging module thread safe
added a potential bug.

--
nosy: +Mike.Meyer

___
Python tracker 

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



[issue14722] Overflow in parsing 'float' parameters in PyArg_ParseTuple*

2012-05-07 Thread Stefan Krah

Stefan Krah  added the comment:

I agree. Fixing all this would probably require a PEP. It looks like the
original plan was to provide a facility to turn off the Overflow exception:

http://mail.python.org/pipermail/python-dev/2000-May/003990.html

--

___
Python tracker 

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



[issue14739] Add PyArg_Parse format unit like O& but providing context

2012-05-07 Thread Georg Brandl

Changes by Georg Brandl :


--
nosy: +georg.brandl, loewis

___
Python tracker 

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



[issue14701] parser module doesn't support 'raise ... from'

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset fc17f70292f6 by Mark Dickinson in branch '3.2':
Issue #14701:  Add missing support for 'raise ... from' in parser module.
http://hg.python.org/cpython/rev/fc17f70292f6

New changeset 0dd0d56bdcc1 by Mark Dickinson in branch 'default':
Issue #14701: Merge fix from 3.2.
http://hg.python.org/cpython/rev/0dd0d56bdcc1

--
nosy: +python-dev

___
Python tracker 

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



[issue14588] PEP 3115 compliant dynamic class creation

2012-05-07 Thread Nick Coghlan

Nick Coghlan  added the comment:

In going to add documentation for your patch, I realised the operator module is 
not the right place for this.

The "types" module actually seems like the most appropriate home, but that will 
require adding a _types module to back it.

I'll post to python-dev to get additional feedback.

--

___
Python tracker 

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



[issue14701] parser module doesn't support 'raise ... from'

2012-05-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

Now fixed.

Terry: I suggest opening a separate doc issue for the 'CPython-specific' issue

--
assignee:  -> mark.dickinson
components: +Library (Lib)
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



[issue14716] Use unicode_writer API for str.format()

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 7be716a47e9d by Victor Stinner in branch 'default':
Close #14716: str.format() now uses the new "unicode writer" API instead of the
http://hg.python.org/cpython/rev/7be716a47e9d

New changeset ab500b297900 by Victor Stinner in branch 'default':
Issue #14716: Change integer overflow check in unicode_writer_prepare()
http://hg.python.org/cpython/rev/ab500b297900

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue6602] BaseHTTPServer log_message should log to sys.stdout

2012-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Disagreed. sys.stderr is not only for "errors" but all informational messages 
of little value (warnings, debug messages etc.). Also, logging to two different 
streams makes redirecting clumsier.

If you want to change this, it would more useful to add a facility to allow 
users to choose output streams. Or even - shocking idea - to integrate the 
logging module in BaseHTTPServer.

--
nosy: +pitrou

___
Python tracker 

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



[issue9177] ssl.read/write on closed socket raises AttributeError

2012-05-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti, pitrou
stage:  -> needs patch
versions: +Python 3.3 -Python 2.6, Python 3.1

___
Python tracker 

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



[issue9177] ssl.read/write on closed socket raises AttributeError

2012-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I don't think mimicking EBADF is very useful. Reading from a closed socket is 
usually a programming error, so it's not the kind of error you'll want to catch 
at runtime.

AttributeError may not be very pretty though, so perhaps a ValueError can be 
raised as with closed files:

>>> f = open("LICENSE")
>>> f.close()
>>> f.read()
Traceback (most recent call last):
  File "", line 1, in 
ValueError: I/O operation on closed file.

--
type: behavior -> enhancement
versions:  -Python 2.7, Python 3.2

___
Python tracker 

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



[issue11477] Bug in code dispatching based on internal slots

2012-05-07 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'm currently planning to postpone fixing this until 3.4. However, if someone 
else wants to pick it up for 3.3, go ahead.

--
assignee: ncoghlan -> 
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2012-05-07 Thread Nick Coghlan

Nick Coghlan  added the comment:

Superseded by issue 13585 (which will add an improved dynamic context 
management API)

--
resolution: postponed -> out of date
status: open -> closed
superseder:  -> Add contextlib.ExitStack

___
Python tracker 

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



[issue1294232] Error in metaclass search order

2012-05-07 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee: ncoghlan -> 

___
Python tracker 

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



[issue14700] Integer overflow in classic string formatting

2012-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Mark, I deliberately have not used the exact formula for the overflow. 
Comparison with the constant is much cheaper than division or multiplication.

Microbencmark:

./python -m timeit -s 'f="%.1234567890s"*100;x=("",)*100'  'f%x'

Before changeset 064c2d0483f8:  1 loops, best of 3: 27.1 usec per loop
Changeset 064c2d0483f8:  1 loops, best of 3: 25.7 usec per loop
Original patch:  10 loops, best of 3: 18.2 usec per loop

--

___
Python tracker 

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



[issue14700] Integer overflow in classic string formatting

2012-05-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

Sure, I realize that, but I prefer not to be sloppy in the overflow check, and 
to use the same formula that's already used in stringlib.  I somehow doubt that 
this micro-optimization is going to have any noticeable effect in real code.

--

___
Python tracker 

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



[issue14722] Overflow in parsing 'float' parameters in PyArg_ParseTuple*

2012-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

May be proposed tests (except for the overflow) would be helpful? Right now 'f' 
and 'd' parsing code is not covered by tests.

--

___
Python tracker 

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



[issue14740] get_payload(n, True) returns None

2012-05-07 Thread Bob Glickstein

New submission from Bob Glickstein :

Passing both a value for i and decode=True to 
email.message.Message.get_payload(), when self is a multipart, returns None 
when it should return a string.  The reason is that an is_multipart() test is 
done on self when it should instead be done on the selected payload part.  
Here's a patch that fixes this:


--- /usr/lib64/python2.7/email/message.py   2011-10-26 18:40:36.0 
-0700
+++ /home/bobg/tmp/message.py   2012-05-07 06:34:28.579401481 -0700
@@ -192,9 +192,9 @@
 else:
 payload = self._payload[i]
 if decode:
-if self.is_multipart():
+if payload.is_multipart():
 return None
-cte = self.get('content-transfer-encoding', '').lower()
+cte = payload.get('content-transfer-encoding', '').lower()
 if cte == 'quoted-printable':
 return utils._qdecode(payload)
 elif cte == 'base64':

--
components: Library (Lib)
messages: 160144
nosy: Bob.Glickstein
priority: normal
severity: normal
status: open
title: get_payload(n, True) returns None
type: behavior
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



[issue14740] get_payload(n, True) returns None

2012-05-07 Thread Bob Glickstein

Bob Glickstein  added the comment:

Incidentally, a workaround is:

msg.get_payload(n).get_payload(decode=True)

--

___
Python tracker 

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



[issue14740] get_payload(n, True) returns None

2012-05-07 Thread R. David Murray

R. David Murray  added the comment:

Thanks for the report and patch suggestion, but...

This is actually the way it is designed to work.  get_payload(i) returns the 
ith element of a multipart payload.  Your workaround is in fact the correct way 
to do this operation.  decode=True is documented to return None if is_multipart 
is True.

You will note that if decode=False, you get back the Message sub-object, not a 
string.  Since decoding a Message object (as opposed to its payload) is not a 
meaningful operation, None is returned for decode=True.  Arguably we should 
raise a TypeError or ValueError instead, but we don't for historical reasons.

--
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue14657] Avoid two importlib copies

2012-05-07 Thread Brett Cannon

Brett Cannon  added the comment:

Should we have a separate context manager for this, or just make it a flag for 
a unified import_state() decorator? Or do we want to *always* force the use of 
the Python code instead of the frozen code?

--

___
Python tracker 

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



[issue14657] Avoid two importlib copies

2012-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Should we have a separate context manager for this, or just make it a
> flag for a unified import_state() decorator? Or do we want to *always*
> force the use of the Python code instead of the frozen code?

Ideally, we would want to test both versions, so that any oddity in the
freezing mechanism gets exercised and diagnosed properly.

--

___
Python tracker 

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



[issue14657] Avoid two importlib copies

2012-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Ideally, we would want to test both versions, so that any oddity in the
> freezing mechanism gets exercised and diagnosed properly.

(not to mention the speedups in import.c)

--

___
Python tracker 

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



[issue14657] Avoid two importlib copies

2012-05-07 Thread Eric Snow

Eric Snow  added the comment:

I'm +1 on Nick's recommendation.

@Antoine
> Ideally, we would want to test both versions, so that any oddity in
> the freezing mechanism gets exercised and diagnosed properly.

+1

Does this mean that the whole test suite should be run under both (whenever 
_bootstrap.py is modified)?  Would that warrant a new flag for the test suite 
or even an automated check?

That's what I was getting at with this:

> 1. python starts up normally.
> 2. we clear out all the entire import state except for builtins.
> 3. we stick importlib._bootstrap in place.
> 4. we set builtins.__import__ to importlib.__import__.
> 5. we re-populate sys.modules by reloading all the modules that
> were in there before (?).
> 6. we run the test suite against this new import state.

--

___
Python tracker 

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



[issue4508] distutils compiler not handling spaces in path to output/src files

2012-05-07 Thread fishdude

fishdude  added the comment:

i have to report that this issue also happens on Linux and Mac as well.
no matter wether python 2.6 or 2.7 is used.

--
components: +Macintosh
nosy: +fishdude
versions: +Python 2.6

___
Python tracker 

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



[issue14697] parser module doesn't support set displays or set comprehensions

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 129289144dfb by Mark Dickinson in branch '3.2':
Issue #14697: Fix missing parser module support for set displays and set 
comprehensions.
http://hg.python.org/cpython/rev/129289144dfb

New changeset 4815a4a4a852 by Mark Dickinson in branch 'default':
Issue #14697:  Merge fix from 3.2.
http://hg.python.org/cpython/rev/4815a4a4a852

--
nosy: +python-dev

___
Python tracker 

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



[issue14697] parser module doesn't support set displays or set comprehensions

2012-05-07 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> mark.dickinson
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



[issue14657] Avoid two importlib copies

2012-05-07 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

It might be sufficient to only run tests from the following files with both 
importlib._bootstrap and _frozen_importlib:
test_imp.py
test_import.py
test_importhooks.py
test_importlib.py
test_pkgimport.py
test_threaded_import.py
test_zipimport.py
test_zipimport_support.py

--

___
Python tracker 

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



[issue14657] Avoid two importlib copies

2012-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> It might be sufficient to only run tests from the following files with
> both importlib._bootstrap and _frozen_importlib:

I was only thinking about test_importlib myself.

--

___
Python tracker 

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



[issue14700] Integer overflow in classic string formatting

2012-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> I somehow doubt that this micro-optimization is going to have any noticeable 
> effect in real code.

Agree. I just found this bug, trying to optimize the code.

--

___
Python tracker 

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



[issue4508] distutils compiler not handling spaces in path to output/src files

2012-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the confirmation.  Note that the versions field in this bug tracker 
indicates the versions that will get fixed, not all versions with the bug; 2.6 
only gets security fixes now.

Are you interested in updating the patch with a test (see my previous messages)?

--
assignee: tarek -> eric.araujo
components: +Distutils2 -Extension Modules, Macintosh, Windows
nosy: +alexis
versions: +3rd party -Python 2.6

___
Python tracker 

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



[issue14741] parser module doesn't support Ellipsis.

2012-05-07 Thread Mark Dickinson

New submission from Mark Dickinson :

Here's a simple patch.  With this and other recent patches to the parser 
module, we can now correctly roundtrip all the (valid) Python files in Lib/ and 
Lib/test/.

--
assignee: mark.dickinson
components: Library (Lib)
files: parser_ellipsis.patch
keywords: patch
messages: 160157
nosy: mark.dickinson
priority: normal
severity: normal
stage: needs patch
status: open
title: parser module doesn't support Ellipsis.
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25487/parser_ellipsis.patch

___
Python tracker 

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



[issue14741] parser module doesn't support Ellipsis.

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2b1cc84bf1d9 by Mark Dickinson in branch '3.2':
Issue #14741: Fix missing support for ellipsis in parser module.
http://hg.python.org/cpython/rev/2b1cc84bf1d9

New changeset d50577c5711b by Mark Dickinson in branch 'default':
Issue #14741: Merge fix from 3.2.
http://hg.python.org/cpython/rev/d50577c5711b

--
nosy: +python-dev

___
Python tracker 

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



[issue14741] parser module doesn't support Ellipsis.

2012-05-07 Thread Mark Dickinson

Changes by Mark Dickinson :


--
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



[issue14072] urlparse on tel: URI-s misses the scheme in some cases

2012-05-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

> In the patch I'm assuming that the port number can only contain ascii digits

RFC 3986 [0] defines the port as
   port  = *DIGIT
and part of the "authority" [1] as
   authority = [ userinfo "@" ] host [ ":" port ]
   userinfo  = *( unreserved / pct-encoded / sub-delims / ":" )
   host  = IP-literal / IPv4address / reg-name
   port  = *DIGIT
so my assumption should be correct.

[0]: http://tools.ietf.org/html/rfc3986#section-3.2.3
[1]: http://tools.ietf.org/html/rfc3986#appendix-A

--
stage: patch review -> commit review
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue10733] plistlib rejects strings containing control characters

2012-05-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue14072] urlparse on tel: URI-s misses the scheme in some cases

2012-05-07 Thread R. David Murray

R. David Murray  added the comment:

See also issue 14036.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue10765] Build regression from automation changes on windows

2012-05-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

Can you still reproduce this?

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue13936] datetime.time(0, 0, 0) evaluates to False despite being a valid time

2012-05-07 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue10427] 24:00 Hour in DateTime

2012-05-07 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue14657] Avoid two importlib copies

2012-05-07 Thread Brett Cannon

Brett Cannon  added the comment:

I would say test_importlib and test_imp (test_import really should just get 
folded into test_importlib).

--

___
Python tracker 

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



[issue14366] Supporting lzma compression in zip files

2012-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The patch updated to use functions encode_filter_properties and 
decode_filter_properties from the lzma module. Thank you, Nadeem Vawda.

--
Added file: http://bugs.python.org/file25488/lzma_in_zip_2.patch

___
Python tracker 

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



[issue14366] Supporting lzma compression in zip files

2012-05-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file25430/lzma_in_zip.patch

___
Python tracker 

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



[issue14583] try/except import fails --without-threads

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d6324941b739 by Antoine Pitrou in branch 'default':
Issue #14583: Fix importlib bug when a package's __init__.py would first import 
one of its modules then raise an error.
http://hg.python.org/cpython/rev/d6324941b739

--
nosy: +python-dev

___
Python tracker 

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



[issue14742] test_tools very slow

2012-05-07 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Apparently test_unparse goes a bit overboard. test_compiler in 2.x had a more 
reasonable approach: it only compiled all files with -uall, otherwise it would 
choose 10 at random.

--
components: Tests
messages: 160165
nosy: mark.dickinson, pitrou
priority: normal
severity: normal
status: open
title: test_tools very slow
type: performance
versions: Python 3.3

___
Python tracker 

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



[issue14743] on terminating, Pdb debugs itself

2012-05-07 Thread Xavier de Gaye

New submission from Xavier de Gaye :

All the problems raised in this issue are caused by self.botframe
being set in a Pdb frame.

In the following pdb session run with python 3.2.2, the first two
frames in the printed stack are Pdb frames, this is wrong. And the
second step command steps incorrectly into the exec() frame that is
called by the Bdb run() method. What prevents the third step command
to step into the run() frame, is that this frame does not have a trace
function setup initially.
===   foo.py=
i = 1
=
$ python3 -m pdb foo.py
> path_to/foo.py(1)()
-> i = 1
(Pdb) import sys; print(sys.version)
3.2.2 (default, Dec 27 2011, 17:35:55) 
[GCC 4.3.2]
(Pdb) where
  /usr/local/lib/python3.2/bdb.py(392)run()
-> exec(cmd, globals, locals)
  (1)()
> path_to/foo.py(1)()
-> i = 1
(Pdb) step
--Return--
> path_to/foo.py(1)()->None
-> i = 1
(Pdb) step
--Return--
> (1)()->None
(Pdb) step
The program finished and will be restarted
> path_to/foo.py(1)()
-> i = 1
(Pdb) quit
=


In the following pdb session run with python built from the default
branch (i.e. after issue 13183 has been fixed) the third step command
steps into the run() method of Bdb and the backtrace printed after the
quit command shows duplicate entries. Pdb is trying to debug itself !
Pdb steps in the run() method because after the fix in issue 13183,
Pdb knows now how to step when returning into the caller frame with no
trace function.
===   foo.py=
i = 1
=
$ python -m pdb foo.py 
> path_to/foo.py(1)()
-> i = 1
(Pdb) step
--Return--
> path_to/foo.py(1)()->None
-> i = 1
(Pdb) step
--Return--
> (1)()->None
(Pdb) step
> path_to/cpython/Lib/bdb.py(409)run()
-> self.quitting = True
(Pdb) quit
Traceback (most recent call last):
  File "path_to/cpython/Lib/pdb.py", line 1651, in main
pdb._runscript(mainpyfile)
  File "path_to/cpython/Lib/pdb.py", line 1532, in _runscript
self.run(statement)
  File "path_to/cpython/Lib/bdb.py", line 409, in run
self.quitting = True
  File "path_to/cpython/Lib/bdb.py", line 409, in run
self.quitting = True
  File "path_to/cpython/Lib/bdb.py", line 47, in trace_dispatch
return self.dispatch_line(frame)
  File "path_to/cpython/Lib/bdb.py", line 66, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> path_to/cpython/Lib/bdb.py(66)dispatch_line()
-> if self.quitting: raise BdbQuit
(Pdb) quit
Post mortem debugger finished. The foo.py will be restarted
> path_to/foo.py(1)()
-> i = 1
(Pdb) quit
=


In the following pdb session run with python 3.2.2, the session is
interrupted with . The same problems occur as in the previous
case.
=
import time
i = 1
while i:
time.sleep(.100)
i = 0
=
$ python3 -m pdb foo.py
> path_to/foo.py(1)()
-> import time
(Pdb) import sys; print(sys.version)
3.2.2 (default, Dec 27 2011, 17:35:55) 
[GCC 4.3.2]
(Pdb) continue
^C
Program interrupted. (Use 'cont' to resume).
> path_to/foo.py(3)()
-> while i:
(Pdb) !i=0
(Pdb) step
> path_to/foo.py(5)()
-> i = 0
(Pdb) step
--Return--
> path_to/foo.py(5)()->None
-> i = 0
(Pdb) step
--Return--
> (1)()->None
(Pdb) step
> /usr/local/lib/python3.2/bdb.py(396)run()
-> self.quitting = True
(Pdb) quit
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/pdb.py", line 1556, in main
pdb._runscript(mainpyfile)
  File "/usr/local/lib/python3.2/pdb.py", line 1437, in _runscript
self.run(statement)
  File "/usr/local/lib/python3.2/bdb.py", line 396, in run
self.quitting = True
  File "/usr/local/lib/python3.2/bdb.py", line 396, in run
self.quitting = True
  File "/usr/local/lib/python3.2/bdb.py", line 46, in trace_dispatch
return self.dispatch_line(frame)
  File "/usr/local/lib/python3.2/bdb.py", line 65, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /usr/local/lib/python3.2/bdb.py(65)dispatch_line()
-> if self.quitting: raise BdbQuit
(Pdb) quit
Post mortem debugger finished. The foo.py will be restarted
> path_to/foo.py(1)()
-> import time
(Pdb) quit
=


The attached patch fixes all those problems. The patch applies to the
default branch.

--
components: Library (Lib)
files: pdb_botframe_default.patch
keywords: patch
messages: 160166
nosy: xdegaye
priority: normal
severity: normal
status: open
title: on terminating, Pdb debugs itself
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25489/pdb_botframe_default.patch


[issue14583] try/except import fails --without-threads

2012-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Should be fixed now. The buildbot has been able to launch the test suite.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue13183] pdb skips frames after hitting a breakpoint and running step

2012-05-07 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Note that now that this issue is fixed, issue 14743 has become more
visible.

--

___
Python tracker 

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



[issue10765] Build regression from automation changes on windows

2012-05-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +brian.curtin

___
Python tracker 

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



[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-05-07 Thread Glenn Linderman

Glenn Linderman  added the comment:

Hi Pierre,

You are right, the "found" variable is not needed, I guess the reason I coded 
it that way, is I had some validation code before the return, during testing, 
so it was easier not to have it in three places.

Regarding precalculating ln, I don't know how Python is coded internally, so it 
seems that string compares could be lengthier integer compares, and even in 
your code the length is calculated sometimes.  So it is mostly an order of 
operations optimization... I didn't attempt to benchmark it with various URL 
and cgi_directories values, including at least both some with large prefix 
matches, and some without... I didn't figure it would matter much, but if you 
think it does, then feel free to benchmark.

--

___
Python tracker 

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



[issue12298] Sphinx glitch in library/functions

2012-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

Sandro ported to 2.7 in 07b3fc67bf45.  Thanks!

If I may make two remarks:

- Please duplicate commit messages from 3.2 and 2.7: it makes it easier to 
understand what a changeset is about without having to hunt.  (This does not 
apply to 3.3 as the changeset with the full commit message is a direct parent 
and thus easily found.)

- I’m not retired yet :)

--
nosy: +sandro.tosi
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue14742] test_tools very slow

2012-05-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

That sounds like a better approach.  I'll back out the test_unparse inclusion 
until this can be fixed.

--

___
Python tracker 

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



[issue14742] test_tools very slow

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset dbfacec7e368 by Mark Dickinson in branch 'default':
Issue #14742:  Don't include DirectoryTestCase from test_unparse in test_tools 
until we can speed it up.
http://hg.python.org/cpython/rev/dbfacec7e368

--
nosy: +python-dev

___
Python tracker 

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



[issue12298] Sphinx glitch in library/functions

2012-05-07 Thread Sandro Tosi

Sandro Tosi  added the comment:

Oh sorry Éric, I completely oversaw there was an issue associated with the cset 
- i'll pay more attention next time!

--

___
Python tracker 

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



[issue12298] Sphinx glitch in library/functions

2012-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

No problem, what counts is that our documentation and code get better for our 
users, not my ego :)

--

___
Python tracker 

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



[issue14716] Use unicode_writer API for str.format()

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 01581e8b50f2 by Victor Stinner in branch 'default':
Backout ab500b297900: the check for integer overflow is wrong
http://hg.python.org/cpython/rev/01581e8b50f2

--

___
Python tracker 

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-07 Thread STINNER Victor

New submission from STINNER Victor :

Since 7be716a47e9d (issue #14716), str.format() uses the "unicode_writer" API. 
I propose to continue the work in this direction to avoid more temporary 
buffers.

Python 3.3:

100 loops, best of 3: 0.573 usec per loop
10 loops, best of 3: 16.4 usec per loop
100 loops, best of 3: 0.705 usec per loop
10 loops, best of 3: 2.61 usec per loop

Python 3.3 + patch (compared to Python 3.3):

100 loops, best of 3: 0.516 usec per loop (-10%)
10 loops, best of 3: 13.2 usec per loop (-20%)
100 loops, best of 3: 0.574 usec per loop (-18%)
10 loops, best of 3: 2.59 usec per loop (-1%)

--

If this patch is accepted, it's more to go even deeper: use _PyUnicodeWriter in 
long_to_decimal_string() for example.

--

Benchmark Python 3 / Python 2 bytes:

python -m timeit -s 'fmt="{0}.{1}.{2}"' 'fmt.format("http", "client", 
"HTTPConnection")'
python -m timeit -s 'fmt="{0:s}"*100' 'fmt.format("ABCDEF")'
python -m timeit -s 'fmt=" [line {0:2d}] "' 'fmt.format(5)'
python -m timeit -s 'fmt="x={} y={} z={}"' 'fmt.format(12345, 12.345, 
12.345+2j)'

Benchmark Python 2 unicode:

python -m timeit -s 'fmt=u"{0}.{1}.{2}"' 'fmt.format(u"http", u"client", 
u"HTTPConnection")'
python -m timeit -s 'fmt=u"{0:s}"*100' 'fmt.format(u"ABCDEF")'
python -m timeit -s 'fmt=u" [line {0:2d}] "' 'fmt.format(5)'
python -m timeit -s 'fmt=u"x={} y={} z={}"' 'fmt.format(12345, 12.345, 
12.345+2j)'

Python 2.7 bytes:

100 loops, best of 3: 0.393 usec per loop
10 loops, best of 3: 9.72 usec per loop
100 loops, best of 3: 0.337 usec per loop
100 loops, best of 3: 1.56 usec per loop

Python 2.7 wide:

100 loops, best of 3: 0.443 usec per loop
10 loops, best of 3: 10.3 usec per loop
100 loops, best of 3: 0.785 usec per loop
10 loops, best of 3: 2.48 usec per loop

Python 3.2 wide:

100 loops, best of 3: 0.457 usec per loop
10 loops, best of 3: 10.5 usec per loop
100 loops, best of 3: 0.538 usec per loop
10 loops, best of 3: 2.36 usec per loop

--
components: Interpreter Core
files: format_writer.patch
keywords: patch
messages: 160176
nosy: haypo, loewis, pitrou, storchaka
priority: normal
severity: normal
status: open
title: Use _PyUnicodeWriter API in str.format() internals
versions: Python 3.3
Added file: http://bugs.python.org/file25490/format_writer.patch

___
Python tracker 

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

Comments on the patch.

-PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj,
+PyAPI_FUNC(int) _PyComplex_FormatWriter(PyObject *obj,

Even if it is a private function, I prefer to rename it because its API does 
change.

/* Use the inlined version in unicodeobject.c */
#define _PyUnicodeWriter_prepare _PyUnicodeWriter_prepare_inline
#define _PyUnicodeWriter_write_substr _PyUnicodeWriter_write_substr_inline
#define _PyUnicodeWriter_write_str _PyUnicodeWriter_write_str_inline
#define _PyUnicodeWriter_write_char _PyUnicodeWriter_write_char_inline

Inlining may be removed to simplify the code (but inlining does speed up the 
code a little bit). Or the opposite: this code should be moved to a new 
"unicodewriterinline.h" file which would be included by unicodeobject.c and 
formatter_unicode.c.

--

___
Python tracker 

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



[issue14745] Misleading exception

2012-05-07 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis 
:

$ python3.2 -c 'open("/dev/null", "w").read()'
Traceback (most recent call last):
  File "", line 1, in 
io.UnsupportedOperation: not readable
$ python3.3 -c 'open("/dev/null", "w").read()'
Traceback (most recent call last):
  File "", line 1, in 
_frozen_importlib.UnsupportedOperation: not readable
$ python3.3 -c 'import _frozen_importlib; 
_frozen_importlib.UnsupportedOperation'
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute 'UnsupportedOperation'

--
messages: 160178
nosy: Arfrever, brett.cannon
priority: normal
severity: normal
status: open
title: Misleading exception
versions: Python 3.3

___
Python tracker 

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



[issue14746] Remove redundant paragraphs from getargs.c skipitem()

2012-05-07 Thread Larry Hastings

New submission from Larry Hastings :

There's code like this in skipitem() in Python/getargs.c:

case 'b': /* byte -- very short int */
/* ... a zillion more case statements here ... */
case 'C': /* unicode char */
case 'p': /* boolean predicate */
{
(void) va_arg(*p_va, void *);
break;
}

case 'n': /* Py_ssize_t */
{
(void) va_arg(*p_va, Py_ssize_t *);
break;
}

/* ... a bunch of other stuff here ... */

case 'S': /* string object */
case 'Y': /* string object */
case 'U': /* unicode string object */
{
(void) va_arg(*p_va, PyObject **);
break;
}


I cannot for the life of me imagine a platform where the size of a "Py_ssize_t 
*" or a "PyObject **" would be different from the size of a "void *".  I've 
programmed on platforms where code pointers and data pointers were different 
sizes--but data pointers to different sizes of data?  Never heard of it.

But I've been wrong before!  So, rather than simply make the change, I'm 
posting this bug just as a double check.

It's safe to fold 'n', 'S', 'Y', and 'U' into the initial paragraph of case 
statements simply skipping a pointer... isn't it?

--
assignee: larry
messages: 160179
nosy: larry
priority: low
severity: normal
stage: needs patch
status: open
title: Remove redundant paragraphs from getargs.c skipitem()
type: enhancement

___
Python tracker 

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



[issue14735] Version 3.2.3 IDLE CTRL-Z plus Carriage Return to end does not work

2012-05-07 Thread Roger Serwy

Roger Serwy  added the comment:

Ctrl+Z followed by Return still exits the Python shell on the command prompt 
under Vista.

The simplest way to get this behavior working in IDLE would be modifying the 
end-of-file definition in config-keys.def, but only for the Windows keymap:

[IDLE Classic Windows]
# truncated
end-of-file=  
# truncated

I left the Ctrl+D bindings in place, as these are IDLE's "norm". In a strict 
sense they should be removed for a Windows key map. (I am basing my 
cross-platform understanding of Ctrl+Z from here: 
http://en.wikipedia.org/wiki/Control-Z )

The undo functionality already binds to Ctrl+Z. By using the Ctrl+Z and Return 
sequence to signal IDLE's shell to exit, I can foresee users accidentally 
closing their shells. Consider this scenario: a user types a long command and 
the prompt and then presses Ctrl+Z to undo the last few key strokes. The user 
then presses enter to run the command but the shell closes instead. The regular 
python shell from a command prompt displays a "^Z" as a visual indicator. If 
IDLE's shell did the same then I would not have hesitations about changing the 
key bindings.

For now, I'm in favor of changing the documentation in help.txt to omit "(this 
is Control-z on Windows)."

--

___
Python tracker 

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



[issue14745] Misleading exception

2012-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2cd9dadd5c6c by Benjamin Peterson in branch 'default':
explicitly set UnsupportedOperation's module rather than relying on incorrect 
globals on startup (closes #14745)
http://hg.python.org/cpython/rev/2cd9dadd5c6c

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue13659] Add a help() viewer for IDLE's Shell.

2012-05-07 Thread Roger Serwy

Roger Serwy  added the comment:

Attached is an initial diff for creating a separate pager window by using a 
textView widget. The recently applied patch in issue964437 allows this window 
to be non-modal, which can be useful for interactive development.

The diff contains code to allow the pager to work with and without a 
subprocess. The "pager" and "use_help_window" in PyShell.py provide the core 
functionality. The "use_help_window" presently is a placeholder for 
implementing Ezio's suggestion in msg160114.

Does anyone know why "import pydoc" is wrapped in a try/except block? I omitted 
that in "pager".

--
keywords: +patch
Added file: http://bugs.python.org/file25491/help_pager.diff

___
Python tracker 

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



[issue14732] PEP 3121 Refactoring applied to _csv module

2012-05-07 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +skip.montanaro

___
Python tracker 

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



[issue14654] Faster utf-8 decoding

2012-05-07 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-05-07 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, orsenthil

___
Python tracker 

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



[issue5557] Byte-code compilation uses excessive memory

2012-05-07 Thread Zhiping Deng

Changes by Zhiping Deng :


--
nosy: +Zhiping.Deng

___
Python tracker 

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



[issue6602] Add argument to control file object used by BaseHTTPServer’s log_message

2012-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

Clearly +1 to Antoine; that’s just how unix programs do it.  stdout is for the 
program output, which may be formatted in a certain way in order to be piped to 
another program, and stderr is for all messages for the human user.  Editing 
the bug title and version to reflect Antoine’s suggestion, which does have a 
chance of going in if someone is interested in providing a patch.

--
nosy: +eric.araujo
status: open -> pending
title: BaseHTTPServer log_message should log to sys.stdout -> Add argument to 
control file object used by BaseHTTPServer’s log_message
versions:  -Python 2.7, Python 3.2

___
Python tracker 

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



[issue14743] on terminating, Pdb debugs itself

2012-05-07 Thread Éric Araujo

Changes by Éric Araujo :


--
keywords: +needs review
nosy: +georg.brandl
stage:  -> test needed

___
Python tracker 

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



[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-05-07 Thread Éric Araujo

Changes by Éric Araujo :


--
versions:  -Python 2.6, Python 3.1

___
Python tracker 

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



[issue14747] Classifiers are missing from distutils2-generated metadata

2012-05-07 Thread Alex Grönholm

New submission from Alex Grönholm :

Apparently they worked in 1.0a3 but not in 1.0a4 anymore.

--
assignee: eric.araujo
components: Distutils2
messages: 160184
nosy: agronholm, alexis, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: Classifiers are missing from distutils2-generated metadata
type: behavior
versions: 3rd party

___
Python tracker 

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



[issue14654] Faster utf-8 decoding

2012-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

See issue14738 for advanced optimization.

--

___
Python tracker 

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> If this patch is accepted, it's more to go even deeper: use _PyUnicodeWriter 
> in long_to_decimal_string() for example.

long_to_decimal_string() is already creates a string of known size. How
_PyUnicodeWriter can help here?

Issue3451 looks much more promising for int formatting. But it will take
a lot of time to carefully check this.

--

___
Python tracker 

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



[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-05-07 Thread Pierre Quentel

Pierre Quentel  added the comment:

Hi Glenn,

My proposal was not about optimization, I just thought that "if x==y" is 
simpler than "if len(x)==len(y) and x==y". Since we don't expect that there 
will be many directories in the list, I don't think optimizing is so important. 
But it doesn't matter to me really, the most important is to have the bug fixed

Can you propose a diff file so that the committers can review it ?

--

___
Python tracker 

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