[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: > _Py_IDENTIFIER(__delitem__): Objects/typeobject.c:5132 > _Py_IDENTIFIER(__delitem__): Objects/typeobject.c:5183 I moved this one to #19514. -- ___ Python tracker ___

[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: Oh, I forgot: _Py_IDENTIFIER(__delitem__): Objects/typeobject.c:5132 _Py_IDENTIFIER(__delitem__): Objects/typeobject.c:5183 -- ___ Python tracker _

[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-06 Thread Andrei Dorian Duma
Changes by Andrei Dorian Duma : -- nosy: +andrei.duma ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue19516] segmentation fault using a dict as a key

2013-11-06 Thread Ned Deily
Ned Deily added the comment: P.S. See that issue for a workaround. Also release candidate installers for 3.3.3 and 2.7.6 are now available with final releases very soon. -- ___ Python tracker

[issue19516] segmentation fault using a dict as a key

2013-11-06 Thread Ned Deily
Ned Deily added the comment: It is a duplicate. Fixed in 3.3.3 and 2.7.6. -- resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> interactive interpreter crashes and test_readline fails on OS X 10.9 Mavericks due to libedit update

[issue19516] segmentation fault using a dict as a key

2013-11-06 Thread Tim Peters
Tim Peters added the comment: Betting this is a duplicate of: http://bugs.python.org/issue18458 -- ___ Python tracker ___ ___ Python-

[issue19516] segmentation fault using a dict as a key

2013-11-06 Thread Tim Peters
Tim Peters added the comment: Sure looks like the bug where virtually _any_ two lines entered in the shell cause a segfault. -- nosy: +tim.peters ___ Python tracker ___

[issue19516] segmentation fault using a dict as a key

2013-11-06 Thread Philip Jenvey
Changes by Philip Jenvey : -- nosy: +ned.deily ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue19516] segmentation fault using a dict as a key

2013-11-06 Thread Michael Merickel
New submission from Michael Merickel: I assume there is some incompatibility in the maverick's C runtime, but getting a segfault only on the python binaries from python.org. Version shipped by Apple OS X 10.9 Mavericks: ~❯ python2.7 Python 2.7.5 (default, Sep 12 2013, 21:33:34) [GCC 4.2.1 Comp

[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: See also issue #19515 which is more general. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-06 Thread STINNER Victor
New submission from STINNER Victor: I started to share some common identifiers in Python/pythonrun.c, extract: /* Common identifiers */ _Py_Identifier _PyId_argv = _Py_static_string_init("argv"); _Py_Identifier _PyId_builtins = _Py_static_string_init("builtins"); ... Do you think it would be in

[issue19514] Merge duplicated _Py_IDENTIFIER identifiers in C code

2013-11-06 Thread STINNER Victor
New submission from STINNER Victor: Some C files use more than once the same _Py_IDENTIFIER identifier. It would be more efficient to merge duplicated identifiers. Just move the definition to the top of the file. _Py_IDENTIFIER(as_integer_ratio): Modules/_datetimemodule.c:1569 _Py_IDENTIFIER(a

[issue19513] Use PyUnicodeWriter instead of PyAccu in repr(tuple) and repr(list)

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: bench_list_repr.py: benchmark script. It would be interesting to run it on Windows, performances of realloc() may be different. Result on my Linux box: Common platform: Python unicode implementation: PEP 393 Platform: Linux-3.9.4-200.fc18.x86_64-x86_64-with-fed

[issue19513] Use PyUnicodeWriter instead of PyAccu in repr(tuple) and repr(list)

2013-11-06 Thread STINNER Victor
New submission from STINNER Victor: PyUnicodeWriter is (a little bit) more efficient than PyAccu to build Unicode strings. Attached patch list_repr_writer.patch modify list_repr() to use PyUnicodeWriter. -- files: list_repr_writer.patch keywords: patch messages: 202298 nosy: haypo, pit

[issue19512] Avoid temporary Unicode strings, use identifiers to only create the string once

2013-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 77bebcf5c4cf by Victor Stinner in branch 'default': Issue #19512: add _PyUnicode_CompareWithId() function http://hg.python.org/cpython/rev/77bebcf5c4cf New changeset 3f9f2cfae53b by Victor Stinner in branch 'default': Issue #19512: Use the new _PyId

[issue19512] Avoid temporary Unicode strings, use identifiers to only create the string once

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: I changed the issue title to make it closer to the real changesets related to the issue. -- title: Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode -> Avoid temporary Unicode strings, use identifiers to only create the str

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 40c73ccaee95 by Victor Stinner in branch 'default': Issue #19512: __build_class() builtin now uses an identifier for the "metaclass" string http://hg.python.org/cpython/rev/40c73ccaee95 New changeset 7177363d8c5c by Victor Stinner in branch 'defaul

[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2013-11-06 Thread Alexis Daboville
Alexis Daboville added the comment: Added patch. -- keywords: +patch Added file: http://bugs.python.org/file32519/dedent.patch ___ Python tracker ___

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: Another problem is that PyUnicode_FromString() failure is not handled correctly in some cases. PyUnicode_FromString() can fail because an decoder error, but also because of a MemoryError. For example, PyDict_GetItemString() returns NULL as if the entry does no

[issue6868] Check errno of epoll_ctrl

2013-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: I don't understand the bug being reported. The code you quote should probably be written as "if (result < 0 && errno == EBADF)", but the block's net effect is to ignore an error by resetting result and errno. It doesn't matter if we occasionally set result an

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5e402c16a74c by Victor Stinner in branch 'default': Issue #19512: Add _PySys_GetObjectId() and _PySys_SetObjectId() functions http://hg.python.org/cpython/rev/5e402c16a74c New changeset cca13dd603a9 by Victor Stinner in branch 'default': Issue #1951

[issue19505] OrderedDict views don't implement __reversed__

2013-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We can't add __reversed__() to the Set or MappingView protocols without breaking third party code, but we can add it to concrete implementations of mapping views. In particular for views of OrderedDict which itself already have __reversed__(). Here is a pat

[issue7061] Improve turtle module documentation

2013-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: Is there anything left to do for this issue? -- nosy: +akuchling ___ Python tracker ___ ___ Python-bug

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: > I don't think these changes are required. The interactive interpreter is not > a bottleneck. What is the problem with these changes? Identifiers have different advantages. Errors become more unlikely because objects are only initialized once, near startup.

[issue19332] Guard against changing dict during iteration

2013-11-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: A few thoughts: * No existing, working code will benefit from this patch; however, almost all code will pay a price for it -- bigger size for an empty dict and a runtime cost (possibly very small) on the critical path (every time a value is stored in a dic

[issue19441] itertools.tee improve documentation

2013-11-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't want to recommend overwriting the variable name but will add a note for the rest: "Copied iterators depend the original iterator. If the original advances, then so do the copies. After teeing the iterators, the usual practice is to stop working wit

[issue8003] Fragile and unexpected error-handling in asyncore

2013-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: asyncore is no longer maintained, so this will not get fixed. -- nosy: +akuchling resolution: -> wont fix status: open -> closed ___ Python tracker _

[issue19505] OrderedDict views don't implement __reversed__

2013-11-06 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> low type: -> enhancement versions: -Python 2.7, Python 3.3 ___ Python tracker ___

[issue834840] Unhelpful error message from cgi module

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue7593] Computed-goto patch for RE engine

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue1671676] test_mailbox is hanging while doing gmake test on HP-UX v3

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- status: open -> languishing ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue1348] httplib closes socket, then tries to read from it

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- resolution: -> invalid status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue11965] Simplify context manager in os.popen

2013-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: Closing this issue; I agree with Ronald's assessment. -- nosy: +akuchling resolution: -> invalid status: open -> closed ___ Python tracker ___ _

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- keywords: -easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue8799] Hang in lib/test/test_threading.py

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- keywords: -easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue634412] RFC 2387 in email package

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- keywords: -easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue626452] Support RFC 2392 in email package

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- keywords: -easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue3849] FUD in documentation for urllib.urlopen()

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- keywords: -easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think these changes are required. The interactive interpreter is not a bottleneck. And definitely adding new public functions to API needs more discussion. -- ___ Python tracker

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-06 Thread Skip Montanaro
Skip Montanaro added the comment: > I am afraid that the rounding issues may kill this proposal. Can we start > with something simple? For example, we can start with show=None keyword > argument and allow a single value 'microseconds' (or 'us'). This will solve > the issue at hand with a re

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8a6a920d8eae by Victor Stinner in branch 'default': Issue #19512: Py_ReprEnter() and Py_ReprLeave() now use an identifier for the http://hg.python.org/cpython/rev/8a6a920d8eae New changeset 69071054b42f by Victor Stinner in branch 'default': Issue #

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: Oh, by the way, identifiers have a nice side effect: they are interned, and so dict lookup should be faster. -- ___ Python tracker ___

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset a2f42d57b91d by Victor Stinner in branch 'default': Issue #19512: sys_displayhook() now uses an identifier for "builtins" http://hg.python.org/cpython/rev/a2f42d57b91d New changeset 55517661a053 by Victor Stinner in branch 'default': Issue #19512: _

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: > Are any of these calls performance critical? I'm trying to focus on the interactive interpreter. I didn't touch literal strings used once, for example at module initialization. Well, if it doesn't make the code much uglier or much slower, it's maybe not a b

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PySys_GetObject() is called with followed literal strings: argv, displayhook, excepthook, modules, path, path_hooks, path_importer_cache, ps1, ps2, stderr, stdin, stdout, tracebacklimit. PyDict_GetItemString() is called with followed literal strings: __abst

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am afraid that the rounding issues may kill this proposal. Can we start with something simple? For example, we can start with show=None keyword argument and allow a single value 'microseconds' (or 'us'). This will solve the issue at hand with a reas

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: pysys_getobjectid.patch: - add _PySys_GetObjectId() and _PyDict_GetItemId() functions - add global identifiers for most common strings: "argv", "path", "stdin", "stdout", "stderr" - use these new functions and identifiers -- keywords: +patch Added file

[issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

2013-11-06 Thread STINNER Victor
New submission from STINNER Victor: In interactive mode, when I run python in gdb, I see that PyUnicode_DecodeUTF8Stateful() is called a lot of times. Calls come from PyDict_GetItemString() or PySys_GetObject() for example. Allocating a temporary Unicode string and decode a byte string from UT

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-06 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 06.11.2013 16:51, Alexander Belopolsky wrote: > > MAL: Have you thought about the rounding/truncation issues > associated with not showing microseconds ? Sure, otherwise I wouldn't have mentioned it :-) mxDateTime always uses 2 digit fractions when disp

[issue18582] PBKDF2 support

2013-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 07fa1ed0d551 by Christian Heimes in branch 'default': Issue #18582: fix memory leak in pbkdf2 code http://hg.python.org/cpython/rev/07fa1ed0d551 -- ___ Python tracker

[issue13674] crash in datetime.strftime

2013-11-06 Thread Tim Golden
Tim Golden added the comment: On 06/11/2013 15:23, STINNER Victor wrote: > +if (strchr("y", outbuf[1]) && buf.tm_year < 0) > > hum... why not simply outbuf[1] == 'y' ? It would be more explicit > and less surprising. Ummm. I have no idea what I was thinking about there. I think it was s

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: MAL: Have you thought about the rounding/truncation issues associated with not showing microseconds ? I believe it has to be the truncation. Rounding is better left to the user code where it can be done either using timedelta arithmetics or at the time

[issue13674] crash in datetime.strftime

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: +if (strchr("y", outbuf[1]) && buf.tm_year < 0) hum... why not simply outbuf[1] == 'y' ? It would be more explicit and less surprising. For the unit test, it would be nice to test also asctime(), even if time.asctime() doesn't use asctime() of the C l

[issue17823] 2to3 fixers for missing codecs

2013-11-06 Thread Meador Inge
Changes by Meador Inge : -- nosy: +meador.inge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue19511] lib2to3 Grammar file is no longer a Python 3 superset

