[issue23572] functools.singledispatch fails when "not BaseClass" is True

2015-05-01 Thread Paul Moore
Changes by Paul Moore : -- nosy: +paul.moore ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Adding `import gc; gc.collect()` doesn't change the outcome afaict Of course it doesn't. The memory has already been released. "ru_maxrss" is the maximum memory consumption during the whole process lifetime. Add the following at the end of your script (Linux)

[issue24076] sum() several times slower on Python 3

2015-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 01/05/2015 08:09, Stefan Behnel a écrit : > > I don't think it's irrelevant. Throw-away integers are really not uncommon. For-loops use them quite often, non-trivial arithmetic expressions can create a lot of intermediate temporaries. Speeding up the create-d

[issue24090] Add a "copy variable to clipboard" option to the edit menu

2015-05-01 Thread irdb
New submission from irdb: I suggest adding a "Copy variable to clipboard" menu option to the edit menu of IDLE. Sometimes I need to copy a variable to clipboard, but because the variable is so long, printing it in the IDLE window makes IDLE sluggish and then selecting and copying the printed

[issue19042] Idle: add option to autosave 'Untitled' edit window

2015-05-01 Thread irdb
Changes by irdb : -- nosy: +irdb ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailma

[issue6143] IDLE - an extension to clear the shell window

2015-05-01 Thread irdb
Changes by irdb : -- nosy: +irdb ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman

[issue1442493] IDLE shell window gets very slow when displaying long lines

2015-05-01 Thread irdb
Changes by irdb : -- nosy: +irdb ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mail

[issue24017] Implemenation of the PEP 492 - Coroutines with async and await syntax

2015-05-01 Thread Stefan Behnel
Stefan Behnel added the comment: > I don't think it's necessary to have slots for __aiter__, __anext__, > __aenter__ and __aexit__. Async iteration will never be as fast as regular > iteration, and there is plenty overhead in it. You seem to be assuming that the outer loop is the asyncio I/O

[issue24091] Use after free in Element.extend (1)

2015-05-01 Thread paul
New submission from paul: # 1055for (i = 0; i < seqlen; i++) { # (gdb) n # 1056PyObject* element = PySequence_Fast_GET_ITEM(seq, i); # (gdb) n # 1057if (!PyObject_IsInstance(element, (PyObject *)&Element_Type)) { # (gdb) print *element # $19 = {_ob_next = 0x4060e6

[issue24092] Use after free in Element.extend (2)

2015-05-01 Thread paul
New submission from paul: # Program received signal SIGSEGV, Segmentation fault. # 0x4063cf19 in element_extend (self=0x405ddf74, args=([],)) at /home/p/Python-3.4.1/Modules/_elementtree.c:1056 # 1056PyObject* element = PySequence_Fast_GET_ITEM(seq, i); # (gdb) print i # $3 = 1337 #

[issue24093] Use after free in Element.remove

2015-05-01 Thread paul
New submission from paul: # Program received signal SIGABRT, Aborted. # 0x40022424 in __kernel_vsyscall () # (gdb) bt # #0 0x40022424 in __kernel_vsyscall () # #1 0x400bb1df in raise () from /lib/i386-linux-gnu/libc.so.6 # #2 0x400be825 in abort () from /lib/i386-linux-gnu/libc.so.6 # #3 0x08

[issue24091] Use after free in Element.extend (1)

2015-05-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Extension Modules, XML nosy: +eli.bendersky, scoder, serhiy.storchaka ___ Python tracker ___ ___

[issue24094] Use after free during json encoding (PyType_IsSubtype)

2015-05-01 Thread paul
New submission from paul: # Breakpoint 1, encoder_listencode_dict (s=0x405b23fc, acc=0xbfc4038c, dct=, indent_level=0) # at /home/p/Python-3.4.1/Modules/_json.c:1540 # 1540items = PyMapping_Keys(dct); # (gdb) n # 1541if (items == NULL) # (gdb) print *items # $1 = {_ob_

[issue24095] Use after free during json encoding a dict (2)

2015-05-01 Thread paul
New submission from paul: # Breakpoint 1, encoder_listencode_dict (s=0x405b23fc, acc=0xbfaf96ec, dct=, indent_level=0) # at /home/p/Python-3.4.1/Modules/_json.c:1540 # 1540items = PyMapping_Keys(dct); # (gdb) print *items # $1 = {_ob_next = 0x4059029c, _ob_prev = 0x405c8ab4, ob_refcnt

