[issue13073] message_body argument of HTTPConnection.endheaders is undocumented

2011-09-30 Thread Petri Lehtinen

New submission from Petri Lehtinen :

The argument is essential to avoid slowdown with delayed ACKs and the Nagle 
algorithm, so it should be documented. It was added when fixing issue 4336. I 
believe that it's new in Python 2.7.

--
assignee: docs@python
components: Documentation
messages: 144676
nosy: docs@python, petri.lehtinen
priority: normal
severity: normal
stage: needs patch
status: open
title: message_body argument of HTTPConnection.endheaders is undocumented
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue13073] message_body argument of HTTPConnection.endheaders is undocumented

2011-10-05 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The 2.7 documentation should mention the version in which the argument was 
added. I believe it was 2.7.

--
resolution: fixed -> 
status: closed -> open

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



[issue13121] collections.Counter's += copies the entire object

2011-10-07 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

This is slightly backwards incompatible, as some people may depend on the old 
behavior. Otherwise sounds like a good idea to me.

--
nosy: +petri.lehtinen, rhettinger
stage:  -> patch review
versions: +Python 3.3 -Python 3.4

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



[issue12174] Multiprocessing logging levels unclear

2011-10-18 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Should there be another issue opened to do something about the extra logging 
levels?

--

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



[issue12277] Missing comma in os.walk docs

2011-10-18 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Éric: It's been 3 months now. Have you already committed the big documentation 
issues change?

--

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



[issue868845] Need unit tests for <...> reprs

2011-10-18 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Ping? I wonder whether closing an issue from 2004 would result in "Achievement 
unlocked: archaeological issue management"

--
keywords: +patch
nosy: +petri.lehtinen

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



[issue12448] smtplib's __main__ doesn't flush when prompting

2011-10-18 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Raymond: Would you also like to commit the patch? :)

--
keywords:  -needs review

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



[issue13188] generator.throw() ignores __traceback__ of exception

2011-10-18 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Attached a patch that fixes this. The test case is a bit ugly, as it only 
checks that the traceback's depth is correct.

--
keywords: +patch
nosy: +ezio.melotti, petri.lehtinen
stage:  -> patch review
Added file: http://bugs.python.org/file23443/issue13188.patch

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



[issue13188] generator.throw() ignores __traceback__ of exception

2011-10-18 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Attached an updated patch.

I incref'd the return value of PyErr_GetTraceback() because PyErr_Restore() 
steals the reference. The documentation of PyErr_GetTraceback() doesn't tell 
whether it returns a new or borrowed reference, but apparently a new reference 
then?

--
Added file: http://bugs.python.org/file23445/issue13188_v2.patch

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



[issue13188] generator.throw() ignores __traceback__ of exception

2011-10-18 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Antoine Pitrou wrote:
> Actually, it is documented:
> “Return the traceback associated with the exception as a new reference (...)”

Ah, you're right. It just doesn't have the green "Return value: New
reference" note.

Thanks for committing!

--

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



[issue13188] generator.throw() ignores __traceback__ of exception

2011-10-18 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

BTW, shouldn't this be applied to 2.7 too?

--

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



[issue13213] generator.throw() behavior

2011-10-18 Thread Petri Lehtinen

New submission from Petri Lehtinen :

The documentation of generator.throw() gives this signature:

generator.throw(type[, value[, traceback]])

Looking at the code, it accepts the following arguments:

  g.throw(ExcType)  --> raise ExcType()

  g.throw(ExcType, None)  --> raise ExcType()

  g.throw(ExcType, None, tb)  --> raise ExcType().with_traceback(tb)

  g.throw(ExcType, instace_of_ExcType)  --> raise instance_of_ExcType

  g.throw(ExcType, instace_of_ExcType, tb)  --> raise 
instance_of_ExcType.with_traceback(tb)

  g.throw(ExcType, other_value)  --> raise ExcType(other_value)

  g.throw(ExcType, other_value, tb)  --> raise 
ExcType(other_value).with_traceback(tb)

Up to this point, I think everything is in line with the documentation. But it 
also accepts the following (now that issue 13188 is fixed):

  g.throw(exc_instance) --> raise exc_instance (preserving the traceback of 
exc_instance)

  g.throw(exc_instance, None) --> raise exc_instance (preserving the traceback 
of exc_instance)

  g.throw(exc_instance, None, tb) --> raise exc_instance.with_traceback(tb)

