[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2016-01-28 Thread Georg Brandl

Georg Brandl added the comment:

Hi Julien, thanks for your patch and sorry for the lack of reviews. I find the 
new wording in the second hunk confusing:

``'store_true'`` and ``'store_false'`` - These store the values ``False`` 
respectively (Note that these default to ``False`` and ``True``  respectively). 
 These are special cases of ``'store_const'``.

On first read, It seems to contradict itself.  I know what is meant, but I 
think it should be expanded a bit.

Also, the part about ``store_const`` should still mention the default for its 
value (not for the const). I suppose it's ``None``?

--
nosy: +georg.brandl

___
Python tracker 

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



[issue26002] make statistics.median_grouped more efficient

2016-01-28 Thread Upendra Kumar

Upendra Kumar added the comment:

Can someone please review my patch?  I think it can increase the performance 
significantly of the median_grouped() function. But, I don't have any standard 
way of checking if it would improve or will be an overkill for the 
median_grouped() function?

--

___
Python tracker 

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



[issue26199] fix broken link to hamcrest.library.integration.match_equality in unittest.mock "getting started" documentation

2016-01-28 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Raphael!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions:  -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



[issue26199] fix broken link to hamcrest.library.integration.match_equality in unittest.mock "getting started" documentation

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e4b0f003ad13 by Berker Peksag in branch '3.5':
Issue #26199: Fix broken link in unittest.mock-examples.rst
https://hg.python.org/cpython/rev/e4b0f003ad13

New changeset 7c38a47fd4d5 by Berker Peksag in branch 'default':
Issue #26199: Fix broken link in unittest.mock-examples.rst
https://hg.python.org/cpython/rev/7c38a47fd4d5

--
nosy: +python-dev

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

Here is a patch changing all the '. . .'.split() calls to lists of strings. I 
think the illustrations are actually less complicated to understand when you 
see the list directly, and they more consistent with the remaining 
illustrations that already use lists, but I see Benjamin disagrees.

--
keywords: +patch
nosy: +martin.panter
stage:  -> patch review
versions: +Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41739/arg-list.patch

___
Python tracker 

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



[issue26034] venv documentation out of date

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d2a32b78be96 by Berker Peksag in branch '3.5':
Issue #26034: Sync documentation of --clear with its behavior
https://hg.python.org/cpython/rev/d2a32b78be96

New changeset 5764cc02244d by Berker Peksag in branch 'default':
Issue #26034: Sync documentation of --clear with its behavior
https://hg.python.org/cpython/rev/5764cc02244d

--
nosy: +python-dev

___
Python tracker 

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



[issue26034] venv documentation out of date

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9c5370405393 by Berker Peksag in branch '3.5':
Issue #26034: Improve wording of clear parameter
https://hg.python.org/cpython/rev/9c5370405393

New changeset 0fb96a43d381 by Berker Peksag in branch 'default':
Issue #26034: Improve wording of clear parameter
https://hg.python.org/cpython/rev/0fb96a43d381

--

___
Python tracker 

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



[issue26002] make statistics.median_grouped more efficient

2016-01-28 Thread Upendra Kumar

Upendra Kumar added the comment:

Yeah, I slightly modified the functions from the bisect docs to suit for the 
purpose here.

--

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

By the way, thanks for your reviews. Code review rocks ;-)

--

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

full_deque2.diff LGTM. But I have added minor suggestions on Rietveld.

--

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread Eryk Sun

Eryk Sun added the comment:

The patch is missing the "errors" parameter of PyUnicode_DecodeLocale. But it 
should call PyUnicode_DecodeMBCS instead. In the "C" locale, 
PyUnicode_DecodeLocale is Latin-1 because the CRT mbstowcs just casts the 
values to wchar_t.

socket_getnameinfo also decodes as UTF-8:

>>> socket.getnameinfo(('127.0.0.1', 20), 0)
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 0: 
invalid start byte

Steve, does your suggestion include reimplementing socket.gethostbyaddr and 
socket.gethostbyname_ex using GetNameInfoW and GetAddrInfoW? gethostbyaddr and 
gethostbyname are deprecated and lack a Unicode implementation.

--
nosy: +eryksun

___
Python tracker 

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



[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-28 Thread Mark Dickinson

Mark Dickinson added the comment:

I also agree that we shouldn't change the current code. As Raymond says, it may 
be worth a doc change.

Serge: I was confused by your initial report. If I understand the StackOverflow 
question correctly, this isn't about the output for *infinite* numbers (e.g., 
`Decimal('inf')` and `Decimal('-inf')`), and I'm not sure what that would mean. 
Rather, it's about the output for small finite numbers, where an exponent 
wouldn't be used in the normal scientific notation. So some people would 
(understandably) rather see:

>>> Decimal('123456').to_eng_string()
'123.456e3'
>>> Decimal('0.02').to_eng_string()
'20e-3'

than the current

>>> Decimal('123456').to_eng_string()
'123456'
>>> Decimal('0.02').to_eng_string()
'0.02'

for example. Is that what you meant? 

