[issue26200] SETREF adds unnecessary work in some cases

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Restored safe usage of Py_SETREFs introduced not in issue20440: in issue25928, 
changeset 3292b4862627, and issue25945.

--

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that adds extra usages of the Py_SETREF() macro (in particular 
in deque implementation). It doesn't fix bugs or improve performance, but makes 
the code shorter and perhaps makes it more readable.

If you think that some of these changes really improve readability (I think not 
all of them), let me know and I'll commit selected changes. Otherwise I'll just 
close this issue.

Currently Py_XSETREF is used 118 times and Py_SETREF is used 59 times. 
py_setref_extra.patch adds 44 new usages of Py_SETREF.

--
Added file: http://bugs.python.org/file42428/py_setref_extra.patch

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-04-11 Thread Xiang Zhang

Xiang Zhang added the comment:

Happy to see it works. Thanks for your reviews too. :)

--

___
Python tracker 

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



[issue22659] SyntaxError in the configure_ctypes

2016-04-11 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report.

I think this is a problem in your dev environment (wrong path or something like 
that). For some reason, you are trying to run Python 3 setup.py in Python 2.

--
nosy: +berker.peksag
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: compile error -> behavior

___
Python tracker 

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



[issue26732] multiprocessing sentinel resource leak

2016-04-11 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +jnoller, sbt

___
Python tracker 

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



[issue26720] memoryview from BufferedWriter becomes garbage

2016-04-11 Thread Martin Panter

Martin Panter added the comment:

To create a memoryview with unlimited lifetime, I understand we need to 
nominate an “exporting object”, which becomes memoryview.obj. Using a bytes 
object here might be the simplest fix for just BufferedWriter.

However it looks like the buffer is shared with BufferedReader and others. To 
fix the analogous bug with BufferedReader, a bytearray might be better, because 
the user could see it being mutated when reading into the memoryview.

I think bytearray might be okay for BufferedWriter too, as long as we prevent 
it being resized. The user would be able to alter the contents of the buffer, 
but I don’t see that as a problem. An alternative would be a new opaque object 
that doesn’t do much except have a reference count.

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ce721df212cf by Serhiy Storchaka in branch '3.5':
Issue #25910: Fixed dead links in the docs.
https://hg.python.org/cpython/rev/ce721df212cf

New changeset 14e00e7e4d51 by Georg Brandl in branch '2.7':
Closes #25910: fix dead and permanently redirected links in the docs. Thanks to 
SilentGhost for the patch.
https://hg.python.org/cpython/rev/14e00e7e4d51

New changeset 00addbb47c5c by Serhiy Storchaka in branch '2.7':
Issue #25910: Fixed dead links in the docs.
https://hg.python.org/cpython/rev/00addbb47c5c

New changeset 15c4557af8e0 by Serhiy Storchaka in branch 'default':
Issue #25910: Fixed dead links in the docs.
https://hg.python.org/cpython/rev/15c4557af8e0

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

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Following dead links left:

Doc/library/xmlrpc.client.rst
(line   42) brokenhttp://ontosys.com/xml-rpc/extensions.php - 

Doc/license.rst
(line   22) brokenhttp://www.zope.com/ - 
(line  131) brokenhttp://www.pythonlabs.com/logos.html - HTTP Error 404: 
Not Found

Doc/using/windows.rst
(line  271) brokenhttp://www.swaroopch.com/notes/python/#install_windows - 
Anchor 'install_windows' not found

Doc/whatsnew/2.1.rst
(line  543) brokenhttp://www.vex.net/parnassus/ - HTTP Error 404: Not Found

Doc/whatsnew/2.6.rst
(line  174) brokenhttp://svn.python.org/view/tracker/importer/ - HTTP Error 
404: Not Found
(line  193) brokenhttp://svn.python.org/view/tracker/importer/ - HTTP Error 
404: Not Found

Doc/whatsnew/2.7.rst
(line 1529) broken
http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT - Anchor 
'CIPHER_LIST_FORMAT' not found
(line 1618) broken
http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT - Anchor 
'CIPHER_LIST_FORMAT' not found

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-11 Thread Petr Viktorin

Petr Viktorin added the comment:

I can reproduce this with Python 2.7.11 and somewhat recent build from hg 
default (3.6.0a0) on Fedora 23.
Putting these lines in my personal config-main.cfg solves this::

[EditorWindow]
font= courier

idlelib/config-main.def has a different default::

[EditorWindow]
font= TkFixedFont

Putting that value in my personal config-main.cfg makes the bug manifest itself 
again.
With "nonexistent-font-name-7202125ed0a", the bug does not appear.
With an existing font, "DejaVu Sans Mono", the bug does not appear.

I hacked the code to get the values used in the line, 
``self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))``. For 
TkFixedFont (the buggy case), they are::