It does not accept these, throwing a TypeError:

  g.throw(exc_instance, some_value_other_than_None)
  g.throw(exc_instance, some_value_other_than_None, tb)
  g.throw(exc_instance, tb)

The documentation is really unclear on throwing existing exception instances 
with (exc_instance) or (exc_instance, None), and that calling with (type, 
value) or (type, value, tb) will create a new exception if not 
isinstance(value, type).

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 145848
nosy: docs@python, ezio.melotti, ncoghlan, petri.lehtinen, pitrou
priority: normal
severity: normal
status: open
title: generator.throw() behavior
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-19 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Thanks for the review, Antoine. Attached an updated the patch:

- The function definition now uses STRINGLIB(...) and the function is only 
defined when !STRINGLIB_IS_UNICODE (so I took both approaches)

- Added a "versionadded:: 3.3" to the documentation.

--
Added file: http://bugs.python.org/file23464/issue12170_v2.patch

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



[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-19 Thread Petri Lehtinen

Changes by Petri Lehtinen :


Removed file: http://bugs.python.org/file23464/issue12170_v2.patch

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



[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-19 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Fixed a minor inconsistency.

--
Added file: http://bugs.python.org/file23465/issue12170_v2.patch

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



[issue12619] Automatically regenerate platform-specific modules

2011-10-20 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy:  -petri.lehtinen

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



[issue9168] setuid in smtp.py sheds privileges before binding port

2011-10-20 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The patch looks good to me and fixes the problem. To reproduce, try this:

sudo python -m smtpd 127.0.0.1:25

It raises a "socket.error: [Errno 13] Permission denied" when trying to bind to 
the privileged port.

Attached a refreshed the patch that applies cleanly on top of current 2.7 
branch.

--
nosy: +petri.lehtinen
versions:  -Python 3.1
Added file: http://bugs.python.org/file23481/smtpd.py-0.2-setuid-fix_v2.diff

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



[issue8503] smtpd SMTPServer does not allow domain filtering

2011-10-20 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen
versions: +Python 3.3 -Python 3.2

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



[issue3802] smtpd.py __getaddr insufficient handling

2011-10-20 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

AFAIK, the extra MAIL FROM and RCPT TO parameters are only valid for ESMTP. 
smtpd doesn't currently handle ESMTP, so this should not be a problem.

--
nosy: +petri.lehtinen
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6

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



[issue8503] smtpd SMTPServer does not allow domain filtering

2011-10-20 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

This sounds like an important feature to me.

A few points:

- I'd rename the function name from accept_domain to e.g. validate_domain for 
clarity

- There could also be a function to validate the loca part of each recipient 
addresses. Or maybe the function should be changed to validate the whole 
recipient address, not only the domain part.

--

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



[issue12816] smtpd uses library outside of the standard libraries

2011-10-20 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13217] Missing header dependencies in Makefile

2011-10-23 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13249] argparse.ArgumentParser() lists arguments in the wrong order

2011-10-23 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Fixing the documentation is better, as changing the argument order would break 
existing code.

--
keywords: +easy
nosy: +petri.lehtinen

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



[issue13252] new decumulate() function in itertools module

2011-10-23 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13018] dictobject.c: refleak

2011-10-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +needs review, patch
nosy: +petri.lehtinen

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



[issue13017] pyexpat.c: refleak

2011-10-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +after moratorium, needs review, patch
nosy: +petri.lehtinen

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



[issue13016] selectmodule.c: refleak

2011-10-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +needs review, patch
nosy: +petri.lehtinen

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



[issue13254] maildir.items() broken

2011-10-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13018] dictobject.c: refleak

2011-10-24 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Thanks for the patch, fixed.

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

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



[issue13263] Group some os functions in submodules

2011-10-25 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13017] pyexpat.c: refleak

2011-10-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The patch is not correct: modelobj must not be decref'd, because it has been 
inserted to the args tuple with the reference-stealing 'N' format. args is 
later decref'd in function's cleanup code after "finally:".

--
keywords:  -after moratorium
resolution:  -> rejected
stage: patch review -> committed/rejected
status: open -> closed

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



[issue13016] selectmodule.c: refleak

2011-10-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