Stefan: IEEE 754 does cover formatting (in section 5.12, "Details of conversion 
between floating-point data and external character sequences"), but has nothing 
to say about engineering formats.

--

___
Python tracker 

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



[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-28 Thread Serge Stroobandt

Serge Stroobandt added the comment:

Mark: Don't shoot the messenger!
I literally quoted the implemented proprietary specification.
However, I do agree that the term "numbers (or bases) with an infinte decimal 
representation" would be more appropriate in this context.

Also, improving documentation is good, but having a new function with the 
desired *true* engineering notation would be even better! Admittedly, this was 
my ultimate objective for filing this enhancement bug.

Thanks for commenting on StackExchange.

--
type: behavior -> enhancement

___
Python tracker 

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



[issue19023] ctypes docs: Unimplemented and undocumented features

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 732fdd03e708 by Martin Panter in branch '3.5':
Issue #19023: Document ctypes array and pointer classes
https://hg.python.org/cpython/rev/732fdd03e708

New changeset a78cbb2125a8 by Martin Panter in branch 'default':
Issue #19023: Merge ctypes doc and tests from 3.5
https://hg.python.org/cpython/rev/a78cbb2125a8

--
nosy: +python-dev

___
Python tracker 

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



[issue26230] Cookies do not correct if cookiename includes [ or ]

2016-01-28 Thread tom liu

tom liu added the comment:

similar to issue25228.

--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file41740/gethostbyaddr_encoding-2.patch

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> The patch is missing the "errors" parameter of PyUnicode_DecodeLocale.

Woops, I shouldn't write patch in the middle of the night :-) Hopefully, I 
didn't push it :-) PyUnicode_DecodeLocale() should only be used when the 
encoding depends on the *currenet* value of LC_CTYPE.

Here, the ANSI code page is fine, and so PyUnicode_DecodeFSDefault() should be 
used instead.

> socket_getnameinfo also decodes as UTF-8

Hum, let met try a new patch. It decodes hostname from the ANSI code page on 
Windows for:

* socket.getnameinfo()
* socket.gethostbyaddr()
* socket.gethostbyname_ex()

The behaviour on other platforms is unchanged.

--

___
Python tracker 

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



[issue26231] HTTPResponse.close() should consume all remaining data in body if any

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

The documentation already says you have to read the whole response before 
sending a new request: 
.
 So I think this is more like a new feature than a bug fix, and would have to 
go into 3.6.

But I am not sure it is a good idea. What if the response is a large 
multi-megabyte download? In that case, it might make more sense to shut down 
the connection and start a new one.

It might be possible to add extra error checking to prevent reading a second 
response until the first is complete. I am not sure if that is practical or 
worthwhile though.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2016-01-28 Thread Julien Baley

Julien Baley added the comment:

Hi Georg,

thanks for your answer. I think maybe you're missing a bit in there?

"``'store_true'`` and ``'store_false'`` - These store the values ``True`` and 
``False`` respectively (Note that these default to ``False`` and ``True``  
respectively).  These are special cases of ``'store_const'``."  (added 
"``True`` andd")

But if I'm correct, you're talking of the parenthesis which would be confusing? 
Can we come up with a better wording?

"(and default to False and True if the action is not triggered)" ?

As for `store_const`, R. David Murray says it has no default. It is technically 
correct: store_const behaves like any other action in that it defaults to 
whatever the argument `default` in `add_argument` is set to.
The fact that `default` defaults to None is indicated in 16.4.3.5. default:
"The default keyword argument of add_argument(), whose value defaults to None,"
Therefore, I believe it is more correct the way R. David Murray suggested.

What do you think?

--

___
Python tracker 

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



[issue26230] Cookies do not correct if cookiename includes [ or ]

2016-01-28 Thread tom liu

Changes by tom liu :


--
components: Extension Modules
nosy: tom_lt
priority: normal
severity: normal
status: open
title: Cookies do not correct if cookiename includes [ or ]
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue21201] Uninformative error message in multiprocessing.Manager()

2016-01-28 Thread Berker Peksag

Berker Peksag added the comment:

Looks good to me. Perhaps we can use utils.info() to print the exception.

--
nosy: +berker.peksag, davin
stage:  -> patch review
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added 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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> Added comments on Rietveld.

Crap. It's easy to miss a compilation error on extensions :-/

I used "make && ./python -m test -v test_socket" to validate  
gethostbyaddr_encoding-2.patch and it succeded.

Maybe we should setup.py to *fail* if an extension failed to be compiled?

New patch should have less typos :-) I also checked for reference leak using 
./python -m test -R 3:3 test_socket => no leak.


> Why not use PyUnicode_DecodeFSDefault on all platforms? It is used in
gethostname() on Unix.