self._w: 
'.139719100555208.139719021773312.139719021373632.139719021374064.139719021375144.13971902101484
0.139719021045736.139719021045880'
cmd: 'configure'
cnf: {'font': ('dejavu sans mono', '', 'normal')}
_flatten((self._w, cmd)): 
('.139719100555208.139719021773312.139719021373632.139719021374064.139719021375144.1397190210148
40.139719021045736.139719021045880', 'configure')
self._options(cnf): ('-font', u'{dejavu sans mono} {} normal')

For the good case ("courier" font):


self._w:'.140181531287496.140181452501216.140181451999568.140181451999712.140181452055904.140181451660176.140181451660464',
cmd: 'configure'
cnf: {'font': ('courier', '10', 'normal')}
_flatten((self._w, cmd)): 
('.140181531287496.140181452501216.140181451999568.140181451999712.140181452055904.140181451660176.140181451660464',
 'configure')
self._options(cnf):  ('-font', u'courier 10 normal')

The difference is indeed that it's getting an empty string for the font size.
This happens even if "font-size= 10" is explicitly in the config file.

At this point I'm not sure how to investigate further. Could someone more 
familiar with Tk look at the issue? I'll be happy to provide more information. 
(Hopefully bugs.python.org notifications reach my inbox.)

--
nosy: +encukou

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

New submission from Xiang Zhang:

Though the documentation tells when disassembling a class, it disassembles all 
methods for dis.dis, but staticmethod and classmethod are ignored. I don't know 
whether this is intended.

I write to patch to add staticmethod and classmethod. But unfortunately when I 
write tests, one unrelated test fails and I cannot figure out why.

--
files: add_staticmethod_and_classmethod_when_dis.dis_a_class.patch
keywords: patch
messages: 263176
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: staticmethod and classmethod are ignored when disassemble class
Added file: 
http://bugs.python.org/file42429/add_staticmethod_and_classmethod_when_dis.dis_a_class.patch

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

Changes by Xiang Zhang :


--
components: +Library (Lib)
type:  -> behavior
versions: +Python 3.6

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread SilentGhost

SilentGhost added the comment:

Licence text shouldn't be touched, I think.

http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT became 
https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT

If Martin still have the importer code somewhere, he probably could provide an 
up to date link.

--

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

Xiang Zhang added the comment:

Though don't know why but simply replace %-4d with %3d in dis_bug708901 can fix 
the test. I updated the patch so all the tests pass and then I'll spend some 
time figuring out why.

--
Added file: 
http://bugs.python.org/file42430/add_staticmethod_and_classmethod_when_dis.dis_a_class_v2.patch

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +ncoghlan, yselivanov
stage:  -> patch review

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread Martin Panter

Martin Panter added the comment:

The bug tracker importer still exists if you know what revision to look it up 
in: 

--

___
Python tracker 

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



[issue25731] Assigning and deleting __new__ attr on the class does not allow to create instances of this class

2016-04-11 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
status: closed -> open

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-04-11 Thread Antti Haapala

Antti Haapala added the comment:

... and it turns out that munmapping is not always that smart thing to do: 
http://stackoverflow.com/questions/36548518/variable-assignment-faster-than-one-liner

--
nosy: +ztane

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-04-11 Thread STINNER Victor

STINNER Victor added the comment:

> ... and it turns out that munmapping is not always that smart thing to do: 
> http://stackoverflow.com/questions/36548518/variable-assignment-faster-than-one-liner

py -3 -m timeit "tuple(range(2000)) == tuple(range(2000))"
1 loops, best of 3: 97.7 usec per loop
py -3 -m timeit "a = tuple(range(2000));  b = tuple(range(2000)); a==b"
1 loops, best of 3: 70.7 usec per loop

Hum, it looks like this specific benchmark spends a lot of time to allocate one 
arena and then release it.

Maybe we should keep one "free" arena to avoid the slow mmap/munmap. But it 
means that we keep 256 KB of unused memory.

Maybe we need an heuristic to release the free arena after N calls to object 
allocator functions which don't need this free arena.

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread SilentGhost

SilentGhost added the comment:

Serhiy, the OpenSSL links are now https

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bb10867ffe28 by Serhiy Storchaka in branch '3.5':
Issue #25910: Fixed more links in the docs.
https://hg.python.org/cpython/rev/bb10867ffe28

New changeset 61c7deea9e6a by Serhiy Storchaka in branch '2.7':
Issue #25910: Fixed more links in the docs.
https://hg.python.org/cpython/rev/61c7deea9e6a

New changeset e3c9a47a83fb by Serhiy Storchaka in branch 'default':
Issue #25910: Fixed more links in the docs.
https://hg.python.org/cpython/rev/e3c9a47a83fb

--

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-04-11 Thread Antti Haapala

Antti Haapala added the comment:

> Maybe we need an heuristic to release the free arena after N calls to object 
> allocator functions which don't need this free arena.

That'd be my thought; again I believe that `madvise` could be useful there; now 
`mmap`/`munmap` I believe is particularly slow because it actually needs to 
supply 256kbytes of *zeroed* pages.

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Fixed links to "A Byte of Python" and OpenSSL.

Not fixed dead links:

http://www.zope.com/
http://www.pythonlabs.com/logos.html (http://www.pythonlabs.com/ exists but is 
not too useful)
http://www.vex.net/parnassus/ (looks as this project is dead)
http://ontosys.com/xml-rpc/extensions.php (sad, this was a specification)
http://svn.python.org/view/tracker/importer/ (removed in r88981 and not moved 
to https://hg.python.org/tracker)

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Serhiy, the OpenSSL links are now https