PySequence_Fast_GET_ITEM expects that the object is valid and the index is 
within bounds, and never returns NULL. There's no need to decref and actually 
there's even no need to check the return value of PySequence_Fast_GET_ITEM.

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

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



[issue13188] generator.throw() ignores __traceback__ of exception

2011-10-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The same issue exists on 2.7, working on a patch.

--
status: closed -> open
versions: +Python 2.7

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



[issue13211] urllib2.HTTPError does not have 'reason' attribute.

2011-10-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> It appears the Python 3.2 docs no longer include documentation for URLError

Both URLError and HTTPError are documented in 3.2 and 3.3:

http://docs.python.org/py3k/library/urllib.error.html#urllib.error.URLError

http://docs.python.org/dev/library/urllib.error.html#urllib.error.URLError

It needs to be investigated whether each point raising a HTTPError sets a good 
msg. If this is the case, reason can be aliased to msg.

This could be done for 2.7, too, because this is a bug (deviation from what the 
documentation says) rather than a new feature.

--
keywords: +easy
nosy: +petri.lehtinen
stage:  -> needs patch

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



[issue13267] Add an option to disable importing orphaned bytecode files

2011-10-26 Thread Petri Lehtinen

New submission from Petri Lehtinen :

This has been discussed in python-ideas approx. two years ago:

http://mail.python.org/pipermail/python-ideas/2009-December/006635.html

It seems to me that having an opt-in command-line option, environment variable 
and sys variable to disable loading orphaned bytecode files upon import had 
most use cases and gained most support.

--
components: Interpreter Core
messages: 146423
nosy: brett.cannon, ncoghlan, petri.lehtinen, pitrou
priority: normal
severity: normal
status: open
title: Add an option to disable importing orphaned bytecode files
type: feature request
versions: Python 3.3

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



[issue13268] assert statement violates the documentation

2011-10-26 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
components: +Interpreter Core
nosy: +petri.lehtinen
versions:  -Python 2.6

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



[issue13188] generator.throw() ignores __traceback__ of exception

2011-10-26 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

It seems this cannot be achieved the same way in 2.7 as the traceback is not 
directly associated with the exception. However, if we're currently in an 
exception handler and sys.exc_info() corresponds to the exception passed to 
generator.throw(), we could use the current traceback. Would this approach be 
too complicated and not worth it?

--

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



[issue13271] When -h is used with argparse, default values that fail should not matter

2011-10-27 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13274] heapq pure python version uses islice without guarding for negative counts

2011-10-27 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13275] Recommend xml.etree for XML processing

2011-10-27 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13188] generator.throw() ignores __traceback__ of exception

2011-10-27 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Ok, I think we have reached a consensus. Closing.

--
status: open -> closed
versions:  -Python 2.7

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



[issue13277] tzinfo subclasses information

2011-10-27 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13278] Typo in documentation for sched module

2011-10-27 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-27 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13280] argparse should use the new Formatter class

2011-10-27 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13281] robotparser.RobotFileParser ignores rules preceeded by a blank line

2011-10-27 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13281] robotparser.RobotFileParser ignores rules preceeded by a blank line

2011-10-27 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Blank lines are allowed according to the specification at 
http://www.robotstxt.org/norobots-rfc.txt, section 3.3 Formal Syntax.

The issue also seems to exist on 3.2 and 3.3.

--
components: +Library (Lib)
keywords: +needs review
stage:  -> patch review
versions: +Python 3.2, Python 3.3

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



[issue6745] (curses) addstr() takes str in Python 3

2011-10-28 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue12567] curses implementation of Unicode is wrong in Python 3

2011-10-28 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue10570] curses.tigetstr() returns bytes, but curses.tparm() expects a string

2011-10-28 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen
stage:  -> test needed
versions: +Python 3.2, Python 3.3 -Python 3.1

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



[issue13283] removal of two unused variable in locale.py

2011-10-28 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen
stage:  -> patch review

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



[issue13281] robotparser.RobotFileParser ignores rules preceeded by a blank line

2011-10-29 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> Because of the line break, clicking that link gives "Server error 404".

I don't see a line break, but the comma after the link seems to breaks it. 
Sorry.

> The way I read the grammar, 'records' (which start with an agent
> line) cannot have blank lines and must be separated by blank lines.