2013-11-06 Thread Meador Inge
Changes by Meador Inge : -- nosy: +meador.inge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue13674] crash in datetime.strftime

2013-11-06 Thread Tim Golden
Tim Golden added the comment: Attached is a patch with tests -- keywords: +patch Added file: http://bugs.python.org/file32516/issue13674.diff ___ Python tracker ___ _

[issue17823] 2to3 fixers for missing codecs

2013-11-06 Thread Nick Coghlan
Nick Coghlan added the comment: On 7 November 2013 00:06, Nick Coghlan wrote: > I'm sure how useful such a fixer would be in practice, though, since it only > triggers when the codec name is passed as a literal - passing in a variable > instead keeps it from firing. Oops, that should say "I'm

[issue9216] FIPS support for hashlib

2013-11-06 Thread Bohuslav "Slavek" Kabrda
Changes by Bohuslav "Slavek" Kabrda : -- nosy: +bkabrda ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue17823] 2to3 fixers for missing codecs

2013-11-06 Thread Nick Coghlan
Nick Coghlan added the comment: Attached diff shows a proof of concept fixer for the encode case. It could be adjusted fairly easily to also handle decode methods (by including an alternative in the pattern and also capturing the method name) I'm sure how useful such a fixer would be in practi

[issue19511] lib2to3 Grammar file is no longer a Python 3 superset