They works with http.

Some links (including python.org) are now redirected from http to https. It may 
be worth to add https explicitly.

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +barry, tim.peters

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

Xiang Zhang added the comment:

After researching the code, I think changing ' %-4d' to '%3d' in dis_bug708901 
is right. Since I added some some lines and the lineno of test_bug708901 has 
arrived at 100+ and the leading space should not be there. According to the 
code of dis.dis, the right format string should be '%3d'. Not only 
test_bug708901, all the other ' %-4d' should be changed to '%3d'. If we add 
1000+ lines at the head of the file, then all the ' %-4d' format string will 
lead to test failures.

I update my patch.

--
Added file: 
http://bugs.python.org/file42431/add_staticmethod_and_classmethod_when_dis.dis_a_class_v3.patch

___
Python tracker 

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



[issue25187] bdist_rpm fails due to wrong hardcoded assumption about RPM filename format

2016-04-11 Thread David Ward

David Ward added the comment:

Please review this revised patch. Thank you.

--
Added file: 
http://bugs.python.org/file42432/python-bdist_rpm-evaluate-_rpmfilename.patch

___
Python tracker 

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



[issue26734] Repeated mmap\munmap calls during temporary allocation

2016-04-11 Thread Bar Harel

New submission from Bar Harel:

After asking a question regarding performance in StackOverflow, I received an 
answer which seemed like a design problem in object allocation.
This is the question: http://stackoverflow.com/q/36548518/1658617
Seems like it ignores the garbage allocation settings (as timeit is supposed to 
disable it as far as I know) and I might not be proficient in low-level 
programming but there should be a way to implement it that doesn't cause 
endless allocations.

--
components: Benchmarks, Interpreter Core, Tests
messages: 263189
nosy: bar.harel, brett.cannon, pitrou
priority: normal
severity: normal
status: open
title: Repeated mmap\munmap calls during temporary allocation
type: performance
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26734] Repeated mmap\munmap calls during temporary allocation

2016-04-11 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue26734] Repeated mmap\munmap calls during temporary allocation

2016-04-11 Thread Brett Cannon

Changes by Brett Cannon :


--
components:  -Benchmarks

___
Python tracker 

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



[issue26734] Repeated mmap\munmap calls during temporary allocation

2016-04-11 Thread STINNER Victor

STINNER Victor added the comment:

FYI a discussion started in the issue #26601.

--
nosy: +haypo

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-04-11 Thread Bar Harel

Changes by Bar Harel :


--
nosy: +bar.harel

___
Python tracker 

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



[issue26734] Repeated mmap\munmap calls during temporary allocation

2016-04-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Use new madvise()'s MADV_FREE on the private heap

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-11 Thread Matthew Ryan

New submission from Matthew Ryan:

On Solaris 11.3 (intel tested, but I assume issue is on SPARC as well),
I found the following fails:
  import os
  os.urandom(2500)

The above throws OSError: [Errno 22] Invalid argument.

It turns out that the Solaris version of getrandom() is limited to returning
no more than 1024 bytes, per the manpage:
  The getrandom() and getentropy() functions fail if:

  EINVALThe flags are not set to GRND_RANDOM, GRND_NONBLOCK or  both,
or bufsz is <= 0 or > 1024.

I've attached a possible patch for this issue, against the 3.5.1 source
tree.

--
files: python3-getrandom.patch
keywords: patch
messages: 263191
nosy: mryan1539
priority: normal
severity: normal
status: open
title: os.urandom(2500) fails on Solaris 11.3
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file42433/python3-getrandom.patch

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-04-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> ... and it turns out that munmapping is not always that smart thing to do:

I don't think a silly benchmark says anything about the efficiency of our 
allocation strategy. If you have a real-world use case where this turns up, 
then please post about it.

--
nosy: +pitrou

___
Python tracker 

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



[issue14265] Fully qualified test name in failure output

