[issue6626] show Python mimetypes module some love

2009-08-11 Thread Jacob Rus
Changes by Jacob Rus : Added file: http://bugs.python.org/file14696/mimetypes4.diff ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue6626] show Python mimetypes module some love

2009-08-11 Thread Jacob Rus
Changes by Jacob Rus : Removed file: http://bugs.python.org/file14632/mimetypes4.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-08-11 Thread John Machin
John Machin added the comment: What is the expected timing comparison with re? Running the Aug10#3 version on Win XP SP3 with Python 2.6.3, I see regex typically running at only 20% to %50 of the speed of re in ASCII mode, with not-very-atypical tests (find all Python identifiers in a line, fail

[issue6626] show Python mimetypes module some love

2009-08-11 Thread Jacob Rus
Jacob Rus added the comment: Plone uses this thing, which has *much* more complexity than necessary for the standard library, but it might be nice to pick up the code for pulling types out of the windows registry, for instance. http://svn.plone.org/svn/archetypes/Products.MimetypesRegistry/tr

[issue6673] Py3.1 hangs in coroutine and eats up all memory

2009-08-11 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Not a bug. The list comprehension in your chunker: while True: target.send([ (yield) for i in range(chunk_size) ]) is equivalent to the following generator in Python 3: while True: def g(): for i in range(chunk_size)

[issue1023290] proposed struct module format code addition

2009-08-11 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: I went ahead and coded a new API for converting long integers to byte arrays and vice-versa. My patch adds two new methods to the long type: .as_bytes() and .frombytes(). The patch itself is well-documented; but nevertheless, here's some examples: >>> (1

[issue6688] Optimize PyBytes_FromObject.

2009-08-11 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti : Optimize PyBytes_FromObject by adding special-cases for list and tuple objects and by using _PyObject_LengthHint() instead of an arbitrary value for the size of the initial buffer. [Without the patch] ./python -m timeit -s "x = list(range(256))" "bytes(

[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-11 Thread Benjamin Peterson
Benjamin Peterson added the comment: +1 -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-11 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Oh, in case you wonder, the added PyUnicode_Check(x) check is to force PyBytes_FromObject to raise an error when given an empty unicode string (I will this as a comment in my patch). -- ___ Python tracker

[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-11 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti : The documentation for PyBytes_FromObject states: .. cfunction:: PyObject* PyBytes_FromObject(PyObject *o) Return the bytes representation of object *o* that implements the buffer protocol. However, there exists a special-case for integer object

[issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes

2009-08-11 Thread Colin Stewart
New submission from Colin Stewart : The documentation for the xml.sax.handler.property_xml_string SAX property states that it should be "data type: String". However when retrieving this value in Python 3.1 it returns a bytes object instead. This makes handling the returned value very difficult

[issue6680] Python 3.1 fails to build when db.h contains non-UTF-8 characters

2009-08-11 Thread Brett Cannon
Changes by Brett Cannon : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue6643] joining a child that forks can deadlock in the forked child process

2009-08-11 Thread Collin Winter
Changes by Collin Winter : -- components: +Interpreter Core nosy: +collinwinter, jyasskin ___ Python tracker ___ ___ Python-bugs-list m

[issue6685] CGI module documentation references method 'toupper'; should be 'upper'

2009-08-11 Thread Troy J. Farrell
New submission from Troy J. Farrell : The cgi module references a method 'toupper' on strings which should really reference 'upper'. The line is around 211 of cgi.txt, depending on the version of the documentation. Search for "`toupper`", (include the backticks.) -- assignee: georg.bra

[issue6684] "x / 1" and "x * 1" should return x

2009-08-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, Python makes no guarantees about object identity for numbers, so this is just an optimization request. While it could save a little space (one number object) and a little time (for allocating that object), the special casing imposes a small (but non-z

[issue6684] "x / 1" and "x * 1" should return x

2009-08-11 Thread mrjbq7
Changes by mrjbq7 : -- components: +Interpreter Core versions: +Python 2.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue6684] "x / 1" and "x * 1" should return x

2009-08-11 Thread mrjbq7
New submission from mrjbq7 : There are a couple arithmetic operations that idempotent, where the returned python object is the same python object as the input. For example, given a number: >>> x = 12345 The abs() builtin returns the same number object if it is already a positive value: >>

[issue6683] smtplib authentication - try all mechanisms

2009-08-11 Thread Gerhard Häring
Changes by Gerhard Häring : -- assignee: -> ghaering nosy: +ghaering ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue6683] smtplib authentication - try all mechanisms

2009-08-11 Thread Eric Shubert
New submission from Eric Shubert : The login method in smtplib.py tries only one authentication mechanism. There are legitimate situations where cram-md5 might fail, yet plain or login would succeed. RFC2554 states: If an AUTH command fails, the client may try another authentication mechanis

[issue6681] email.parser clips trailing \n of multipart/mixed part if part ends in \r\n

2009-08-11 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Note that the headers in the subpart don't matter at all. I'm sure this is not a problem with MIME parsing, but with line ending issues. It might be related to mixing line endings, but we know that the email package has some line ending problems. --

[issue6660] Desire python.org documentation link to user contribution wiki (per function)

2009-08-11 Thread kee nethery
kee nethery added the comment: Is there anything I can do to help this happen? Am thinking that these are the steps to the process. 1. Create wiki.docs.python.org using the wiki setup template already used by wiki.python.org. 2. Lock page creation except for one specific account. 3. Create

[issue6682] Default traceback does not handle PEP302 loaded modules

2009-08-11 Thread Anders Blomdell
New submission from Anders Blomdell : While trying to get a PEP302 import hook to function properly, I found that the default traceback picks up the wrong sourcecode for PEP302 loaded modules. The testcase pep302_traceback.py tries to emulate the behavior of the files in ordinary, which generate

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-08-11 Thread R. David Murray
R. David Murray added the comment: Take a look a the dev FAQ, linked from http://www.python.org/dev. The tests are in Lib/test in a distribution installed from source, but ideally you would be (anonymously) pulling the trunk from SVN (when it is back) and creating your patches with respect to t

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-08-11 Thread Vlastimil Brom
Vlastimil Brom added the comment: Sorry for the dumb question, which may also suggest, that I'm unfortunately unable to contribute at this level (with zero knowledge of C and only "working" one for Python): Where can I find the sources for tests etc. and how they are eventually to be submitte

[issue2504] Add gettext.pgettext() and variants support

2009-08-11 Thread Mitar
Mitar added the comment: I would just like to add that I am also looking forwards to this feature. -- nosy: +mitar ___ Python tracker ___

[issue6656] locale.format_string fails on escaped percentage

2009-08-11 Thread R. David Murray
R. David Murray added the comment: Here is a patch against trunk that fixes both the mapping handling and the % escape handling. The thing that worries me about this patch is that there are (obviously) not a comprehensive set of tests proving that format_string actually behaves like % formattin

[issue6656] locale.format_string fails on escaped percentage

2009-08-11 Thread R. David Murray
R. David Murray added the comment: I fixed this a different way that seems cleaner. In the process, I discovered that passing a mapping argument to format_string is completely broken. Here is an expanded set of tests that demonstrate this. This diff is against trunk. -- assignee: ->