I don't know which encoding is the best choice on UNIX. I prefer to move step 
by step and fix an obvious bug on Windows blocking Émanuel (see his issue 
#26226). (Émanuel uses Émanuel-PC for its hostname, an non-ASCII hostname ;-))

I guess that UTF-8 works in most cases on UNIX, whereas using the locale 
encoding can introduce regressions if the hostname is non-ASCII. For example, 
decoding non-ASCII hostname would fail with LANG=C which forces an ASCII locale 
encoding.

The issue #9377 proposes a more advanced code to choose the encoding to decode 
hostnames. Sorry, I didn't follow this issue recently, so I don't know if it 
proposes to use surrogateescape and/or IDNA.

I prefer to discuss the encoding used on UNIX in a new issue (or better 
continue the existing discussion on issue #9377?).

--
Added file: http://bugs.python.org/file41741/gethostbyaddr_encoding-3.patch

___
Python tracker 

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



[issue26230] Cookies do not correct if cookiename includes [ or ]

2016-01-28 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: test needed -> resolved
superseder:  -> Regression in cookie parsing with brackets and quotes

___
Python tracker 

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



[issue26230] Cookies do not correct if cookiename includes [ or ]

2016-01-28 Thread SilentGhost

New submission from SilentGhost:

You'd have to provide more information if you'd like that looked into.

--
nosy: +SilentGhost
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-01-28 Thread SilentGhost

SilentGhost added the comment:

I think it's worth saying that this wasn't a random choice intended to confuse 
beginners. Strings used represent input that is identical to the command-line 
input: if one wants to test it, one can just copy that string directly into the 
propmpt, it might be harder to reconstruct it from a list of strings.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Using str.split() for splitting full command line on arguments is anti-idiom. 
More correct way is to use shlex. But this is overkill for argparse examples 
(and in most cases we already have a list sys.argv). Explicit lists look clear 
enough.

The patch LGTM.

--
assignee: docs@python -> martin.panter
nosy: +serhiy.storchaka
stage: patch review -> commit review

___
Python tracker 

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



[issue26230] Cookies do not correct if cookiename includes [ or ]

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

Is this a duplicate of Issue 25228? If not, can you please explain what the 
problem is, perhaps with a demo, what it does wrong, and what you expect the 
result should be.

--
nosy: +martin.panter
stage:  -> test needed

___
Python tracker 

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



[issue26231] HTTPResponse.close() should consume all remaining data in body if any

2016-01-28 Thread Jacky

New submission from Jacky:

HTTPResponse.close() in httplib should consume all remaining data in body if 
any. Or the followed request would get the unread content from the previous 
request, which result in the wrong result.

The following code shown that the second request will get a wrong status code 
if calling HTTPResponse.close() on the first response.

The whole code consists of a HTTP server and a client. The server will always 
return 403 for testing.


def client():
conn = httplib.HTTPConnection(HOST, PORT)
conn.request('GET', PATH, None, headers={})
rsp = conn.getresponse()
print rsp.status
rsp.close()  # close response

conn.request('GET', PATH, None, headers={})
rsp2 = conn.getresponse()
print rsp2.status  # --> should be 403

The full version see the attached file (The server used Tornado)

--
components: Library (Lib)
files: zzz.py
messages: 259122
nosy: Jacky
priority: normal
severity: normal
status: open
title: HTTPResponse.close() should consume all remaining data in body if any
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file41742/zzz.py

___
Python tracker 

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



[issue16731] xxlimited/xxmodule docstrings ambiguous

2016-01-28 Thread Berker Peksag

Berker Peksag added the comment:

I think the difference between xxlimited and xxmodule is still a bit ambiguous. 
I would expect a mention of PEP 384 or a link to 
https://docs.python.org/3/c-api/stable.html to explain what Py_LIMITED_API 
really is.

+#ifndef Py_LIMITED_API
+# error "This file requires Py_LIMITED_API"
+#endif

I don't have a strong opinion about this, but I think the error message could 
be more informative (e.g. you must define a Py_LIMITED_API macro) Or we can 
improve https://docs.python.org/3/c-api/stable.html to give an example there.

--
nosy: +berker.peksag, serhiy.storchaka
stage:  -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue26136] DeprecationWarning for PEP 479 (generator_stop)

2016-01-28 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
nosy: +ezio.melotti

___
Python tracker 

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



[issue26160] Tutorial incorrectly claims that (explicit) relative imports don't work in the main module

2016-01-28 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread Steve Dower

Steve Dower added the comment:

I couldn't remember the names of the alternate functions Windows provides to do 
the encoding for you, but yes. There are socket APIs there that do encoding and 
handle memory allocation more safely.

Apart from bugs like this, it's not really urgent and it requires someone 
motivated to do it. Might be a good project for someone at the PyCon sprints.

--

___
Python tracker 

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



[issue24841] Some test_ssl network tests fail if svn.python.org is not accessible.

2016-01-28 Thread Berker Peksag

Berker Peksag added the comment:

> although they will need updating since the Issue 24841 changeover to 
> pythontest.net.

I think you meant issue 25940, right? :)

Do you want me to wait for issue 25940?

--
versions:  -Python 3.4

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread Emanuel Barry

Emanuel Barry added the comment:

If it worked for you, I assume it's fine and I probably did something wrong on 
my side. Thanks for the fix!

--

___
Python tracker 

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



[issue26199] fix broken link to hamcrest.library.integration.match_equality in unittest.mock "getting started" documentation

2016-01-28 Thread Raphael Das Gupta

Raphael Das Gupta added the comment:

You're welcome. Thanks for applying the patch.

Shouldn't it be applied to other affected versions (3.3 and 3.4), too, though?

--

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> Oh, sorry. The patch applies without any problem, then I re-compile 
> everything and run, and the same error happens. I re-compiled just now to 
> make double sure.

I tested my patch on Windows. I called my computer héça (3 non-ASCII letters!). 
Without the patch, I get the UTF-8 decoding error, as expected. With the patch, 
it gets the nice "héça" Unicode string, correctly decoded. I tested 
socket.getfqdn().

My patch will not fix all your issues at once :-) In the issue #26226, I saw at 
least 3 different bugs. But I'm now sure that my patch fixes a real bug, so I 
pushed it to Python 3.5 and default (3.6).

Thanks for the bug report Emanuel ;-)

--
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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread Emanuel Barry

Emanuel Barry added the comment:

Oh, sorry. The patch applies without any problem, then I re-compile everything 
and run, and the same error happens. I re-compiled just now to make double sure.

--

___
Python tracker 

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



[issue24705] sysconfig._parse_makefile doesn't expand ${} vars appearing before $() vars

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dec734dfe2fe by Berker Peksag in branch '3.5':
Issue #24705: Add a test case for ef84d21f5292
https://hg.python.org/cpython/rev/dec734dfe2fe

New changeset f9a18032cc22 by Berker Peksag in branch 'default':
Issue #24705: Add a test case for ef84d21f5292
https://hg.python.org/cpython/rev/f9a18032cc22

--

___
Python tracker 

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



[issue24705] sysconfig._parse_makefile doesn't expand ${} vars appearing before $() vars

2016-01-28 Thread Berker Peksag

Berker Peksag added the comment:

I've added a test case for ef84d21f5292. I think this can be closed now. Please 
reopen if not.

--
nosy: +berker.peksag
resolution:  -> fixed
stage: test needed -> 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



[issue26199] fix broken link to hamcrest.library.integration.match_equality in unittest.mock "getting started" documentation