2016-04-11 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Included is a patch with the suggested change.
I changed the TestCase.__str__ method to:
return "%s (%s.%s)" % (self._testMethodName, strclass(self.__class__), 
self._testMethodName)
instead of
return "%s (%s)" % (self._testMethodName, strclass(self.__class__))

So now a failed test look like this:

==
ERROR: test_error_handling 
(Lib.test.test_logging.StreamHandlerTest.test_error_handling)
--
Traceback (most recent call last):
  File "/home/aviv/dev/cpython/Lib/test/test_logging.py", line 641, in 
test_error_handling
self.assertIs(h.error_record, r)
AttributeError: 'TestStreamHandler' object has no attribute 'error_record'

--

--
keywords: +patch
nosy: +palaviv
versions: +Python 3.6 -Python 3.3
Added file: http://bugs.python.org/file42434/14265.patch

___
Python tracker 

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



[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-11 Thread skydoom

skydoom added the comment:

Hi Pitrou, 

would you be able to look at my issue and the proposed pathc?

Thanks

--

___
Python tracker 

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



[issue26718] super.__init__ leaks memory if called multiple times

2016-04-11 Thread Brett Cannon

Brett Cannon added the comment:

Based on Guido's feedback and the fact that this isn't documented usage of 
super() and hence no promises to not re-initialize, I'm closing as "not a bug". 
Sorry, Kevin.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue26718] super.__init__ leaks memory if called multiple times

2016-04-11 Thread Guido van Rossum

Guido van Rossum added the comment:

Actually, the refcount bug is still a bug.

--
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue26736] Use HTTPS protocol in links

2016-04-11 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch makes links in the docs to use the HTTPS protocol if possible. 
All changed links are tested manually.

--
assignee: docs@python
components: Documentation
files: links_https.patch
keywords: patch
messages: 263197
nosy: alex, christian.heimes, docs@python, dstufft, georg.brandl, 
giampaolo.rodola, janssen, pitrou, serhiy.storchaka, tim.golden
priority: normal
severity: normal
stage: patch review
status: open
title: Use HTTPS protocol in links
type: security
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42435/links_https.patch

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For XML-RPC extensions we can use a web archive: 
https://web.archive.org/web/20130120074804/http://ontosys.com/xml-rpc/extensions.php.
 There are precedences of using it for other dead links.

Opened separate issue26736 for https-zation.

--

___
Python tracker 

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



[issue26737] csv.DictReader throws generic error when fieldnames is accessed on non-text file

2016-04-11 Thread Bayo Opadeyi

New submission from Bayo Opadeyi:

If you use the csv.DictReader to open a non-text file and try to access 
fieldnames on it, it crashes with a generic error instead of something specific.

--
messages: 263199
nosy: boyombo
priority: normal
severity: normal
status: open
title: csv.DictReader throws generic error when fieldnames is accessed on 
non-text file
versions: Python 2.7

___
Python tracker 

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



[issue26737] csv.DictReader throws generic error when fieldnames is accessed for non-text file

2016-04-11 Thread Bayo Opadeyi

Changes by Bayo Opadeyi :


--
title: csv.DictReader throws generic error when fieldnames is accessed on 
non-text file -> csv.DictReader throws generic error when fieldnames is 
accessed for non-text file

___
Python tracker 

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



[issue26736] Use HTTPS protocol in links

2016-04-11 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue24745] Better default font for editor

2016-04-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The change from "Courier" to "TkDefaultFont" causes Options => Configure IDLE 
to fail at least on Arch Linux (#26673) and Fedora 23 (also #24951).  The 
reason is still obscure to me.  I will leave this closed, close #24951 as 
duplicate, and patch on #26673 (which has more information).

--

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-04-11 Thread Antti Haapala

Antti Haapala added the comment:

I said that *munmapping* is not the smart thing to do: and it is not, if you're 
going to *mmap* soon again.

--

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-04-11 Thread Antti Haapala

Antti Haapala added the comment:

Also what is important to notice is that the behaviour occurs *exactly* because 
the current heuristics *work*; the allocations were successfully organized so 
that one arena could be freed as soon as possible. The question is that is it 
sane to try to free the few bits of free memory asap - say you're now holding 
100M of memory - it does not often matter much if you hold the 100M of memory 
for *one second longer* than you actually ended up needing.

--

___
Python tracker 

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



[issue26738] listname.strip does not work right if the name ends with an 'o'

2016-04-11 Thread dileep k

New submission from dileep k:

12:54:38 | ~ | #1 $ python -V
Python 2.7.6

12:54:41 | ~ | #2 $ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> 'media.log'.strip('.log')
'media'

>>> 'video.log'.strip('.log')
'vide'

>>> 

The output should have been 'video' instead of 'vide' !

--
components: Library (Lib)
messages: 263203
nosy: dileep k
priority: normal
severity: normal
status: open
title: listname.strip does not work right if the name ends with an 'o'
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue26738] listname.strip() does not work right if the name ends with an 'o'