Ah, true. But it seems to me that having blank lines elsewhere doesn't break 
the parsing. If other robots.txt parser implementations allow arbitrary blank 
lines, we could add a strict=False parameter to make the parser non-strict. 
This would be a new feature of course.

Does the parser currently handle blank lines between full records (agentline(s) 
+ ruleline(s)) correctly?

> I also do not see "Crawl-delay" and "Sitemap" (from whitehouse.gov) in the 
> grammar referenced above. So I wonder if de facto practice has evolved.

The spec says:

   Lines with Fields not explicitly specified by this specification
   may occur in the /robots.txt, allowing for future extension of the
   format.

So these seem to be nonstandard extensions.

--

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



[issue13284] email.utils.formatdate function does not handle timezones correctly.

2011-10-29 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen
type:  -> behavior

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



[issue13285] signal module ignores external signal changes

2011-10-29 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue10519] setobject.c no-op typo

2011-10-29 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue12761] Typo in Doc/license.rst

2011-10-29 Thread Petri Lehtinen

Changes by Petri Lehtinen :


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

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



[issue6650] sre_parse contains a confusing generic error message

2011-10-29 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13298] Result type depends on order of operands for bytes and bytearray

2011-10-31 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13301] the script Tools/i18n/msgfmt.py allows arbitrary code execution via po files

2011-10-31 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13308] fix test_httpservers failures when run as root

2011-11-01 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

You should change "issue #" with the real issue number now that there's an 
issue for this :)

--
nosy: +petri.lehtinen

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



[issue13254] maildir.items() broken

2011-11-01 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

More specifically, this happens if the Maildir instance is created two seconds 
before items() is called:

>>> import time
>>> from mailbox import Maildir
>>> x = Maildir('test')  # has messages
>>> time.sleep(2.5)
>>> x.items()
[]

This happens because __init__() doesn't populate _toc, and mtimes haven't 
changed either, so _refresh() doesn't populate _toc either.

--

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



[issue13254] maildir.items() broken

2011-11-01 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Attached a patch. It makes _refresh() re-read the _toc uncoditionally when 
called the first time.

--
keywords: +needs review, patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file23584/issue13254.patch

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



[issue13254] maildir.items() broken

2011-11-01 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The last patch looks good to me and is a clever approach indeed :)

--

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



[issue13271] When -h is used with argparse, default values that fail should not matter

2011-11-01 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Sounds like a but to me, too.

--
stage:  -> test needed
versions: +Python 2.7, Python 3.2

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



[issue13321] fstat doesn't accept an object with "fileno" method

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

This is a request for new functionality, so marking as a feature request for 
3.3. If implemented, the change should be applied to many other functions, in 
the os module at least.

I'm not sure whether this is very useful, though. The fstat(f.fileno()) idiom 
doesn't require that much writing and makes it explicit that we're operating on 
an underlying file descriptor. Furthermore, funtions in the os module are 
low-level and map very closely to the underlying C API.

--
nosy: +benjamin.peterson, petri.lehtinen, pitrou, stutzbach
type: behavior -> feature request
versions:  -Python 3.2

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



[issue13147] Multiprocessing Pool.map_async() does not have an error_callback parameter

2011-11-02 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +needs review
nosy: +petri.lehtinen
stage:  -> patch review

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



[issue12709] In multiprocessing, error_callback isn't documented for map_async

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Sandro: The error_callback parameter is not available on 2.7. See #13147.

--
nosy: +petri.lehtinen

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



[issue13285] signal module ignores external signal changes

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> Could it return an opaque wrapper object, rather than just the raw address? 
> Something like:

Are you suggesting that it would return either a Python function object or a 
wrapper object?

--

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



[issue13281] Make robotparser.RobotFileParser ignore blank lines

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> My current suggested doc change is to replace the sentence quoted at the top 
> with

Sounds good to me.

--

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2011-11-02 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue10570] curses.tigetstr() returns bytes, but curses.tparm() expects a string

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

I'm not a curses expert, but after digging a while, I believe that I now 
understand what these functions are doing. tigetstr() returns a "format string" 
(bytes) and tparm() does substitutions and returns a command string (bytes) for 
the terminal.

I don't believe that the first parameter to tparm() (the format string) is ever 
constructed by hand, because it's terminal specific. The value is obtained from 
the terminfo database by calling tigetstr() instead. Furthermore, tigetstr() 
returns binary data, for which bytes is the only sane representation, and 
therefore tparm() should expect bytes instead of str.