[issue24076] sum() several times slower on Python 3

2015-05-01 Thread Stefan Behnel
Stefan Behnel added the comment: I tried implementing a freelist. Patch attached, mostly adapted from the one in dictobject.c, but certainly needs a bit of cleanup. The results are not bad, about 10-20% faster: Original: $ ./python -m timeit 'sum(range(1, 10))' 1000 loops, best of 3: 1.86

[issue24096] Use after free during json encoding a dict (3)

2015-05-01 Thread paul
New submission from paul: # Program received signal SIGSEGV, Segmentation fault. # 0x40036740 in encoder_listencode_dict (s=0x405b43fc, acc=0xbf86438c, dct=, indent_level=0) # at /home/p/Python-3.4.1/Modules/_json.c:1557 # 1557PyList_SET_ITEM(items, i, item); # (gdb) print *(

[issue24096] Use after free in get_filter

2015-05-01 Thread paul
paul added the comment: # Program received signal SIGSEGV, Segmentation fault. # 0x080f2c17 in PyObject_GetAttr (v=, name='match') at Objects/object.c:872 # 872 if (tp->tp_getattro != NULL) # (gdb) bt # #0 0x080f2c17 in PyObject_GetAttr (v=, name='match') at Objects/object.c:872 # #1

[issue24097] Use after free in PyObject_GetState

2015-05-01 Thread paul
New submission from paul: # Program received signal SIGSEGV, Segmentation fault. # 0x080f27b2 in PyObject_Hash (v=) at Objects/object.c:746 # 746 if (tp->tp_hash != NULL) # (gdb) bt # #0 0x080f27b2 in PyObject_Hash (v=) at Objects/object.c:746 # #1 0x080e1717 in PyDict_SetItem (op={},

[issue24096] Use after free in get_filter

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules nosy: +christian.heimes stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24096] Use after free in get_filter

2015-05-01 Thread Christian Heimes
Christian Heimes added the comment: In 3.5 the segfault occurs at #0 0x7073e55e in encoder_listencode_dict (s=s@entry=0x709aa988, acc=acc@entry=0x7fffcf20, dct=dct@entry=, indent_level=indent_level@entry=0) at /home/heimes/dev/python/cpython/Modules/_json.c:1686 #1 0x

[issue24098] Multiple use after frees in obj2ast_* methods

2015-05-01 Thread paul
New submission from paul: # 3617for (i = 0; i < len; i++) { # (gdb) print *(PyListObject*)tmp # $1 = {ob_base = {ob_base = {_ob_next = 0x4056f8f4, _ob_prev = 0x4057329c, ob_refcnt = 2, ob_type = 0x830e1c0 }, # ob_size = 1337}, ob_item = 0x8491ae0, allocated = 1432} # (gdb)

[issue24092] Use after free in Element.extend (2)

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue24093] Use after free in Element.remove

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules nosy: +christian.heimes versions: +Python 3.5 ___ Python tracker ___ _

[issue24094] Use after free during json encoding (PyType_IsSubtype)

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules nosy: +christian.heimes stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24095] Use after free during json encoding a dict (2)

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules nosy: +christian.heimes stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24100] Use after free in siftdown (2)

2015-05-01 Thread paul
New submission from paul: # _siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos) # ... # while (pos > startpos){ # parentpos = (pos - 1) >> 1; # parent = PyList_GET_ITEM(heap, parentpos); # 1 cmp = PyObject_RichCompareBool(newitem, parent, Py_LT); #

[issue24091] Use after free in Element.extend (1)

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue24097] Use after free in PyObject_GetState

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24099] Use after free in siftdown (1)

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24099] Use after free in siftdown (1)

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue24098] Multiple use after frees in obj2ast_* methods

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue24092] Use after free in Element.extend (2)

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24101] Use after free in siftup

2015-05-01 Thread paul
New submission from paul: # Breakpoint 1, _siftup (heap=0x4056b344, pos=65534) at /home/p/Python-3.4.1/Modules/_heapqmodule.c:121 # warning: Source file is more recent than executable. # 121 Py_DECREF(PyList_GET_ITEM(heap, pos)); # (gdb) print *heap->ob_item[pos] # $1 = {_ob_next = 0x418