2016-04-11 Thread dileep k

Changes by dileep k :


--
title: listname.strip does not work right if the name ends with an 'o' -> 
listname.strip() does not work right if the name ends with an 'o'

___
Python tracker 

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



[issue26738] listname.strip() does not work right if the name ends with an 'o'

2016-04-11 Thread SilentGhost

SilentGhost added the comment:

Documentation [0] has a very clear explanation of how str.strip works.

[0] https://docs.python.org/2/library/stdtypes.html#str.strip

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue24951] Idle test_configdialog fails on Fedora 23, 3.6

2016-04-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This and #26673 are duplicates.  The latter also reports failure on Arch Linux 
and other Python versions.  While our default policy is to keep the earliest 
report open, I am closing this as #26673 has more information, including from 
Petr.

--
resolution:  -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder:  -> Tkinter error when opening IDLE configuration menu

___
Python tracker 

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2016-04-11 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

The vsvarsall.bat message should direct to 
https://wiki.python.org/moin/WindowsCompilers rather than some 3rd-party site 
(even more so, one with user-generated content like SO).

E.g.: "Unable to find vcvarsall.bat. A required version of MS VC++ compilers is 
not installed or used improperly. See 
https://wiki.python.org/moin/WindowsCompilers for instructions."

--
nosy: +Ivan.Pozdeev

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-04-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Another question is how often this situation occurs in practice and whether 
it's worth spending some bits, CPU cycles and developer time on "fixing" this.

--

___
Python tracker 

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



[issue26739] Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-11 Thread MICHAEL JACOBSON

New submission from MICHAEL JACOBSON:

So far I've got past the "bug in program" stage of debugging, but this came up:
IDLE internal error in runcode()
Traceback (most recent call last):
  File "C:\Python27\lib\idlelib\rpc.py", line 235, in asyncqueue
self.putmessage((seq, request))
  File "C:\Python27\lib\idlelib\rpc.py", line 332, in putmessage
n = self.sock.send(s[:BUFSIZE])
error: [Errno 10035] A non-blocking socket operation could not be completed 
immediately
I have no idea what a "socket" is so if you know please tell me!

--
components: Windows
files: Skier
messages: 263208
nosy: MICHAEL JACOBSON, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Errno 10035 a non-blocking socket operation could not be completed 
immediately
type: resource usage
versions: Python 2.7
Added file: http://bugs.python.org/file42436/Skier

___
Python tracker 

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



[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-11 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +IDLE
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
title: Errno 10035 a non-blocking socket operation could not be completed 
immediately -> idle: Errno 10035 a non-blocking socket operation could not be 
completed immediately

___
Python tracker 

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



[issue26739] Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-11 Thread MICHAEL JACOBSON

Changes by MICHAEL JACOBSON <922...@isd624.org>:


--
nosy:  -MICHAEL JACOBSON, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue23129] sqlite3 COMMIT nested in SELECT returns unexpected results

2016-04-11 Thread Daniel Lenski

Daniel Lenski added the comment:

I agree on the nastiness of this bug. It's been plaguing my production code for 
months and I had been at a loss to explain why I've been getting duplicate rows 
until I found this SO post:

http://stackoverflow.com/questions/27624049/python-sqlite3-cursor-returns-duplicates-when-a-commit-intervenes

By the way, the test case in Jim Carroll's report appears to come from this 
StackOverflow question.

--
nosy: +dlenski

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#24745 changed the default fixed font from Courier to TkFixedFontin 3.5.0, 
3.4.4, and 2.7.11  when using tcl/tk 8.5+.  On some OSes, the latter is not 
Courier and looks much better.  I don't know why the two behave differently on 
some systems.

Since this is not a unique problem on one machine, I am reopening this to at 
least provide a workaround.  Regardless of ultimate cause, we can at least 
force a blank font size to a default int string, such as '10'.  I closed #24951 
as a duplicate of this.

In class idlelib.configDialog.ConfigDialog, method CreatePageFontTab (line 114) 
creates StringVar self.fontSize, initialized to ''.  The Var is passed to class 
dynOptionMenuWidget.DynOptionMenu(tkinter.OptionMenu). The instance is bound to 
self.optMenuFontSize.  Method LoadFontCfg (line 963) sets retrieves the current 
Editor font as local name configeredFont and local fontSize therefrom. It 
passes fontSize to self.optMenuFontSize.SetMenu.  This in turns sets the stored 
self.fontSize to the passed in fontSize, overwriting the initial value.

(The OptionMenu.__init__ docstring and 
http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/optionmenu.html suggest that 
the variable must be a StringVar, which I presume is why self.fontSize is.  
Experiment suggest otherwise in 8.6.  This would have to be verified on 8.5 and 
even 8.4 before changing to IntVar.)