2013-11-06 Thread Nick Coghlan
New submission from Nick Coghlan: In writing some new fixers for issue 17823, I noticed the 2/3 bridge grammar in lib2to3 was never updated to handle "yield from". This item is also missing from the checklist in the devguide: http://docs.python.org/devguide/grammar.html -- components:

[issue13674] crash in datetime.strftime

2013-11-06 Thread Tim Golden
Changes by Tim Golden : -- components: +Windows versions: +Python 3.4 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue13674] crash in datetime.strftime

2013-11-06 Thread Tim Golden
Changes by Tim Golden : -- assignee: -> tim.golden ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2013-11-06 Thread Nick Coghlan
Nick Coghlan added the comment: Providing the 2to3 fixers in issue 17823 now depends on this issue rather than the other way around (since not having to translate the names simplifies the fixer a bit). -- dependencies: -2to3 fixers for missing codecs _

[issue17823] 2to3 fixers for missing codecs

2013-11-06 Thread Nick Coghlan
Nick Coghlan added the comment: Switch direction of dependency to make this fixer rely on restoring the codec aliases in issue 7475 first. -- dependencies: +codecs missing: base64 bz2 hex zlib hex_codec ... ___ Python tracker

[issue19332] Guard against changing dict during iteration

2013-11-06 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: -stevenjd ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue19332] Guard against changing dict during iteration

2013-11-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: Duplicate of this: http://bugs.python.org/issue6017 -- nosy: +stevenjd ___ Python tracker ___ ___ P

[issue17823] 2to3 fixers for missing codecs

2013-11-06 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: -> ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue19378] Clean up Python 3.4 API additions in the dis module

2013-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset ce8dd299cdc4 by Nick Coghlan in branch 'default': Close #19378: address flaws in the new dis module APIs http://hg.python.org/cpython/rev/ce8dd299cdc4 -- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> c

[issue15216] Support setting the encoding on a text stream after creation

2013-11-06 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks, Andrei, that would be great. The tests and the Python version in Victor's patch show the desired API and behaviour. In theory, the C version should just be a matter of adding an equivalent textiowrapper_set_encoding method as a static function in hg.py

[issue15216] Support setting the encoding on a text stream after creation

2013-11-06 Thread Andrei Dorian Duma
Andrei Dorian Duma added the comment: I am interested in working on this, but I might need guidance at times. Is that acceptable? If yes, I'm willing to start as soon as possible. -- nosy: +andrei.duma ___ Python tracker

[issue15216] Support setting the encoding on a text stream after creation

2013-11-06 Thread Nick Coghlan
Nick Coghlan added the comment: Just reviewed Victor's patch - aside from a trivial typo and not covering the C implementation or documentation yet, it looks good to me. Most importantly, the tests in that patch could be used to validate a C implementation as well. I'll see if I can find anyon

[issue19508] Add warning that Python doesn't verify SSL certs by default

2013-11-06 Thread STINNER Victor
STINNER Victor added the comment: > There is already an entire section about this: > http://docs.python.org/dev/library/ssl.html#security-considerations So we just need to add a link from http, ftp, imap, ... to this section? Using only http://docs.python.org/dev/library/ftplib.html#ftp-tls-obj

[issue19508] Add warning that Python doesn't verify SSL certs by default

2013-11-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: There is already an entire section about this: http://docs.python.org/dev/library/ssl.html#security-considerations It's up to consumers of the API to choose their security policy, the ssl module merely provides building blocks to implement it. I think the ssl d

[issue19507] ssl.wrap_socket() with server_hostname should imply match_hostname()

2013-11-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure why it's surprising. SNI and certificate validation are two different things. Besides, this is adding a new level of complication to the wrap_socket() signature. -- ___ Python tracker