[issue24098] Multiple use after frees in obj2ast_* methods

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24101] Use after free in siftup

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules nosy: +christian.heimes stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24102] Multiple type confusions in unicode error handlers

2015-05-01 Thread paul
New submission from paul: # Breakpoint 1, PyUnicodeEncodeError_GetEnd (exc=, end=0xbf9e8f7c) at Objects/exceptions.c:1643 # 1643PyObject *obj = get_unicode(((PyUnicodeErrorObject *)exc)->object, # (gdb) s # get_unicode (attr=, name=0x82765ea "object") at Objects/exceptions.c:1516 # 1516

[issue24103] Use after free in xmlparser_setevents (1)

2015-05-01 Thread paul
New submission from paul: # xmlparser_setevents(XMLParserObject *self, PyObject* args) # { # ... # /* clear out existing events */ # Py_CLEAR(target->start_event_obj); # 1 Py_CLEAR(target->end_event_obj); # Py_CLEAR(target->start_ns_event_obj); # Py_CLEAR(target->end_ns_even

[issue24102] Multiple type confusions in unicode error handlers

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules nosy: +christian.heimes stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24104] Use after free in xmlparser_setevents (2)

2015-05-01 Thread paul
New submission from paul: # Program received signal SIGSEGV, Segmentation fault. # 0x4068565c in xmlparser_setevents (self=0x4064b13c, args=([], [])) # at /home/p/Python-3.4.1/Modules/_elementtree.c:3562 # 3562if (PyUnicode_Check(event_name_obj)) { # (gdb) print *event_name_obj #

[issue24103] Use after free in xmlparser_setevents (1)

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24104] Use after free in xmlparser_setevents (2)

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes : -- components: +Extension Modules nosy: +christian.heimes stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ __

[issue24099] Use after free in siftdown (1)

2015-05-01 Thread paul
New submission from paul: # _siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos) # ... # newitem = PyList_GET_ITEM(heap, pos); # Py_INCREF(newitem); # /* Follow the path to the root, moving parents down until finding #a place newitem fits. */ # while (pos

[issue24105] Use after free during json encoding a dict (3)

2015-05-01 Thread paul
New submission from paul: # Program received signal SIGSEGV, Segmentation fault. # 0x40036740 in encoder_listencode_dict (s=0x405b43fc, acc=0xbf86438c, dct=, indent_level=0) # at /home/p/Python-3.4.1/Modules/_json.c:1557 # 1557PyList_SET_ITEM(items, i, item); # (gdb) print *(

[issue24096] Use after free in get_filter

2015-05-01 Thread paul
Changes by paul : Removed file: http://bugs.python.org/file39246/poc_enc_dict3.py ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue24096] Use after free in get_filter

2015-05-01 Thread paul
paul added the comment: Issue for poc_enc_dict3.py is here: https://bugs.python.org/issue24105 Please ignore first and third message. -- ___ Python tracker ___ _

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: I'm still seeing a very large difference: asottile@work:/tmp$ python repro.py ready 72604 VmHWM: 72604 kB VmRSS: 60900 kB asottile@work:/tmp$ rm *.pyc; python repro.py ready 1077232 VmHWM: 1077232 kB VmRSS:218040 kB This file is significantly

[issue24096] Use after free in get_filter

2015-05-01 Thread Christian Heimes
Christian Heimes added the comment: Thanks Paul! May I ask how you found that many use-after-free bugs? Are you using some sort of tool for static code analysis or fuzzying? -- ___ Python tracker

[issue24017] Implemenation of the PEP 492 - Coroutines with async and await syntax