If my understanding based on the above, fontSize must be set to '' when the 
current font is TkFixedFont, but not when the font is Courier.  Petr, could you 
confirm by adding "print(configuredFont, fontsize)" to LoadFontCfg after both 
names are set and running both buggy and good cases?

--
resolution: not a bug -> 
stage: resolved -> test needed
status: closed -> open
versions: +Python 3.6

___
Python tracker 

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2016-04-11 Thread Cherniavsky Beni

Cherniavsky Beni added the comment:

+1, is there anything missing to apply Paul's patch?

Can I additional suggest a change to the error message, e.g.:

  $ prog --foo -bar
  prog: error: argument --foo: expected one argument
  (tip: use --foo=-bar to force interpretation as argument of --foo)

This can be safely added in the current mode with no opt-in required, and will 
relieve the immediate "but what can I do?" confusions of users.  The workaround 
is hard to discover otherwise, as `--foo=x` is typically equivalent to `--foo 
x`.

--- more discussion, though I suspect it's not productive ---

I've tried to find what the GNU Standards or POSIX say about this and was 
surprised to see neither explains how exactly `--opt_with_mandatory_argument 
-quux` behaves.

man getopt says:

 If such a character is followed by a colon, the option requires an 
argument, so getopt() places a pointer to the following text in the same 
argv-element, or the text of the following argv-element, in optarg. Two colons 
mean an option takes an optional arg; if there is text in the current 
argv-element (i.e., in the same word as the option name itself, for example, 
"-oarg"), then it is returned in optarg, otherwise optarg is set to zero. This 
is a GNU extension.

POSIX similarly does explain that an optional arg after an option must follow 
within the same argument:

(2)(b) If the SYNOPSIS shows an optional option-argument (as with [ -f[ 
option_argument]] in the example), a conforming application shall place any 
option-argument for that option directly adjacent to the option in the same 
argument string, without intervening  characters. If the utility 
receives an argument containing only the option, it shall behave as specified 
in its description for an omitted option-argument; it shall not treat the next 
argument (if any) as the option-argument for that option.

-- http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html

Anyway, every argument parsing library I've ever seen parses options in a 
left-to-right pass, consuming non-optional arguments after an option whatever 
they look like.  I've never seen a difference between `--foo bar` and 
`--foo=bar` when bar is *non-optional*.

Both behaviors (--opt_with_mandatory_argument bar, 
--opt_with_optional_argument[=bar]) were clearly designed to avoid ambiguity.
Whereas argparse innovated some constructs eg. '--opt', nargs='*' that are 
inherently ambiguous.  But for the simple constructs, most notably nargs=1, 
there should be a way to get the traditional unix meaning.

--
nosy: +cben

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-04-11 Thread Bar Harel

Bar Harel added the comment:

Any idea how to test it then? I found this happening by chance because I care 
about efficiency too much. We can't just stick timeit in random areas and hope 
to get results.

--

___
Python tracker 

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



[issue25627] distutils : file "bdist_rpm.py" does not quote filenames when executing the rpm command

2016-04-11 Thread David Ward

David Ward added the comment:

This revised patch has a small change so that the subprocess output is decoded 
from a byte sequence to a string, which is necessary when running this under 
Python 3.

With this change, this worked for me on Fedora 23 with Python 3.4.3.

It also worked on Fedora 23 with Python 2.7.11, but I had to apply the patch by 
hand, because of small differences in the original file as a result of SVN 
revisions 54854 and 57699 for Python 3.0. I also had to add "import subprocess" 
to the top of this file.

--
nosy: +dpward
Added file: http://bugs.python.org/file42437/issue25627_6.diff

___
Python tracker 

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



[issue25187] bdist_rpm fails due to wrong hardcoded assumption about RPM filename format

2016-04-11 Thread David Ward

David Ward added the comment:

Thanks again for your feedback. I revised this patch as requested to conform to 
changes also being made in issue 25627. Please review this new patch.

I tested this successfully under both Python 3.4.3 and Python 2.7.11 on Fedora 
23. Note that "import subprocess" must additionally be added to this file for 
Python 2.7, after applying this patch and/or the one in issue 25627. (I also 
tested this successfully with the latest patch from both issues applied at the 
same time.)

--
Added file: 
http://bugs.python.org/file42438/python-bdist_rpm-evaluate-_rpmfilename.patch

___
Python tracker 

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2016-04-11 Thread Martin Panter

Martin Panter added the comment:

My main concern with the patch is that it only half fixes the problem. It 
sounds like it will allow parsing “--opt -x” (if “-x” is not registered as an 
option), but will still refuse “--opt -h”, assuming “-h” is registered by 
default. What is the barrier to parsing an argument to the option syntax 
independently of what option names are registered?