Attached a patch that fixes this.

--
keywords: +needs review, patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file23595/issue10570.patch

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



[issue13298] Result type depends on order of operands for bytes and bytearray

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> Note that .join() has a slightly different behaviour:
> 
> >>> b"".join([bytearray(), b""])
> b''
> >>> bytearray().join([bytearray(), b""])
> bytearray(b'')
> >>> b"".join([bytearray(), memoryview(b"")])
> Traceback (most recent call last):
>   File "", line 1, in 
> TypeError: sequence item 1: expected bytes, memoryview found

I thinks this is worth fixing. Is there an issue already?

--

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



[issue13326] make clean failed on OpenBSD

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

According to the man page, find -print0 and xargs -r are also GNU extensions. 
Even though they work on OpenBSD (do they?), they could still break on some 
platforms.

As find -exec cmd {} ';' is already used for everything but __pycache__, I'd 
rather only change the removal of __pycache__. I believe there are more files 
that match '*.py[co]' than '__pycache__', and people are already waiting for a 
separate rm process to be invoked on each *.py[co], so invoking a separate 
rmdir for each __pycache__ shouldn't make it much slower.

--
nosy: +petri.lehtinen

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



[issue13327] Update utime API to not require explicit None argument

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

+1 on making the second arg optional.

--
nosy: +petri.lehtinen

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



[issue13328] pdb shows code from wrong module

2011-11-03 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13308] fix test_httpservers failures when run as root

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

I mean that this should be enough to close this issue:

-   -find $(srcdir) -name '__pycache__' -exec rmdir {} '+'
+   -find $(srcdir) -name '__pycache__' -exec rmdir {} ';'

That is, use ';' instead of the unportable '+' instead of changing all cleaning 
to use find ... | xargs ...

--

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



[issue13308] fix test_httpservers failures when run as root

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Whoops, posted the previous message to a totally wrong issue. Who was it thag 
introduced tabbed browsing?

--

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



[issue13326] make clean failed on OpenBSD

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

I mean that this should be enough to close this issue:

-   -find $(srcdir) -name '__pycache__' -exec rmdir {} '+'
+   -find $(srcdir) -name '__pycache__' -exec rmdir {} ';'

That is, use ';' instead of the unportable '+' instead of changing all cleaning 
to use find ... | xargs ...

--

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



[issue13329] Runs normal as console script but falls as CGI

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

How are you running the CGI script? Are you sure that the PYTHONIOENCODING 
environment variable isn't set by the HTTP server?

--
nosy: +petri.lehtinen

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



[issue13326] make clean failed on OpenBSD

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Ah, I didn't think about that.

How about using the -depth option then? It's in POSIX but does OpenBSD have it? 
The man page of GNU find says it has a -d option (that does the same as -depth) 
for compatibility with BSD.

--

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



[issue13330] Attempt full test coverage of LocaleTextCalendar.formatweekday

2011-11-03 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
components: +Library (Lib)
keywords: +needs review
stage:  -> patch review
type:  -> feature request
versions: +Python 3.3 -Python 3.4

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



[issue13326] make clean failed on OpenBSD

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> + -find $(srcdir) -name '__pycache__' -print0 | xargs -0r rm -rf

I'd still do it like this for portability's sake:

+   -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'

--

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



[issue10570] curses.tigetstr() returns bytes, but curses.tparm() expects a string

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

It seems that putp() should also accept only bytes, because it's used to output 
terminal commands. It's currently expecting a str.

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

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



[issue3067] setlocale error message is confusing

2011-11-03 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13326] make clean failed on OpenBSD

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> Then you'd probably reintroduce issue8665.

No, the -depth argument avoids that.

--

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



[issue13333] utf-7 inconsistent with surrogates

2011-11-03 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Sounds reasonable to me. Is it easy to generate unique identifier names in 2to3 
fixers?

--
nosy: +petri.lehtinen

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



[issue13326] make clean failed on OpenBSD

2011-11-03 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The issue exists only in 3.2 and 3.3, as 2.7 doesn't have __pycache__ (PEP 
3147). In 3.2 and 3.3, all *.py[co] files are in __pycache__ directories, so 
the pycremoval make target can only remove the __pycache__ directories, using 
the -depth option of find to remove child directories before the parent.