2016-01-28 Thread Berker Peksag

Berker Peksag added the comment:

3.3 and 3.4 are in security-fix-only mode, which means they won't get bugfix 
and documentation updates anymore. See 
https://docs.python.org/devguide/devcycle.html for details.

--

___
Python tracker 

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



[issue26233] select.epoll.wait() should away calling malloc() each time

2016-01-28 Thread STINNER Victor

New submission from STINNER Victor:

My colleague Fabio M. Di Nitto noticed that the memory allocation on the heap 
(PyMem_Malloc()) in select.epoll.wait() can have an impact on performance when 
select.epoll.wait() is a busy applicatin.

He proposed attached patch to allocate memory on the stack for up to 
FD_SETSIZE-1 events: see attached patch.

--
components: Library (Lib)
files: epoll_stack.patch
keywords: patch
messages: 259141
nosy: haypo, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: select.epoll.wait() should away calling malloc() each time
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file41743/epoll_stack.patch

___
Python tracker 

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



[issue26231] HTTPResponse.close() should consume all remaining data in body if any

2016-01-28 Thread Jacky

Jacky added the comment:

In my opinion, HTTPResponse.close() should do really close work. Not only 
releasing the underlying file obj but also need to consume the remaining data 
to make sure the request complete.

If close() does not consume the remaining data, the user would have to do it 
after invoking close(), regardless of how large the data is. But how do do it, 
the HTTPResponse has been closed. So we have to use HTTPConnection.sock to do 
read work. However, this looks somewhat weird.

--

___
Python tracker 

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



[issue26222] Missing code in linux_distribution python 2.7.11

2016-01-28 Thread Kevin Dwyer

Kevin Dwyer added the comment:

The quoted code doesn't exist in 2.7.10 
(https://hg.python.org/cpython/file/v2.7.10/Lib/platform.py)

It looks like it's from a patch applied by Debian themselves: see 
http://sources.debian.net/src/python2.7/2.7.11-3/debian/patches/platform-lsbrelease.diff/?hl=33#L33

--
nosy: +kdwyer

___
Python tracker 

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



[issue26233] select.epoll.wait() should away calling malloc() each time

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

I dislike allocating large memory block on the stack, we should not abuse it.

I propose instead to store the memory block allocated on the heap in the epoll 
object. Attached patch implements this idea.

The buffer is stolen from the epoll object when epoll.poll() is called. Then it 
is stored again inside the epoll object, except if another thread stored a 
larger buffer in the meanwhile. The largest buffer is also kept.

The buffer exchange is protected by the GIL.

My patch also overallocates the buffer by 50% to avoid calling realloc() to 
many times. Using the selectors module, maxevents is the number of registered 
FD. Using asyncio, the number of registered FD changes a lot.

Side effect: the memory block is not released after the call to epoll.poll(). 
If you can it with an insane max_events, it will bloat your memory until your 
close the poller.

If the approach is considered interested and efficient, I can work on a similar 
patch for other pollers.

--
Added file: http://bugs.python.org/file41744/epoll_buffer.patch

___
Python tracker 

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



[issue26232] Mock(spec=spec) has no effect

2016-01-28 Thread David Szotten

New submission from David Szotten:

Unless i misunderstand the docs, i would expect `Mock(foo)` to have the same 
effect as `create_autospec(foo)`, but that doesn't appear to be the case:

>>> m1 = mock.Mock(spec=lambda: None)
>>> m2 = mock.create_autospec(spec=lambda: None)
>>> m1(1)

>>> m2(1)
# snip
TypeError: too many positional arguments

--
components: Library (Lib)
messages: 259130
nosy: davidszotten
priority: normal
severity: normal
status: open
title: Mock(spec=spec) has no effect
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread Emanuel Barry

Emanuel Barry added the comment:

Yes, it's not all that urgent. And Victor's latest patch doesn't work, either :(

I wonder if there's a way to (temporarily) modify the output of 
``socket.gethostname()`` to be able to test such weird corner cases.

--

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> Yes, it's not all that urgent. And Victor's latest patch doesn't work, either 
> :(

Could you please elaborate? The patch applies cleanly? You rebuild the socket 
module? Which error message do you get?

--

___
Python tracker 

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



[issue26233] select.epoll.poll() should away calling malloc() each time

2016-01-28 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Overallocating by 50% might be overkill here; I wouldn't imagine most users of 
epoll.poll would use anything but:

1. Limit to 1 event
2. Limit to some constant K events
3. Use default maxevents (FD_SETSIZE - 1)

Even if called in pathological order, that would only involve three progressive 
reallocations before steady state; potentially avoiding one of them (if K and 
FD_SETSIZE - 1 are within the 50% overallocation) in a relatively uncommon case 
doesn't seem like it's worth the guaranteed waste in the common case.

--
nosy: +josh.r
title: select.epoll.wait() should away calling malloc() each time -> 
select.epoll.poll() should away calling malloc() each time

___
Python tracker 

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



[issue21201] Uninformative error message in multiprocessing.Manager()

2016-01-28 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0681f0a1fe6e by Victor Stinner in branch '3.5':
Windows: Decode hostname from ANSI code page
https://hg.python.org/cpython/rev/0681f0a1fe6e

New changeset 26f6d8cc2749 by Victor Stinner in branch 'default':
Merge 3.5: Issue #26227
https://hg.python.org/cpython/rev/26f6d8cc2749

--
nosy: +python-dev

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

Steve:
"""
I couldn't remember the names of the alternate functions Windows provides to do 
the encoding for you, but yes. There are socket APIs there that do encoding and 
handle memory allocation more safely.

Apart from bugs like this, it's not really urgent and it requires someone 
motivated to do it. Might be a good project for someone at the PyCon sprints.
"""

Yeah, using the native Windows API is better, it gives access to the full 
Unicode character set. But it requires to spend time on the C code, and *I* am 
not interested to work on such project.

If you are motived, please open a new issue for that. If you are not motivated, 
I'm not sure that it's worth to open a bug report. Using an hostname not 
encodable to the ANSI code page would probably cause serious issues (not in 
Python, but in other applications).

When I played with filenames non-encodable to the ANSI code page, I also get 
errors from multiple applications, whereas Python now uses the native Windows 
API to access the filesystem. So sometimes Python is better than some other 
applications, sometimes it's as good :-)

--

___
Python tracker 

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



[issue26233] select.epoll.poll() should away calling malloc() each time

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> Overallocating by 50% might be overkill here; I wouldn't imagine most users 
> of epoll.poll would use anything but: (...)

See my second message:
"My patch also overallocates the buffer by 50% to avoid calling realloc() to 
many times. Using the selectors module, maxevents is the number of registered 
FD. Using asyncio, the number of registered FD changes a lot."

If you use selectors or asyncio, max_events depends on the current number of 
registered FD and it almost changes at each call to epoll.poll().

asyncio only registers an FD to listen for read events when the application 
starts to read on this FD. There is also an optimization: it first tries to 
read bytes in non-blocking mode. It only registers the FD if it receives 0 byte 
(if recv() fails with a "woud block" error). It's similar for write events.

--

___
Python tracker 

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



[issue26232] Mock(spec=spec) has no effect

2016-01-28 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +michael.foord

___
Python tracker 

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



[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ddce15b21c21 by Victor Stinner in branch '3.5':
Backport fixes on test_eintr
https://hg.python.org/cpython/rev/ddce15b21c21

--

___
Python tracker 

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



[issue25234] test_eintr.test_os_open hangs under Xcode 7

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ddce15b21c21 by Victor Stinner in branch '3.5':
Backport fixes on test_eintr
https://hg.python.org/cpython/rev/ddce15b21c21

--

___
Python tracker 

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



[issue26232] Mock(spec=spec) has no effect

2016-01-28 Thread Michael Foord

Michael Foord added the comment:

create_autospec and Mock(spec=spec) are very different. Mock(spec=spec) creates 
a mock object with the same *attributes* as the original. It does not create 
functions like create_autospec can.

--
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



[issue26233] select.epoll.wait() should away calling malloc() each time

2016-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Any benchmarks?

--

___
Python tracker 

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



[issue26232] Mock(spec=spec) has no effect

2016-01-28 Thread David Szotten

David Szotten added the comment:

thanks, and apologies for the noise

--

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-01-28 Thread paul j3

paul j3 added the comment:

I can understand changing 

'7'.split()

but this change is IMO ugly:

- >>> print(parser.parse_args('--foo B cmd --arg1 XX ZZ'.split()))
+ >>> print(parser.parse_args(['--foo', 'B', 'cmd', '--arg1', 'XX', 'ZZ']))

I've answered a lot of argparse questions on Stackoverflow, and don't recall 
anyone being confused by the use of 'split' in the documentation.  The 
documentation as a whole is overwealming to many users.  But not this detail.

Many SO answers use the split idiom.  Being aware of this issue I have edited 
some of my answers to use lists, even if I used split when creating them in 
Ipython.   But only in the short cases.

Other times I copy-n-paste a complete (short) script, along with one or more 
sample runs (bash line plus printout).  That kind of display is closer to what 
most new users expect and see.  But it does not fit with the doctest format 
used in the argparse documentation.

Come to think of it, the doctest example format might be a greater hindrance to 
understanding than the split idiom.  New users tend to construct complete 
scripts, and then complain that it doesn't do what they want.  Often I have to 
ask them to print sys.argv to see what the shell is giving the parser.  And to 
print args to see what parser is giving back.  New users aren't in habit of 
using interactive test inputs as illustrated in the docs.

The patch proposed here may be nice in terms of consistency, but I don't think 
it improves readability.

--

___
Python tracker 

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



[issue26233] select.epoll.wait() should away calling malloc() each time

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> Any benchmarks?

Wait, it's easier to write a patch than to cook a benchmark :-)

Attached script bench_epoll_poll.py creates a lot of sockets and call 
epoll.poll() in non-blocking mode (timeout=0). You can decide to create or not 
events.

It looks like performance when epoll.poll() gets events are unchanged with my 
patch.

The performance are better when epoll.poll() doesn't get any event: between 6% 
and 20% faster.

I'm not completly sure that it's worth it since we are talking about 
nanoseconds. The largest seen difference was 94 nanoseconds: 420 ns => 326 ns.

My microbenchmark is unstable. Even if it runs the benchmark 25 or 50 times and 
take the minimum, I have to run it between 3 and 10 times to see the "real" 
minimum timing... It's a common problem for microbenchmarks with timing smaller 
than 1 ms.


Create read+events (10 sockets):

*  Without the patch: Best of 25 runs (10 loops, 10 FDs): 1294 ns per call 
to epoll.poll()
*  With the patch: Best of 50 runs (10 loops, 10 FDs): 1221 ns (-6%) per 
call to epoll.poll()

Create read+events (8000 sockets):

*  Without the patch: Best of 25 runs (10 loops, 16000 FDs): 4.6 ms per call to 
epoll.poll()
*  With the patch: Best of 25 runs (10 loops, 16000 FDs): 4.6 ms (same) per 
call to epoll.poll()

Don't create events (10 sockets):

*  Without the patch: Best of 50 runs (10 loops, 10 FDs): 367 ns per call 
to epoll.poll()
*  With the patch: Best of 50 runs (10 loops, 10 FDs): 343 ns (-7%) per 
call to epoll.poll()

Don't create events (1000 sockets):

*  Without the patch: Best of 50 runs (10 loops, 1000 FDs): 420 ns per call 
to epoll.poll()
*  With the patch: Best of 50 runs (10 loops, 1000 FDs): 326 ns (-22%) per 
call to epoll.poll()

Don't create events (16000 sockets):

*  Without the patch: Best of 50 runs (10 loops, 16000 FDs): 422 ns per 
call to epoll.poll()
*  With the patch: Best of 50 runs (10 loops, 16000 FDs): 338 ns (-20%) per 
call to epoll.poll()

--
Added file: http://bugs.python.org/file41745/bench_epoll_poll.py

___
Python tracker 

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



[issue26222] Missing code in linux_distribution python 2.7.11

2016-01-28 Thread Kevin Dwyer

Changes by Kevin Dwyer :


--
type: performance -> behavior

___
Python tracker 

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



[issue26202] The range() object is deepcopied as atomic

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5772eae17a82 by Serhiy Storchaka in branch '3.5':
Issue #26202: copy.deepcopy() now correctly copies range() objects with
https://hg.python.org/cpython/rev/5772eae17a82

New changeset d5d0b62c2830 by Serhiy Storchaka in branch 'default':
Issue #26202: copy.deepcopy() now correctly copies range() objects with
https://hg.python.org/cpython/rev/d5d0b62c2830

--
nosy: +python-dev

___
Python tracker 

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



[issue26202] The range() object is deepcopied as atomic

2016-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Victor.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> 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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Since slicing is going to be added to deques, it is worth thinking about what 
the behavior should be there as well:

   d = deque('abcde', maxlen=7)
   d[3:4] = 'efghijklm'

Side note: repetition behaves like extend() using maxlen to decide how much to 
truncate from the left:

>>> from collections import deque
>>> d = deque('abcde', maxlen=8)
>>> d *= 2
>>> d
deque(['c', 'd', 'e', 'a', 'b', 'c', 'd', 'e'], maxlen=8)

Ideally, the deque API should be coherent and simple taken as a whole so that 
the behaviors are consistent and predictable as possible even if the general 
rules lead to some oddities in some uncommon cases.  

One such general rule could be:  "When maxlen is defined, operations proceed as 
if the deque were unbounded and then truncation is applied to the left" (this 
is like the rule in decimal where inputs to operations are treated as precise 
and context rounding is applied after the operation).  The general rule would 
fit a mental models of "inserted new data is prioritized over old data", that 
"maxlen is all about automatically evicting data to make room for the newer 
data", and that "methods without 'left' in their name correspond to newest data 
on the right and next to be evicted on the left".

--

___
Python tracker 

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



[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1c690cb4def8 by Serhiy Storchaka in branch '3.5':
Issue #26198: Added tests for "es", "et", "es#", "et#" and "C" format units
https://hg.python.org/cpython/rev/1c690cb4def8

New changeset 745ad3010384 by Serhiy Storchaka in branch 'default':
Issue #26198: Added tests for "es", "et", "es#", "et#" and "C" format units
https://hg.python.org/cpython/rev/745ad3010384

New changeset 60a2d67dacb3 by Serhiy Storchaka in branch '2.7':
Issue #26198: Added tests for string-related format units of PyArg_Parse*()
https://hg.python.org/cpython/rev/60a2d67dacb3

--
nosy: +python-dev

___
Python tracker 

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



[issue26229] Make number serialization ES6/V8 compatible

2016-01-28 Thread SilentGhost

Changes by SilentGhost :


--
components: +Extension Modules -Interpreter Core
nosy: +ezio.melotti, pitrou, rhettinger
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2016-01-28 Thread paul j3

paul j3 added the comment:

How about:

These store the values True and False respectively (and default to False 
and True if absent).

The reference to `store_const` is confusing, since almost no one uses that 
action.

The `store_const` paragraph has:

(Note that the const keyword argument defaults to the rather unhelpful 
None.) 

But the most common `store` action also defaults to the default default None.  
In fact most action types do that.

With 'store' action, None is a useful default, since its impossible to provide 
in the commandline.  Thus

 if args.foo is None:

is a clear test that 'foo' was not present in the commandline.  I can imagine 
using the same test on a 'store_const' argument (though I've never had the need 
to use it or recommend it).

I'm almost of the opinion that we should remove that parenthetical remark.

The 'const' parameter is used most often with 'store' and "nargs='?'", as 
illustrated in that 'nargs' subsection.

To complicate things, if I provide a "argument_default='boo'" parameter in the 
parser definition, it overrides all of these default defaults, including for 
'store_true'.  In that case an explicit 'default=False' is *required*, not 
superfluous.

To further complicate things, 'parser.set_defaults' can override all of these.

We've almost given users too many ways of setting 'default'. :)  Fortunately in 
practice they don't use most of them.

--

___
Python tracker 

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



[issue26222] Missing code in linux_distribution python 2.7.11

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

I think Kevin is right. Debian often carries its own downstream patches. In 
this case, the patch was proposed in Issue 9514, which is closed as “won’t 
fix”. In Python 3, linux_distribution() is apparently deprecated (Issue 1322).

--
components: +Library (Lib) -Build
nosy: +martin.panter

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 687be1cbe587 by Serhiy Storchaka in branch '3.5':
Issue #19883: Fixed possible integer overflows in zipimport.
https://hg.python.org/cpython/rev/687be1cbe587

New changeset f4631dc56ecf by Serhiy Storchaka in branch 'default':
Issue #19883: Fixed possible integer overflows in zipimport.
https://hg.python.org/cpython/rev/f4631dc56ecf

New changeset cebcd2fd3e1f by Serhiy Storchaka in branch '2.7':
Issue #19883: Fixed possible integer overflows in zipimport.
https://hg.python.org/cpython/rev/cebcd2fd3e1f

--
nosy: +python-dev

___
Python tracker 

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



[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

One review comment

--
nosy: +martin.panter

___
Python tracker 

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



[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

I definitely agree with removing the remark about the “const” value with 
store_const. People here seem to be overloading the terms “default” and 
“argument”. When using store_const, it seems the programmer must also specify a 
value for the “const” parameter to add_argument(). It is incorrect to say it is 
None if not explicitly set.

On the other hand, I think if the end user omits a CLI argument configured with 
store_const, then the argparse module will substitute None, or the value of the 
“default” parameter to add_argument().

For the original report about store_true/false, perhapse it would be sufficient 
to port revision 49677cc6d83a to Python 3. Although there is a stray “using” 
that should probably be fixed.

--
nosy: +martin.panter
versions: +Python 2.7, 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



[issue19883] Integer overflow in zipimport.c

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

This seems to be causing an infinite loop in 2.7, in 
test_cmd_line_script.CmdLineTest.test_module_in_package_in_zipfile():

test_module_in_package_in_zipfile (test.test_cmd_line_script.CmdLineTest) ... ^C
Test suite interrupted by signal SIGINT.
1 test omitted:
test_cmd_line_script
[Exit 1]
[vadmium@localhost cpython]$ sudo strace -p 11412 2>&1 | head
Process 11412 attached - interrupt to quit
lseek(3, 1024, SEEK_SET)= 1024
lseek(3, 1024, SEEK_SET)= 1024
lseek(3, 1024, SEEK_SET)= 1024
lseek(3, 1024, SEEK_SET)= 1024
lseek(3, 1024, SEEK_SET)= 1024
lseek(3, 1024, SEEK_SET)= 1024
lseek(3, 1024, SEEK_SET)= 1024
lseek(3, 1024, SEEK_SET)= 1024
lseek(3, 1024, SEEK_SET)= 1024
[vadmium@localhost cpython]$ ls -l /proc/11412/fdtotal 0
lr-x-- 1 vadmium users 64 Jan 29 22:23 0 -> pipe:[1249749]
l-wx-- 1 vadmium users 64 Jan 29 22:23 1 -> pipe:[1249750]
l-wx-- 1 vadmium users 64 Jan 29 22:23 2 -> pipe:[1249750]
lr-x-- 1 vadmium users 64 Jan 29 22:23 3 -> /tmp/tmpHMiuOm/test_zip.zip 
(deleted)
[vadmium@localhost cpython]$ kill 11412

--
nosy: +martin.panter

___
Python tracker 

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



[issue26186] LazyLoader rejecting use of SourceFileLoader

2016-01-28 Thread Brett Cannon

Brett Cannon added the comment:

I think I'm liking the following approach:

  if __debug__:
hopefully_None = loader.create_module(spec)
if hopefully_None is not None:
warnings.warn("watch out!", ImportWarning)

--

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 82ee3c24bb86 by Serhiy Storchaka in branch '2.7':
Fixed an infinite loop in zipimport caused by cebcd2fd3e1f (issue #19883).
https://hg.python.org/cpython/rev/82ee3c24bb86

--

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2016-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Martin.

--

___
Python tracker 

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



[issue26233] select.epoll.poll() should avoid calling malloc() each time

2016-01-28 Thread STINNER Victor

Changes by STINNER Victor :


--
title: select.epoll.poll() should away calling malloc() each time -> 
select.epoll.poll() should avoid calling malloc() each time

___
Python tracker 

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



[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Martin. This was 64-bit specific bug.

--

___
Python tracker 

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



[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is updated patch.

--
Added file: http://bugs.python.org/file41746/pyarg_parse_encoded_string_2.patch

___
Python tracker 

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



[issue19023] ctypes docs: Unimplemented and undocumented features

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

Okay I have committed the Array and _Pointer stuff. I suggest if anyone wants 
to work on the Union classes, they open a separate report. (I never understood 
what they are for. C doesn’t have much little or big endian stuff; byte order 
mostly depends on the ABI, so why is ctypes different?)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-28 Thread Steve Dower

Steve Dower added the comment:

This has been confirmed as a bug in VS 2015 RTM that was fixed in Update 1.

It only affects debug builds, which are not common and I expect most people 
using them to be keeping VS up to date.

I'd rather not add extra logic to distutils just to detect this case. Ideally, 
the buildbots should be updated to VS 2015 Update 1 at some point.

--

___
Python tracker 

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



[issue24841] Some test_ssl network tests fail if svn.python.org is not accessible.

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

Yes sorry I did mean Issue 25940 (too many bug numbers!), but only the main 
change which has already been made (revision adf750b1252d etc). So you don’t 
have to wait for that.

--

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

I don’t want to make any controversial changes. Half the purpose of the patch 
was to let people see what it would look like. Another option would be to only 
do the single or empty list changes, and leave most of the longer lists as they 
are with split().

--

___
Python tracker 

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



[issue26234] The typing module includes 're' and 'io' in __all__

2016-01-28 Thread Guido van Rossum

New submission from Guido van Rossum:

If you write "from typing import *" you get "re" and "io" for free, which is 
surprising if this import occurs after an actual "import re" or "import io".

The solution is not to include those two in __all__. You can still use them -- 
use "from typing import re" explicitly or reference them as "typing.re".

Because typing is provisional I'll fix this in 3.5.2 as well.

--
messages: 259177
nosy: gvanrossum
priority: release blocker
severity: normal
status: open
title: The typing module includes 're' and 'io' in __all__
versions: 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



[issue26234] The typing module includes 're' and 'io' in __all__

2016-01-28 Thread Guido van Rossum

Guido van Rossum added the comment:

Cross-reference: https://github.com/python/typing/issues/178

--

___
Python tracker 

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



[issue26234] The typing module includes 're' and 'io' in __all__

2016-01-28 Thread Guido van Rossum

Changes by Guido van Rossum :


--
assignee:  -> gvanrossum
type:  -> behavior

___
Python tracker 

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



[issue26235] argparse docs: Positional * argument in mutually exclusive group requires a default parameter

2016-01-28 Thread paul j3

New submission from paul j3:

The documentation for Mutual exclusion

https://docs.python.org/3/library/argparse.html#mutual-exclusion

needs a note that a mutually exclusive group may contain one positional 
argument.  But that argument must be either nargs='?', or nargs='*'.  If '*' it 
must also have a default parameter (other than None).

(this issue came up recently on stackoverflow.  It may have also been raised in 
the past as a bug/issue, but I don't have time at moment to search.  I had to 
search through several layers of code to remember all the details.)

http://stackoverflow.com/questions/35044288/how-can-i-create-an-argparse-mutually-exclusive-group-with-multiple-positional-p

--
assignee: docs@python
components: Documentation
messages: 259179
nosy: docs@python, paul.j3
priority: normal
severity: normal
status: open
title: argparse docs: Positional * argument in mutually exclusive group 
requires a default parameter
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



[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

Also, test_getargs2 seems faulty on 2.7. I am seeing MemoryError; some of the 
buildbots are segfaulting.

--

___
Python tracker 

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



[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2016-01-28 Thread Julien Baley

Julien Baley added the comment:

I like paul.j3's suggestion, but it would probably make more sense to have it 
consistent with python2 and port the change Martin pointed to.

How does one do that?

--

___
Python tracker 

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



[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d0b4be7d2134 by Serhiy Storchaka in branch '2.7':
Fixed a crash in new tests in test_getargs2 added in 60a2d67dacb3 (issue 
#26198).
https://hg.python.org/cpython/rev/d0b4be7d2134

--

___
Python tracker 

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



[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> I'd rather not add extra logic to distutils just to detect this case.

Hum, does it make sense to skip some tests on VS 2015 without the
update? (Is it difficult to detect VS version?)

--

___
Python tracker 

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



[issue19023] ctypes docs: Unimplemented and undocumented features

2016-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 034b077d3015 by Martin Panter in branch '2.7':
Issue #19023: Document ctypes array and pointer classes
https://hg.python.org/cpython/rev/034b077d3015

--

___
Python tracker 

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



[issue26234] The typing module includes 're' and 'io' in __all__

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

I would argue against changing this. They seem to be documented classes, so I 
guess this would break pydoc. It is a similar situation to os.open(), 
threading.enumerate(), etc. But I don’t have a strong opinion, and accept other 
people like keeping __all__ a minimal set of names and not reflecting the full 
API.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-28 Thread Jeremy Kloth

Jeremy Kloth added the comment:

My buildbot updated to VS2015.1 successfully.  test_distutils is passing again.

As to the bug title, it should mention the incorrect DLL version error, not the 
/LTCG *warning*.  That's what I get for just doing a quick scan of the comments.

--

___
Python tracker 

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



[issue26039] More flexibility in zipfile interface

2016-01-28 Thread Martin Panter

Martin Panter added the comment:

I left some review comments.

Since the rules for read-only and write-only access are so different, would it 
make more sense to have a separate method? Maybe your writefile() name, or 
open_write() or something? I am not too fussed, but unless there is a chance of 
being able to open a read-write random access file, I find these 
split-personality open() methods a bit “un-Pythonic”. On the other hand, I 
guess it is superficially consistent with other open() functions.

Also, perhaps if you guaranteed the write-only option returned a file-like 
object, you could use shutil.copyfileobj() rather than a custom read-write loop.

--
nosy: +martin.panter
stage: test needed -> patch review

___
Python tracker 

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



[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-28 Thread Steve Dower

Steve Dower added the comment:

For this particular issue, the way to detect it is to read 
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\DevDiv\vc\Servicing\14.0\Tools.X86.X64@UpdateVersion
 and see if it is at least "14.0.23506".

This doesn't extend to other VS versions, but it should be sufficient to skip 
the tests for this bug. I really don't want that check in the actual stdlib.

--

___
Python tracker 

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



[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-28 Thread Jeremy Kloth

Jeremy Kloth added the comment:

I'm upgrading the VS installation on my buildbot currently so this should be a 
non-issue going forward.

However, I think it would be good to add/change the bug title to include 
something about the /LTCG error so as to enable better searching when 
developers do encounter this error in their own projects.

--

___
Python tracker 

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



[issue26189] Interpreter returns control to cmd.exe early

2016-01-28 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

Here, ShellExecuteExW is indeed called, with the specified parameters, 
but the hProcess member is still NULL after the call. This must be the 
reason for the discrepancy.

--
nosy: +Vano

___
Python tracker 

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



[issue26155] 3.5.1 installer issue on Win 7 32 bit

2016-01-28 Thread TarotRedhand

TarotRedhand added the comment:

Sorry for the delay but RL intervened. Because of the size of the log files 
(total of 17.7 megs), rather than post the contents in one these windows I 
placed them into a 7zip 7z archive. I am attaching them to this message.

I hope this helps.

--
Added file: http://bugs.python.org/file41747/Python 351 logs.7z

___
Python tracker 

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



[issue26155] 3.5.1 installer issue on Win 7 32 bit

2016-01-28 Thread TarotRedhand

TarotRedhand added the comment:

Please ignore the part about the 7z being attached to the last message. 
This site wanted me to divulge certain personal information, that I am not 
prepared to give, before it would upload that file.

I have instead placed it into my dropbox/public folder the address is

https://dl.dropboxusercontent.com/u/15541064/Python/Python%20351%20logs.7z

As I said before I hope this is of use.

--

___
Python tracker 

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



  1   2   >