Also the name “args_default_to_positional=True” name is both unwieldy and vague 
to me. The purpose seems to be to disable option-lookalike-strings from being 
reserved. Maybe call it something like “reserve_all_options=False” or 
“reserve_unregistered_options=False”?

I left some thoughts in the code review for the documentation too.

--
nosy: +martin.panter
stage: needs patch -> patch review

___
Python tracker 

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



[issue25061] Add native enum support for argparse

2016-04-11 Thread paul j3

paul j3 added the comment:

The best way to get an idea added is to write a good complete patch.  2nd best 
is to provide constructive input on ideas that are already here.  3rd is to 
illustrate how you would hope to use such a feature.  Include ideas on how the 
usage/help/error display would work.

At the risk of repeating myself, I'm still not convinced that being a 'native 
type' makes any difference.  Argparse does not support any native type, at 
least not directly.

--

___
Python tracker 

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



[issue26737] csv.DictReader throws generic error when fieldnames is accessed for non-text file

2016-04-11 Thread Josh Rosenberg

Josh Rosenberg added the comment:

This already behaves usefully in 3.5 where reading fieldnames from a DictReader 
wrapping a file opened in binary mode gets you:

_csv.Error: iterator should return strings, not bytes (did you open the file in 
text mode?)

And 2.7 is highly unlikely to make fit and finish fixes at this stage in the 
game.

That said, not sure what you'd expect in 2.7; standard open in binary mode is 
correct there, and you'd get str either way. Is the problem that it's not a CSV 
file in the first place? Because Python 2's csv isn't encoding aware; as long 
as it doesn't have embedded NULs, anything could be legitimate data (csv 
doesn't have the context to say that it should be latin-1, EBCDIC, or whatever).

--
nosy: +josh.r

___
Python tracker 

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



[issue11205] Evaluation order of dictionary display is different from reference manual.

2016-04-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Temporarily reopening this as a docs bug - I think it's worth mentioning in the 
"Porting to Python 3.5" section of the What's New docs and as a "version 
changed" note in the dis module docs, as even though it's obscure, anyone that 
was inadvertently relying on the prior deviation from the spec is going to be 
confused by the behavioural change in 3.5.

(The specific case where this came up was Russell Keith-Magee encountering the 
semantic change in BUILD_MAP's expectations for argument order on the stack for 
his VOD bytecode transpiler)

--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python
priority: high -> normal
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
versions: +Python 3.5 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Nick Coghlan

Nick Coghlan added the comment:

The code and test changes in the latest patch look good to me. For 
documentation, I suggest updating 
https://docs.python.org/3/library/dis.html#dis.dis to:

- say "it disassembles all methods (including class and static methods)" when 
describing how classes are handled.

- add a version changed note for 3.6 to say that class and static methods are 
disassembled in addition to normal instance methods when disassembling a class

--

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

Xiang Zhang added the comment:

I update the documentation. Learning from devguide, the change of whatsnew is 
the committer's work. ;)

--
Added file: 
http://bugs.python.org/file42439/add_staticmethod_and_classmethod_when_dis.dis_a_class_v4.patch

___
Python tracker 

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



[issue26699] locale.str docstring is incorrect: "Convert float to integer"

2016-04-11 Thread Luiz Poleto

Changes by Luiz Poleto :


--
keywords: +patch
Added file: http://bugs.python.org/file42440/issue26699.patch

___
Python tracker 

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



[issue26729] Incorrect __text_signature__ for sorted

2016-04-11 Thread Erik Welch

Erik Welch added the comment:

Interesting observation, Martin.

Upon further consideration, the call signature for sorted really is quite odd.  
It doesn't behave like any other builtin function.  Currently, "iterable" is 
positional-only, and "key=" and "reverse=" are keyword only.  I would only 
expect such behavior for functions with variadic *args.

I uploaded a new patch so that the call signature matches the original 
__text_signature__.  This means "iterable" may be given as a keyword argument, 
and "key" and "reverse" may be given as positional arguments.

I added tests for the new behavior, and all tests pass for me.

--
Added file: http://bugs.python.org/file42441/sorted_2.patch

___
Python tracker 

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



[issue25061] Add native enum support for argparse

2016-04-11 Thread paul j3

paul j3 added the comment:

desbma:

Rereading your latest code and comment:

> * The meaning of the 'type' parameter for StoreEnumAction is somewhat 
> different than for other actions (enum class vs callable that validates)

it occurred to me that that parameter does not have to be named 'type'.  It 
could just as well be 'enumClass' or something else.  It's just local to the 
class __init__ method.