2015-05-01 Thread Guido van Rossum
Guido van Rossum added the comment: I think we can continue this discussion *after* the PEP's been accepted. -- ___ Python tracker ___ ___

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Which Python version is that? Can you try with 3.4 or 3.5? (is it under GNU/Linux?) > This file is significantly larger than the one attached, not sure > if it makes much of a difference. Python doesn't make a difference internally, but perhaps it has some impa

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: 3.4 seems happier: asottile@work:/tmp$ rm *.pyc; python3.4 repro.py ready 77472 VmHWM: 77472 kB VmRSS: 65228 kB asottile@work:/tmp$ python3.4 repro.py ready 77472 VmHWM: 77472 kB VmRSS: 65232 kB The nasty result above is from 2.7: $ python

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Note under 3.x, you need to "rm -r __pycache__", not "rm *.pyc", since the pyc files are now stored in the __pycache__ subdirectory. -- ___ Python tracker

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: Ah, then 3.4 still has the problem: $ rm -rf __pycache__/ *.pyc; python3.4 repro.py ready 1112892 VmHWM: 1112892 kB VmRSS:127196 kB asottile@work:/tmp$ python3.4 repro.py ready 77468 VmHWM: 77468 kB VmRSS: 65228 kB --

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Is there any chance you can upload a script that's large enough to exhibit the problem? (perhaps with anonymized data if there's something sensitive in there) -- ___ Python tracker

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: Attached is repro2.py (slightly different so my editor doesn't hate itself when editing the file) I'll attach the other file in another comment since it seems I can only do one at a time -- Added file: http://bugs.python.org/file39257/repro2.py

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Anthony Sottile
Changes by Anthony Sottile : Added file: http://bugs.python.org/file39259/anon_city_hoods.tar.gz ___ Python tracker ___ ___ Python-bugs-list m

[issue24100] Use after free in siftdown (2)

2015-05-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue24064] Make the property doctstring writeable

2015-05-01 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue24100] Use after free in siftdown (2)

2015-05-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Paul, this was nice work. Thanks. Attaching a patch to make 3.4 match the Python 3.5 version of the code which rearranges the object pointers without changing their reference counts. With that patch, your crasher no longer seg-faults, but gives this instea

[issue24099] Use after free in siftdown (1)

2015-05-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue24064] Make the property doctstring writeable

2015-05-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If make docstrings writable, it would be good to ensure that they exactly are strings. And if make the property doctstring writable, may be make other docstrings writable? It may be useful for setting the same docstring for Python implementation and C accele

[issue24078] inspect.getsourcelines ignores context and returns wrong line #

2015-05-01 Thread James Edwards
James Edwards added the comment: Inspect could probably be updated to use 3.3's __qualname__ in the case of classes-in-classes; classes-in-functions or functions-in-functions would likely be harder, but I'm not sure it's impossible. -- nosy: +jedwards _

[issue24106] Messed up indentation makes undesired piece of code being run!

2015-05-01 Thread jentyk
New submission from jentyk: In [14]: for i in xrange(10): : if 1==1: : print "It's true" : else: : print "It isn't true. Seriously??" : It's true It's true It's true It's true It's true It's true It's true It's true It's true It's true It isn't t

[issue24078] inspect.getsourcelines ignores context and returns wrong line #

2015-05-01 Thread James Edwards
Changes by James Edwards : -- nosy: +pitrou, yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue24078] inspect.getsourcelines ignores context and returns wrong line #

2015-05-01 Thread James Edwards
James Edwards added the comment: Added Yury (inspect module) and Antoine (PEP 3155) to nosy -- apologies if you're not interested. -- ___ Python tracker ___ ___

[issue24106] Messed up indentation makes undesired piece of code being run!

2015-05-01 Thread R. David Murray
R. David Murray added the comment: Whitespace is significant in Python. This is a fundamental part of the language. So yes, this is intentional. (Look up what the 'else' clause means on an if statement in the language reference.) -- nosy: +r.david.murray resolution: -> not a bug st

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I can reproduce: $ rm -r __pycache__/; ./python repro2.py ready 1047656 VmHWM: 1047656 kB VmRSS: 50660 kB $ ./python repro2.py ready 77480 VmHWM: 77480 kB VmRSS: 15664 kB My guess is that memory fragmentation prevents the RSS mark to dro

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: (by the way, my numbers are with Python 3.5 - the in-development version - on 64-bit Linux) -- ___ Python tracker ___ _

[issue24107] Add support for retrieving the certificate chain

2015-05-01 Thread Cory Benfield
New submission from Cory Benfield: In order to perform HTTP Public Key Pinning (HPKP), it's necessary to have access to every certificate in the certificate trust chain. This is because the pinned key may actually be an intermediate or root certificate, rather than the leaf certificate. PyOpe

[issue24107] Add support for retrieving the certificate chain

2015-05-01 Thread Alex Gaynor
Changes by Alex Gaynor : -- nosy: +alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou ___ Python tracker ___ ___ Pytho

[issue24107] Add support for retrieving the certificate chain