--
keywords: +easy
stage:  -> needs patch
versions: +Python 3.2, Python 3.3

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



[issue3067] setlocale error message is confusing

2011-11-04 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Terry: Do you still think there's need for a doc update?

--
resolution:  -> fixed
status: open -> pending

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



[issue13321] fstat doesn't accept an object with "fileno" method

2011-11-04 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
resolution:  -> wont fix
stage:  -> committed/rejected
status: open -> closed

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



[issue13321] fstat doesn't accept an object with "fileno" method

2011-11-04 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Closing as wontfix.

--

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



[issue3067] setlocale error message is confusing

2011-11-05 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> If *locale* is specified, it may be a None, a string, or an iterable of two 
> strings, language code and encoding. String pairs are converted to a single 
> string using the locale aliasing engine.

What about the possible None value then? Do you think that mentions to
it be dropped?

I don't think so, because setlocale(locale.LC_ALL, None) is an
explicit way of saying "Return me the current value", especially
because the function's name is SETlocale, which doesn't make it
explicit.

If None is not dropped, the ", language code and encoding" should
maybe be in parentheses insteead: "to strings (language code and
encoding), or None..."

--

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



[issue13254] maildir.items() broken

2011-11-05 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

In the absence of any complaints, I went on and committed the fix. Thanks for 
reporting the issue!

--
assignee: r.david.murray -> 

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



[issue3067] setlocale error message is confusing

2011-11-05 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

I decided to restructure the documentation of setlocale() a bit and I think 
it's better now overall. It includes Terry's suggestions.

I think this issue can now be closed. Thanks for the report and patches!

--
status: open -> closed

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



[issue13338] Not all enumerations used in _Py_ANNOTATE_MEMORY_ORDER

2011-11-05 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
stage:  -> needs patch

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



[issue13338] Not all enumerations used in _Py_ANNOTATE_MEMORY_ORDER

2011-11-05 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

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



[issue12163] str.count

2011-11-05 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

This already seems fixed on 2.7, 3.2 and 3.3:

>>> ''.find('', None)
0

--
nosy: +petri.lehtinen
resolution:  -> out of date
status: open -> closed
versions:  -Python 3.1

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



[issue13340] list.index does not accept None as start or stop

2011-11-05 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The same issue exists for tuples:

>>> (1, 2, 3).index(2, None)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: slice indices must be integers or None or have an __index__ method

--
components: +Interpreter Core
nosy: +petri.lehtinen
stage:  -> needs patch
versions: +Python 3.3

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



[issue13349] Uninformal error message in index() and remove() functions

2011-11-05 Thread Petri Lehtinen

New submission from Petri Lehtinen :

For example:

>>> (1, 2, 3).index(4)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: tuple.index(x): x not in tuple

The "x not in tuple" error message should be replaced with "4 is not in tuple". 
list.index() already does this (see #7252):

>>> [1, 2, 3].index(4)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: 4 is not in list

Although in #7252 it was claimed that no other place in stdlib has this error 
message, I found many occurences:

Modules/_collectionsmodule.c:PyErr_SetString(PyExc_ValueError, 
"deque.remove(x): x not in deque"
Modules/_elementtree.c:"list.remove(x): x not in list"
Modules/_elementtree.c:"list.remove(x): x not in list"
Modules/arraymodule.c:PyErr_SetString(PyExc_ValueError, "array.index(x): x 
not in list");
Modules/arraymodule.c:PyErr_SetString(PyExc_ValueError, "array.remove(x): x 
not in list");
Objects/abstract.c:"sequence.index(x): x not in sequence");
Objects/listobject.c:PyErr_SetString(PyExc_ValueError, "list.remove(x): x 
not in list");
Objects/tupleobject.c:PyErr_SetString(PyExc_ValueError, "tuple.index(x): x 
not in tuple");

There's also documentation and tests that depend on this actual error message:

Doc/library/doctest.rst:   ValueError: list.remove(x): x not in list
Lib/test/test_xml_etree.py:ValueError: list.remove(x): x not in list

#7252 was fixed in r76058, and it's quite a lot of code. I think it could be 
done more easily using PyUnicode_FromFormat() and the %R format.

--
messages: 147109
nosy: petri.lehtinen
priority: normal
severity: normal
status: open
title: Uninformal error message in index() and remove() functions

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



  1   2   3   4   5   6   7   >