Something that's come up with other Action classes is that the parameter list 
is not well documented.  While there's a generic set of parameters, the 
subclasses vary in what they accept or require or ignore.  The docs don't 
elaborate, and the error messages can be cryptic.  A new class with a new 
parameter (whether new in name or meaning) can add to that confusion.

We need to think more abstractly, so we aren't just improving the handling of 
'enums', but also all their derived and meta classes.  And possibly other 
mappings, where we want to do a 'key' lookup, and form help strings of the 
choices.

--

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If this is new feature, perhaps the docs need the versionchanged directive. 
Otherwise the patch should be applied to all maintained branches.

Added other comments on Rietveld.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26736] Use HTTPS protocol in links

2016-04-11 Thread Georg Brandl

Georg Brandl added the comment:

+1

--

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b114a0650c44 by Serhiy Storchaka in branch '3.5':
Issue #26733: Fixed formatting line numbers in test_dis.
https://hg.python.org/cpython/rev/b114a0650c44

New changeset e0816ce68952 by Serhiy Storchaka in branch 'default':
Issue #26733: Fixed formatting line numbers in test_dis.
https://hg.python.org/cpython/rev/e0816ce68952

New changeset 16a27e38e9b5 by Serhiy Storchaka in branch '2.7':
Issue #26733: Fixed formatting line numbers in test_dis.
https://hg.python.org/cpython/rev/16a27e38e9b5

--
nosy: +python-dev

___
Python tracker 

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



[issue26729] Incorrect __text_signature__ for sorted

2016-04-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I don't think we should start down the path of changing APIs just to 
accommodate weakness in the generation of the text signature.

We don't want to encourage unreadable oddities like sorted(reverse=False, 
iterable=source).  Best readability comes from the required positional argument 
for the iterable.  Please don't create a new and unnecessary keyword argument.  
 The current API is intentional.

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue26736] Use HTTPS protocol in links

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If these changes are acceptable, we should change the :rfc:, :pep:, etc roles 
to produce links with https.

I was not sure that these changes are worth, it was just interesting to me to 
research how many links support the HTTPS protocol now.

--

___
Python tracker 

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



[issue25061] Add native enum support for argparse

2016-04-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Enum is just one tool among many, no more special than named tuples, nested 
dicts, string.Templates, regexes, pickles etc.  

The second issue is keeping the scope of argparse focused on its core task 
rather than trying to incorporate other parts of the standard library.  That is 
called separation-of-concerns or orthogonality.  A little parsimony is 
necessary for loose coupling and high cohesion.  We also don't want module 
sprawl or feature creep to impair maintainability or affect learnability.

That said, this is up to the module creator and maintainer, Steven Bethard.  He 
has the most experience with module and has the clearest vision of what its 
boundaries should be.

--

___
Python tracker 

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



[issue26729] Incorrect __text_signature__ for sorted

2016-04-11 Thread Erik Welch

Erik Welch added the comment:

That's a fair and valid point, Raymond.  "sorted_2.patch" was submitted for 
consideration.  Either __text_signature__ is wrong, or the call argument 
handling is wrong.  One should be fixed.

Having a flexible call signature as if sorted were a user-defined function, 
such as "def sorted(iterable, key=None, reverse=False):", does allow for 
programmatic use of the introspected signature.  Here, using "iterable=" as a 
keyword can be convenient.

"sorted_1.diff" is wrong.  To match the existing call signature, 
__text_signature__ should be:

sorted($module, iterable, /, *, key=None, reverse=False)

I don't know any other builtin with a signature like this.  Such a signature 
may be a point of confusion for people learning Python ("what are those funny 
symbols?!"), who often encounter sorted early on.

--

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-11 Thread SilentGhost

Changes by SilentGhost :


--
components: +Interpreter Core
nosy: +haypo
stage:  -> patch review

___
Python tracker 

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



[issue26729] Incorrect __text_signature__ for sorted

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See issue26282.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26737] csv.DictReader throws generic error when fieldnames is accessed for non-text file

2016-04-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +rhettinger

___
Python tracker 

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



[issue26718] super.__init__ leaks memory if called multiple times

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Possible solutions:

1. Correctly decref old values.
2. Raise an exception if super.__init__ is caled multiple times.
3. Remove super.__init__ and add super.__new__.

What is more preferable?

--

___
Python tracker 

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



[issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy

2016-04-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for your comments Serhiy. I update the patch according to your comments.

Actually I don't think this is a new feature. Maybe staticmethod and 
classmethod are just forgotten.

As for separate tests for staticmethod and classmethod, I think they are not 
needed for this patch since right now we can use dis.dis to disassemble them 
explicitly. Only when dis.dis a class they are missing. But since there are no 
tests for them, adding tests for them is good.

--
Added file: 
http://bugs.python.org/file42442/add_staticmethod_and_classmethod_when_dis.dis_a_class_v5.patch

___
Python tracker 

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