2015-05-01 Thread Christian Heimes
Christian Heimes added the comment: I have an experimental branch that adds the feature and also exposes the subject public key information. https://github.com/tiran/cpython/tree/feature/x509cert -- ___ Python tracker

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Geoffrey Spear
Changes by Geoffrey Spear : -- components: +Interpreter Core nosy: +geoffreyspear type: -> resource usage versions: +Python 3.5 ___ Python tracker ___ __

[issue24106] Messed up indentation makes undesired piece of code being run!

2015-05-01 Thread Eric V. Smith
Eric V. Smith added the comment: I think David meant the "else" clause on a "for" statement: https://docs.python.org/2/reference/compound_stmts.html#the-for-statement -- nosy: +eric.smith ___ Python tracker __

[issue13044] pdb throws AttributeError at end of debugging session

2015-05-01 Thread Charles F. Bearden
Charles F. Bearden added the comment: I can reproduce this bug on Ubuntu 14.04.2 LTS with Python 2.7.6 using akl's debug.py. -- nosy: +cfbearden ___ Python tracker ___ _

[issue24107] Add support for retrieving the certificate chain

2015-05-01 Thread Ian Cordasco
Changes by Ian Cordasco : -- nosy: +icordasc ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue13044] pdb throws AttributeError at end of debugging session

2015-05-01 Thread Charles F. Bearden
Charles F. Bearden added the comment: One further observation: the exception is thrown only if a breakpoint (apart from the call to pdb.set_trace) is set. If no breakpoint is set, the exception is not raised. -- ___ Python tracker

[issue24108] fnmatch.translate('*.txt') fails

2015-05-01 Thread Christophe BAL
New submission from Christophe BAL: Hello. I find the following bug on Python 3.4. >>> import fnmatch, re >>> regex = fnmatch.translate('*.txt') >>> regex '.*\\.txt\\Z(?ms)' The string regex should be '.*\\.txt$'. -- components: asyncio messages: 242346 nosy: gvanrossum, haypo, projet

[issue24109] Documentation for difflib uses optparse

2015-05-01 Thread Keith Gray
New submission from Keith Gray: The documentation for optparse states it has been deprecated in favor of argparse since 2.7. However, the library documentation for difflib still uses optparse in the example. https://docs.python.org/2/library/difflib.html#a-command-line-interface-to-difflib ht

[issue24108] fnmatch.translate('*.txt') fails

2015-05-01 Thread Merlijn van Deen
Merlijn van Deen added the comment: As far as I can see, the regex is correct: \Z Matches only at the end of the string. (?iLmsux) The group matches the empty string; the letters set the corresponding flags: (...) - re.M (multi-line), - re.S (dot matches all) See https://docs.python.org/3

[issue24108] fnmatch.translate('*.txt') fails

2015-05-01 Thread Christophe BAL
Christophe BAL added the comment: Ok. But in that case, the official documentation should be updated because it saids that string regex is *'.*\\.txt\\Z(?ms)'* and not *'.*\\.txt$'*. On the other hand, using this writing seems a bit strange. The 2nd one should do the job. *Christophe BAL* *

[issue24108] fnmatch.translate('*.txt') fails

2015-05-01 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: -yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue24108] fnmatch.translate('*.txt') fails

2015-05-01 Thread Merlijn van Deen
Merlijn van Deen added the comment: They are subtly different; the new regex also matches filenames with newlines, the old one doesn't (see Issue #6665 [1]). Patch (although crazily minor) attached. With some fuzz, it applies on everything from 2.6..default. [1] https://bugs.python.org/issue6

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Buck Evan
Buck Evan added the comment: New data: The memory consumption seems to be in the compiler rather than the marshaller: ``` $ PYTHONDONTWRITEBYTECODE=1 python -c 'import repro' 16032 $ PYTHONDONTWRITEBYTECODE=1 python -c 'import repro' 16032 $ PYTHONDONTWRITEBYTECODE=1 python -c 'import repro' 1

[issue24054] Invalid syntax in inspect_fodder2.py (on Python 2.x)

2015-05-01 Thread David D. Riddle
David D. Riddle added the comment: I have made the changes you suggested. Please look at lines 87-97. I am not certain if that is correct behavior. I was surprised that a SyntaxError is thrown in addition to the UnicodeDecodeError when linecache.getlines takes a file with bad unicode. Please t

[issue24108] fnmatch.translate('*.txt') fails

2015-05-01 Thread Christophe BAL
Christophe BAL added the comment: You're totally wrong and I am wrong. There is still the tiny problem of the documentation. Thanks for all. *Christophe BAL* *Enseignant de mathématiques en Lycée **et développeur Python amateur* *---* *French math teacher in a "Lycée" **and **Python **amateur

[issue24108] fnmatch.translate('*.txt') fails

2015-05-01 Thread Christophe BAL
Christophe BAL added the comment: Oups, sorry I want to say that you are totally RIGHT, and I am definitely WRONG. :-) -- ___ Python tracker ___ _

[issue24108] fnmatch.translate('*.txt') fails

2015-05-01 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue24110] zipfile.ZipFile.write() does not accept bytes arcname

2015-05-01 Thread July Tikhonov
New submission from July Tikhonov: In documentation of zipfile.ZipFile.write() there is following notice: "There is no official file name encoding for ZIP files. If you have unicode file names, you must convert them to byte strings in your desired encoding before passing them to write()." I u

[issue24110] zipfile.ZipFile.write() does not accept bytes arcname

2015-05-01 Thread July Tikhonov
Changes by July Tikhonov : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue24110] zipfile.ZipFile.write() does not accept bytes arcname

2015-05-01 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: This documentation is correct for python2 but maybe not for python3. To check. -- nosy: +matrixise ___ Python tracker ___

[issue24076] sum() several times slower on Python 3

2015-05-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Antoine asked: > If someone has actual code that suffers from this, it would be good to know > about it. You might have missed Łukasz' earlier comment: "In this particular case, there's internal usage at Twitter that unearthed it. The example is just a simp

[issue24085] large memory overhead when pyc is recompiled

2015-05-01 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan ___ Python tracker ___ ___ Python-bugs-l

[issue24069] Option to delete obsolete bytecode files

2015-05-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: This would be risky, as byte-code only libraries do exist. I think that deleting orphaned .pyc files from inside the __pycache__ directory is safe, but deleting orphaned .pyc files outside of that risks deleting legitimate byte-code libraries which are in use

[issue24052] sys.exit(code) returns "success" to the OS for some nonzero values of code

2015-05-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Maybe I've misunderstood RDM's comment, but if sys.exit(code) starts automatically printing the return code, that's going to break a lot of scripts. -- nosy: +steven.daprano ___ Python tracker

[issue24056] Expose closure & generator status in function repr()

2015-05-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Describing generator functions as such is a great idea. But how about Marking closure functions as such is a bit more subtle. However, there ia a real point that closure functions have a hidden input. If it is mutated or rebound, the function will not b

[issue24066] send_message should take all the addresses in the To: header into account

2015-05-01 Thread R. David Murray
R. David Murray added the comment: Can you write a test that shows the failure? There is an existing test that demonstrates sending to multiple addresses (testSendMessageWithAddresses), so you must have found an edge case that isn't tested. (Either that, or the existing test is broken.) ---

[issue24068] statistics module - incorrect results with boolean input

2015-05-01 Thread R. David Murray
R. David Murray added the comment: I wonder if it would be better to reject Bool data in this context? Bool is only a numeric type for historical reasons. -- nosy: +r.david.murray ___ Python tracker _

[issue24071] Python 2.7.8, 2.7.9 re.MULTILINE failure

2015-05-01 Thread R. David Murray
R. David Murray added the comment: It is, however, frequently reported as a bug, if that makes you feel any better :) -- nosy: +r.david.murray ___ Python tracker ___ ___

[issue24090] Add a "copy value to clipboard" option to the debugger

2015-05-01 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: Add a "copy vale to clipboard" option to the debugger -> Add a "copy value to clipboard" option to the debugger ___ Python tracker ___

[issue24090] Add a "copy vale to clipboard" option to the debugger

2015-05-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: As presented, this idea seems out of scope for Idle. First, Idle is concerned with editing code, submitting it for execution, and displaying stdout and seterr output from the execution. Idle normally knows nothing about name bindings created by user code in

[issue24081] Obsolete caveat in reload() docs

2015-05-01 Thread R. David Murray
R. David Murray added the comment: This generally comes up in the context of a module importing another module, and *that* module fails to import. The first module is left in sys.modules as a stub. Try that experiment, I'm pretty sure that is still true. -- nosy: +r.david.murray ___

  1   2   >