[issue23440] Extend http.server.SimpleHTTPRequestHandler testing

2015-07-22 Thread Berker Peksag

Berker Peksag added the comment:

Thanks Martin and Demian.

--
resolution:  - fixed
stage: commit review - resolved
status: open - closed
versions: +Python 3.6 -Python 3.4

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



[issue21750] mock_open data is visible only once for the life of the class

2015-07-22 Thread Paul Koning

Paul Koning added the comment:

Section 26.7.7 of the library manual describes mock_open with the words:

A helper function to create a mock to replace the use of open. It works for 
open called directly or used as a context manager.

which implies that it works just like open.  Given that it doesn't (not if you 
do two opens and use both streams concurrently) that difference should be 
called out as a difference, or limitation.

--

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, my approach is to look at the most important code
paths to see if there is any work being done that isn't
essential for the result being computed.

Next, I look at the generated assembly to estimate speed
by counting memory accesses (and whether they are cached
fresh accesses or stale random accesses) and I look at
the branches (and whether they are predictable or not).

The table=so-table assignment was being done for all code
paths but was only needed around the rich compare.  Here
is the before and after for the most important path
(the first lookup).  Note that the change saves one memory
spill and one reload.

Before:
---
_set_add_entry:
pushq   %r15
pushq   %r14
movq%rdx, %r14
pushq   %r13
pushq   %r12
movq%rdi, %r12
pushq   %rbp
movq%rsi, %rbp
pushq   %rbx
subq$56, %rsp
movq40(%rdi), %rax
addq$1, (%rsi)
movq%rax, 16(%rsp)-- spill
movq32(%r12), %rdx
movq%rdx, %r15
andq%r14, %r15
movq%r15, %rbx
salq$4, %rbx
addq16(%rsp), %rbx-- reload
movq(%rbx), %rcx
testq   %rcx, %rcx
je  L430


AFTER
-
_set_add_entry:
pushq   %r15
movq%rdx, %r15
pushq   %r14
pushq   %r13
pushq   %r12
movq%rdi, %r12
pushq   %rbp
movq%rsi, %rbp
pushq   %rbx
subq$56, %rsp
movq40(%rdi), %rdx
addq$1, (%rsi)-- no spill
movq%rdx, %r11
L428:
movq32(%r12), %rcx
movq%rcx, %r13
andq%r15, %r13
movq%r13, %rbx
salq$4, %rbx
addq%r11, %rbx -- from register
movq(%rbx), %r14
testq   %r14, %r14
je  L429


The code around the rich compare used to do memory
loads that weren't necessary for the most likely case
(since the 64-bit hash values match, it is very likely
that the comparison will report a match).

BEFORE
--

call_PyObject_RichCompareBool
movq24(%rsp), %rcx
movq(%rcx), %rdi
leaq-1(%rdi), %rdx
testq   %rdx, %rdx
movq%rdx, (%rcx)
je  L489
testl   %eax, %eax
js  L437  --- predictable error branch
movq40(%r12), %rdx--- memory load 
cmpq16(%rsp), %rdx--- memory load
jne L460 
cmpq(%rbx), %rcx  --- memory load  
jne L429  --- predictable restart branch
testl   %eax, %eax--- predictable found_active branch
jne L432  --- most common exit point
movq32(%r12), %rdx


AFTER
-

call_PyObject_RichCompareBool
movq16(%rsp), %rcx
movq(%rcx), %rdi
leaq-1(%rdi), %rdx
testq   %rdx, %rdx
movq%rdx, (%rcx)
je  L485
cmpl$0, %eax
jg  L431  -- common exit before the memory loads!
L490:
jne L434
movq40(%r12), %rdx--- memory load 
cmpq%rdx, 24(%rsp)--- memory load 
movq%rdx, %r11
jne L428
cmpq(%rbx), %rcx  --- memory load 
jne L428

--

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



[issue5305] imaplib should support international mailbox names

2015-07-22 Thread Александр Цамутали

Changes by Александр Цамутали asts...@yandex.ru:


--
type:  - enhancement

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



[issue9850] obsolete macpath module dangerously broken and should be removed

2015-07-22 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I think it is by now safe to remove macpath, AFAIK there is no real use-case 
anymore for having classic MacOS9 paths on any recentish version of OSX.]

I'm setting the version to 3.6 because it is too late to do this for Python 
3.5, but it can be done for 3.6.

--
versions: +Python 3.6 -Python 3.5

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



[issue23440] Extend http.server.SimpleHTTPRequestHandler testing

2015-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 267ea1731a91 by Berker Peksag in branch '3.5':
Issue #23440: Improve http.server.SimpleHTTPRequestHandler tests
https://hg.python.org/cpython/rev/267ea1731a91

New changeset 7999671dc991 by Berker Peksag in branch 'default':
Issue #23440: Improve http.server.SimpleHTTPRequestHandler tests
https://hg.python.org/cpython/rev/7999671dc991

--
nosy: +python-dev

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



[issue23440] Extend http.server.SimpleHTTPRequestHandler testing

2015-07-22 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
assignee:  - berker.peksag

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



[issue24503] csv.writer fails when within csv.reader

2015-07-22 Thread Wolfgang E. Sanyer

Wolfgang E. Sanyer added the comment:

You can close this - it turns out that I was looping through the input file 
once first, and did not properly rewind it after doing so.

Might it make sense to have the csv module rewind the file after it has been 
looped through, so that it acts as a typical list?

--
status: open - closed

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



[issue2091] file accepts 'rU+' as a mode

2015-07-22 Thread Robert Collins

Robert Collins added the comment:

Updated patch. I'm not going to apply right now - giving it a little time to 
let folk chime on whether this should be applied all the way back to 3.4, or 
not.

My inclination is to only apply it to 3.6.

--
nosy: +rbcollins
Added file: http://bugs.python.org/file39980/issue2091-3.patch

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



[issue24503] csv.writer fails when within csv.reader

2015-07-22 Thread R. David Murray

R. David Murray added the comment:

No, the object is just a wrapper around an iterator.  It doesn't know or care 
that you've passed in a file iterator...it is the file iterator's behavior that 
is non standard (this has been discussed elsewhere in the tracker, but it is 
not something that can be changed at this point, since files have always worked 
that way).

--
nosy: +r.david.murray
resolution:  - not a bug
stage: test needed - resolved

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



[issue16995] Add Base32 support for RFC4648 Extended Hex alphabet (patch attached)

2015-07-22 Thread Matthäus Wander

Matthäus Wander added the comment:

I've created a new patch that works against the current 3.5 sources. Should be 
fine for 3.6, I guess.

Separate functions b32hexencode and b32hexdecode are used now. There is no 
optional parameter base32hex anymore.

--
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file39981/py3_base32hex.patch

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



[issue13938] 2to3 fails to convert types.StringTypes appropriately

2015-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b97b6cc381d7 by Robert Collins in branch 'default':
Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond.
https://hg.python.org/cpython/rev/b97b6cc381d7

--
nosy: +python-dev

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



[issue13938] 2to3 fails to convert types.StringTypes appropriately

2015-07-22 Thread Robert Collins

Robert Collins added the comment:

I've applied this to 3.6.

--
nosy: +rbcollins

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



[issue13938] 2to3 fails to convert types.StringTypes appropriately

2015-07-22 Thread R. David Murray

R. David Murray added the comment:

Looking at the audit log its not clear to me which versions Benjamin wanted 
this applied to, though it looks like 2.7 at least.

--
nosy: +r.david.murray

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



[issue24651] Mock.assert* API is in user namespace

2015-07-22 Thread Carl Meyer

Carl Meyer added the comment:

FWIW, my assumption was that the typical usage pattern would be `import mock` 
rather than separate imports of all the assertions, so I don't think there'd 
really be an increase in what users need to know about or import. (They already 
need to know about the methods on the mock object, knowing about functions in a 
module isn't practically any different.)

But the breaking working code for insufficient benefit argument is strong 
indeed, and personally I'm happy to defer to the module author on this one.

Thanks for writing and maintaining mock!

--

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



[issue24686] zipfile is intolerant of extra bytes

2015-07-22 Thread Devin Fisher

New submission from Devin Fisher:

Not sure if this is a bug. The attached jar file is malformed.  Unzip (6.00) 
says the following about the malformedness of the jar file:

unzip -tqq bad.jar 
com/pixelmed/apps/DoseUtility$OurSourceDatabaseTreeBrowser$1.class bad 
extra-field entry:
  EF block length (43230 bytes) exceeds remaining EF data (10 bytes)


But unzip (6.00) and my GNOME Archive Manager (3.16.3) are able to open and 
extract the file without issue. 

So I'm wondering if zipfile is too strict?

Anyway, when trying to interact with attached jar file I get the following 
error.

Code:
import zipfile
if __name__ == __main__:
path = 'bad.jar'
file = zipfile.ZipFile(path)

Output:
Traceback (most recent call last):
  File /home/devin.fisher/sandboxes/feeder.v61_release.dev/temp/bug.py, line 
4, in module
file = zipfile.ZipFile(path)
  File /usr/lib64/python3.4/zipfile.py, line 937, in __init__
self._RealGetContents()
  File /usr/lib64/python3.4/zipfile.py, line 1034, in _RealGetContents
x._decodeExtra()
  File /usr/lib64/python3.4/zipfile.py, line 418, in _decodeExtra
counts = unpack('QQQ', extra[4:28])
struct.error: unpack requires a bytes object of length 24

--
components: Library (Lib)
files: bad.jar
messages: 247137
nosy: Devin Fisher
priority: normal
severity: normal
status: open
title: zipfile is intolerant of extra bytes
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file39983/bad.jar

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



[issue24685] collections.OrderedDict collaborative subclassing

2015-07-22 Thread Eric Frederich

New submission from Eric Frederich:

After watching the PyCon talk Super considered super[1] and reading the 
corresponding blog post[2] I tried playing with dependency injection.

I was surprised to notice that the example he gave did not work if I swap the 
order of the classes around.  I think it should have.  See attached file.

I think this is a bug in collections.OrderedDict
OrderedDict is not well-behaved as far as cooperative subclassing is concerned.

The source code is hard wired with a keyword argument 
dict_setitem=dict.__setitem__ which it then calls at the end with 
dict_setitem(self, key, value)

A quick search of github for dict_setitem shows that this
bad practice seems be making its way into other projects

If dict_setitem keyword arg is really necessary to have, then maybe:

(a) have it default to None
(b) at the end of __setitem__ do something like:

if dict_setitem is not None:
return dict_setitem(self, key, value)

super(OrderedDict, self).__setitem__(key, value)

After a discussion on #py-dev this seemed like a reasonable request (not 
necessarily the implementation, but the idea that OrderedDict should cooperate).
I tested this against the C implementation of OrderedDict in Python 3.5 and 
noticed that it doesn't cooperate either.


[1] https://www.youtube.com/watch?v=EiOglTERPEo
[2] https://rhettinger.wordpress.com/2011/05/26/super-considered-super/

--
components: Library (Lib)
files: inj.py
messages: 247136
nosy: eric.frederich, eric.snow, rhettinger
priority: normal
severity: normal
status: open
title: collections.OrderedDict collaborative subclassing
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file39982/inj.py

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

 you have to provide a benchmark

Actually, I don't.  When making a small series of changes, benchmarking every 
step is waste of time and tends to trap you in local minimums and causes you to 
overfit to a particular processor, compiler, or benchmark.  The better process 
is to carefully work through what the code is telling the machine to do and 
evaluating whether those steps make sense.  This is done in conjunction with 
organizing the code in a more logical manner (i.e. only saving the so-table in 
the block where we're using it as a check to check if the rich comparison 
rearranged the table in a way the invalidated the entry pointer or made the 
current search invalid).  In general, less work is better, having related 
actions take place close together is better, making functions self-contained is 
better, etc.

If you want to team-up and help, your contribution is welcome.  General sniping 
isn't helpful at all.  I wrote all of this code and have maintained it for 13 
years -- this series of refactorings has been something I've been working 
towards for a long time.

--

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



[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2015-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eefc157b3096 by Robert Collins in branch '3.4':
Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.
https://hg.python.org/cpython/rev/eefc157b3096

New changeset 10f5a7fa26d5 by Robert Collins in branch '3.5':
Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.
https://hg.python.org/cpython/rev/10f5a7fa26d5

New changeset 45bd2dadbd0d by Robert Collins in branch 'default':
Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.
https://hg.python.org/cpython/rev/45bd2dadbd0d

--
nosy: +python-dev

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread Eric Snow

Eric Snow added the comment:

Thanks for the clear explanation, Raymond.  The approach you've described is 
useful in a number of circumstances.  Would you mind publishing (somewhere 
outside the tracker; devguide?) the specific steps you take and the tools you 
use?

--
nosy: +eric.snow

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



[issue13938] 2to3 fails to convert types.StringTypes appropriately

2015-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ce34c78ebf65 by Robert Collins in branch '2.7':
Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond.
https://hg.python.org/cpython/rev/ce34c78ebf65

--

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



[issue13938] 2to3 fails to convert types.StringTypes appropriately

2015-07-22 Thread Robert Collins

Robert Collins added the comment:

So, I don't think I've ever done 2.x stuff with hg here, I'll leave this open 
till I've looked up the docs and applied it safely.


... unless you'd like to do the 2.7 application ? :)

--

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



[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2015-07-22 Thread Robert Collins

Changes by Robert Collins robe...@robertcollins.net:


--
resolution:  - fixed
stage: commit review - resolved
status: open - closed
versions: +Python 3.6 -Python 2.7

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



[issue13938] 2to3 fails to convert types.StringTypes appropriately

2015-07-22 Thread R. David Murray

R. David Murray added the comment:

Well, it's a patch to 2to3, which I'm assuming is sometimes (often?) run using 
2.7 to convert code to run under python3.

I personally don't use transplant in cases like this, I just apply the patch 
independently to the 2.7 branch.  That may just be because I've never used 
transplant, but we are treating the two branches as independent and I don't 
want to screw that up :)

--

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



[issue9232] Allow trailing comma in any function argument list.

2015-07-22 Thread Robert Collins

Robert Collins added the comment:

FWIW I would like to see this, but I think it does need a PEP given the 
contention so far. For that, we need a BDFL delegate AIUI.

--
nosy: +rbcollins
versions: +Python 3.6 -Python 3.5

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



[issue20337] bdist_rpm should support %config(noreplace)

2015-07-22 Thread Alexandr Normuradov

Changes by Alexandr Normuradov anormura...@isilon.com:


--
nosy: +anormuradov

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



[issue24667] OrderedDict.popitem()/__str__() raises KeyError

2015-07-22 Thread Eric Snow

Eric Snow added the comment:

That worked.  I'll take a close look at what's going on as soon as I can.

--

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



[issue24684] Type confusion in socket module

2015-07-22 Thread paul

New submission from paul:

eck(idna));
# (gdb) 
# 
# Program received signal SIGABRT, Aborted.
# 0xb77a6d4c in __kernel_vsyscall ()
# 
# host argument can be set to a subclass of unicode with a custom encode 
# method. encode returns unexpected type. assert is not compiled in release
# mode, so this will lead to a type confusion later on.

--
files: poc_getaddr.py
messages: 247094
nosy: pkt
priority: normal
severity: normal
status: open
title: Type confusion in socket module
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file39974/poc_getaddr.py

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



[issue24683] Type confusion in json encoding

2015-07-22 Thread STINNER Victor

STINNER Victor added the comment:

I don't understand the issue. Can you elaborate?

What is your code? What is the current result? What is the expected result? 
What is your platform? What is your Python version? etc.

--
nosy: +haypo

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



[issue24683] Type confusion in json encoding

2015-07-22 Thread paul

paul added the comment:

Sorry, I uploaded a test case.

--

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



[issue24684] socket.getaddrinfo(host) doesn't ensure that host.encode() returns a byte string

2015-07-22 Thread paul

paul added the comment:

@haypo:
I'd be happy to implement all my fuzzer ideas if my bugs were patched in a 
timely manner.

At this moment I have multiple bugs submitted over 2 months ago, which still 
aren't patched. Without patches, hackerone won't accept these issues, so my 
incentive to work on python is removed.

--

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



[issue24684] socket.getaddrinfo(host) doesn't ensure that host.encode() returns a byte string

2015-07-22 Thread STINNER Victor

STINNER Victor added the comment:

5513idna = _PyObject_CallMethodId(hobj, PyId_encode, s, idna);
5514if (!idna)
5515return NULL;
5516assert(PyBytes_Check(idna));

The assertion fails because the custom string type in poc_getaddr.py returns an 
integer, not a byte string.

IMHO we should call PyUnicode_AsEncodedObject() instead of calling the encode() 
method.

--
nosy: +haypo
title: Type confusion in socket module - socket.getaddrinfo(host) doesn't 
ensure that host.encode() returns a byte string
versions: +Python 3.4, Python 3.6

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



[issue24682] Add Quick Start: Communications section to devguide

2015-07-22 Thread Ezio Melotti

Ezio Melotti added the comment:

I would also like to see a short section (perhaps in the form of a FAQ) that 
could be linked whenever someone asks for Python help on 
python-dev/python-ideas, or proposes an idea on python-dev, or misuses the 
lists in a similar fashion.
These could then be linked with a short message such as Python-dev is about 
the development of CPython, not for general Python help. See 
devguide/communication.html#faq-asking-for-general-python-help.
As for the Quick Start I'm not exactly sure what you want to put in it, but 
I'm not sure whether it should be added alongside the main quick start and if 
it should be called a quick start (I don't think people ask themselves I want 
to communicate, where do I start?).
I think expanding /devguide/communication.html (and/or devguide/help.html), 
adding a list of guidelines at the top and description/faqs of the MLs should 
be enough.  A link in the main page (perhaps even in the coding quick start) 
could also be added.

--
stage:  - needs patch

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



[issue24684] socket.getaddrinfo(host) doesn't ensure that host.encode() returns a byte string

2015-07-22 Thread STINNER Victor

STINNER Victor added the comment:

@paul: are you fuzzing Python?

--

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread STINNER Victor

STINNER Victor added the comment:

Since it looks like an optimization, can you please provide a benchmark?

--
nosy: +haypo

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



[issue24683] Type confusion in json encoding

2015-07-22 Thread paul

New submission from paul:

on-35dm-i386-linux-gnu.so`encoder_listencode_list(s=0xb6f90394, acc=0xbfc42c28, 
seq=0xb6f2361c, indent_level=1) + 655 at _json.c:1800
# frame #2: 0xb6e4366d 
_json.cpython-35dm-i386-linux-gnu.so`encoder_listencode_obj(s=0xb6f90394, 
acc=0xbfc42c28, obj=0xb6f2361c, indent_level=1) + 733 at _json.c:1554
# frame #3: 0xb6e3fc4f 
_json.cpython-35dm-i386-linux-gnu.so`encoder_call(self=0xb6f90394, 
args=0xb7049304, kwds=0x) + 319 at _json.c:1386
# frame #4: 0x080c5758 python`PyObject_Call(func=0xb6f90394, 
arg=0xb7049304, kw=0x) + 264 at abstract.c:2149
# 
# This is a type confusion bug. encoder-markers can be initialized to an
# arbitrary object (string in this POC). PyDict_Contains trusts the caller that
# op is a dictionary without checking. Some callers can't be trusted :)

--
messages: 247093
nosy: pkt
priority: normal
severity: normal
status: open
title: Type confusion in json encoding
type: crash
versions: Python 3.5

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



[issue23883] __all__ lists are incomplete

2015-07-22 Thread Berker Peksag

Berker Peksag added the comment:

Thank you all for your work and apologies for my lack of response.

I'm +1 on adding a check__all__ helper to test.support. But passing self to 
it feels a bit weird. Perhaps the assertCountEqual part could be moved outside 
of the helper. If Serhiy(and/or other people) are happy with the current API, I 
am happy too :)

--

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



[issue24651] Mock.assert* API is in user namespace

2015-07-22 Thread Michael Foord

Michael Foord added the comment:

I'm not wild about this idea. The problem with the assert methods has 
*essentially* been solved now, so I'm not convinced of the need for this change 
(unless users really *need* to have their own mocked attributes like 
assert_called_with which I think is highly unlikely).

Part of the genius of mock was providing a flexible mock object that also 
encapsulated simple methods for introspecting/asserting how it has been used. 
Changing to require users to import/know about a whole host of separate 
functions doesn't feel like an improvement to me. That's aside from the whole 
breaking people's code for no tangible benefit issue.

I acknowledge that other people, Carl for example, have different opinions - 
but from talking to many, many mock users over the years I think that those 
with the philosophically purist approach are in a minority to those who 
appreciate the more practical approach that mock takes.

--

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

You can benchmark if you want.  I'm looking for a second pair of eyes to 
validate the correctness.  My goal is to put the tests and assignments in the 
most logical order.

--

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



[issue24619] async/await parser issues

2015-07-22 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


--
status: open - closed

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



[issue24619] async/await parser issues

2015-07-22 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


--
stage: patch review - resolved

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



[issue24683] Type confusion in json encoding

2015-07-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee:  - serhiy.storchaka
components: +Extension Modules
nosy: +serhiy.storchaka
stage:  - needs patch

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



[issue24619] async/await parser issues

2015-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9da080ecadb2 by Yury Selivanov in branch '3.5':
Issue #24619: New approach for tokenizing async/await.
https://hg.python.org/cpython/rev/9da080ecadb2

New changeset 987b72921a0c by Yury Selivanov in branch 'default':
Merge 3.5 (Issue #24619)
https://hg.python.org/cpython/rev/987b72921a0c

--
nosy: +python-dev

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



[issue23883] __all__ lists are incomplete

2015-07-22 Thread Jacek Kołodziej

Changes by Jacek Kołodziej kolodzi...@gmail.com:


Added file: 
http://bugs.python.org/file39976/Issue23883_support_check__all__.v5.patch

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



[issue23883] __all__ lists are incomplete

2015-07-22 Thread Jacek Kołodziej

Jacek Kołodziej added the comment:

 raiseExecptions typo: Might be best to get the typo fixed first (maybe open a 
 separate issue, since it should probably be fixed starting from the 3.4 
 branch).

Done in #24678 and commited in 83b45ea19d00 .

 Regarding OpcodeInfo, it is probably up to your judgement.

Then I'll leave it as it was - without OpcodeInfo in pickletools.__all__ . The 
test for it remains in the patch, though.

--
Added file: http://bugs.python.org/file39977/Issue23883_all.v5.patch

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



[issue24667] OrderedDict.popitem()/__str__() raises KeyError

2015-07-22 Thread Fabian

Fabian added the comment:

Oh sorry, I basically never need to install pywikibot anew so it's easy to 
forget but there is a submodule in scripts/i18n which needs to be cloned as 
well. With the following commands I could reproduce the error (and you don't 
even need to install requests and six):

  $ git clone --recursive  g...@github.com:wikimedia/pywikibot-core.git test
  $ cd test/
  $ echo mylang='en'  user-config.py
  $ echo family='wikipedia'  user-config.py
  $ python setup.py test

With that you only need a network connection (as this error is in urllib3 I 
doubt it works without network connection) but you don't need any wiki account. 
If you want to test it with an account, execute “generate_user_files.py” 
before. Just as a note I've activated write and write failure tests but without 
an account these tests should not be run anyway.

--

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



[issue24619] async/await parser issues

2015-07-22 Thread Yury Selivanov

Yury Selivanov added the comment:

Thanks Nick!  I've committed the patch with a few more unittests and a couple 
of additional comments in tokenizer.(c|h).

--
resolution:  - fixed

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



[issue22140] python-config --includes returns a wrong path (double prefix)

2015-07-22 Thread Romain Dossin

Romain Dossin added the comment:

I stumbled across the exact same problem and I have made a fix that is working, 
at least for the usage I have...

--
nosy: +rdossin
Added file: http://bugs.python.org/file39978/patch_python_sym_links.txt

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



[issue24646] Python accepts SSL certificate that should be rejected on OSX

2015-07-22 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The attached program (which is pure C except for a call to NSLog) calls 
SecTrustCopyAnchorCertificates in a child process (and with a minor change the 
other function as well).

This doesn't crash for me. 

However, that doesn't really mean anything: We know from earlier bugreports 
that calling _scproxy._get_proxy_settings in a child process can crash, and 
that is something that only sporadicly happens for me (I cannot reproduce it 
with a trivial script).

Maybe this is something that was fixed in 10.10, but I'd be surprised at that 
(and that doesn't really help us as we support older OSX releases as well). I 
cannot test on other OSX releases at the moment, I'm at europython and don't 
have access to my test systems.

--
Added file: http://bugs.python.org/file39979/ca-dump.m

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



[issue24682] Add Quick Start: Communications section to devguide

2015-07-22 Thread Carol Willing

Carol Willing added the comment:

Ezio, thanks for the suggestions :D 

To clarify, the new Quick Start will be: 
- brief; 
- contain links to additional communication/community interaction info in the 
devguide; 
- guide a new contributor (or remind others) to information about ways to 
communicate effectively to maximize productivity as a contributor.

My goal with the new Quick Start is to give new developers simple steps to 
onboard as constructive and productive contributors. Basically, key steps to 
onboarding such as: 1. mailing lists, 2. Issue tracker, 3. expectations, 4. 
questions.

After I take a close look at the entire devguide and related resources, I will 
upload a patch for the new Quick Start which should add clarity. We can iterate 
the patch as needed to make sure that the info is helpful and relevant for 
contributors.

--

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread R. David Murray

R. David Murray added the comment:

Victor, I'm hearing Raymond say that it isn't really about optimization, but 
about the logical organization of the code.  I think making things more 
*complicated* requires a benchmark justification, but it doesn't look to me 
like this change makes things more complicated (on the other hand I'm not 
*fluent* in C).

--
nosy: +r.david.murray

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-07-22 Thread Cyd Haselton

Cyd Haselton added the comment:

UPDATE:
Build environment is up and running; cloning repo now.

--

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch changes behavior. With the patch it would be possible that after 
successful set.add(), the item will be not contained in the set. And this 
behavior is not consistent with dict behavior.

--

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



[issue24683] Type confusion in json encoding

2015-07-22 Thread paul

Changes by paul paw...@gmail.com:


Added file: http://bugs.python.org/file39975/json_markers.py

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



[issue24667] OrderedDict.popitem()/__str__() raises KeyError

2015-07-22 Thread Fabian

Fabian added the comment:

Just as a note to the tests: You may not get the issues with OrderedDict as a 
failure/error at the end of the test suite. And you may (depending on the 
version) get a few errors because NoUsername was raised. That is unrelated to 
this issue and can be fixed by using a version after 6255530f has been merged.

--

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



[issue24683] Type confusion in json encoding

2015-07-22 Thread Ronald Oussoren

Ronald Oussoren added the comment:

In encoder_init (the __init__ for _json.Encoder) s-marker is set to an 
argument of __init__, without any kind of type check, it can therefore be an 
arbitrary object.

encoder_listencode_obj (and other functions) then use s-markers with the 
concrete API for dicts (such as PyDict_Contains). 

PyDict_Contains does not perform a type check, but casts its first argument to 
a PyDictObject and access fields. That causes problems when the marker isn't 
actually a dict.

I don't know the module good enough to be 100% sure about a fix, but I think it 
would be best to add a type check to encoder_init. 

BTW. As far as I know _json.make_encoder is a private API and shouldn't be used 
directly, when you use the public API the argument will always be a dict.

--
nosy: +ronaldoussoren

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread STINNER Victor

STINNER Victor added the comment:

 You can benchmark if you want.

No, you have to provide a benchmark if you want to modify the Python core to 
optimize it. Otherwise, modifying the code is pointless.

It's a general rule in Python to optimize code. We don't accept optimization 
changes if it has no effect on performances.

--

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



[issue24619] async/await parser issues

2015-07-22 Thread Yury Selivanov

Yury Selivanov added the comment:

 I'm just curious if the 'ctx' is still needed:  It looks like
 the outermost async def dominates all further nested scopes
 w.r.t the tokenizer mode, no matter whether they're def or
 async def scopes.

This is a wonderful idea, that's the way it should be done in
both tokenizer.c and tokenize.py.

Please see the new patch.  I love the simplicity of it, no 
more stacks or hard to follow code.

--
resolution: fixed - 
stage: resolved - patch review
status: closed - open
Added file: http://bugs.python.org/file39984/issue24619.3.patch

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



[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2015-07-22 Thread Robert Collins

Robert Collins added the comment:

Thanks for the update, it looks good to me. Applied to 3.4 and up. I'm not 
applying to 2.7 at this stage.

--

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



[issue13938] 2to3 fails to convert types.StringTypes appropriately

2015-07-22 Thread Robert Collins

Robert Collins added the comment:

Not clear to me either: I figured that after three years the relevance to 2.7 
was pretty low, but I can transplant it if you think thats relevant.

--

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



[issue13938] 2to3 fails to convert types.StringTypes appropriately

2015-07-22 Thread Robert Collins

Changes by Robert Collins robe...@robertcollins.net:


--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue24685] collections.OrderedDict collaborative subclassing

2015-07-22 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger
versions: +Python 3.6 -Python 2.7, Python 3.5

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



[issue16995] Add Base32 support for RFC4648 Extended Hex alphabet (patch attached)

2015-07-22 Thread Martin Panter

Martin Panter added the comment:

Matthäus, I think you uploaded the old patch again by accident. Also, see 
Berker’s old comments about documentation, and my new suggestions, on the 
Rietveld code review, if you haven’t already.

--
nosy: +vadmium

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



[issue22598] Add mUTF-7 codec (UTF-7 modified for IMAP)

2015-07-22 Thread Martin Panter

Martin Panter added the comment:

Not sure on the scope of this, but if someone wants to implement the 
incremental codec API, be aware that the existing UTF-7 codec, 
PyUnicode_DecodeUTF7Stateful() API, etc, does not actually support this 
properly. See Issue 20132, e.g. the test cases in 
https://bugs.python.org/issue20132#msg232850. I recommend against impementing 
an incremental or stream codec based only on a stateless codec.

--
nosy: +vadmium

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



[issue24685] collections.OrderedDict collaborative subclassing

2015-07-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This is an intentional design choice.  One reason for tightly coupling 
OrderedDict to dict was to preserve freedom for a C-implementation.  Another 
reason was for performance.  IIRC, using super() in __setitem__ slowed the OD 
from 10x slower than dicts to 20x.

Non-cooperative classes (of which Python has many) can be wrapped to make the 
classes cooperative.  The technique is discussed in the blog post 
https://rhettinger.wordpress.com/2011/05/26/super-considered-super/ .

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

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



[issue20132] Many incremental codecs don’t handle fragmented data

2015-07-22 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
dependencies: +Fix codecs.iterencode/decode() by allowing data parameter to be 
omitted, Stream encoder for zlib_codec doesn't use the incremental encoder, 
quopri module differences in quoted-printable text with whitespace, 
quopri_codec newline handling

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



[issue24682] Add Quick Start: Communications section to devguide

2015-07-22 Thread Stephen J. Turnbull

Stephen J. Turnbull added the comment:

If the mailing list code of conduct is to be fleshed out, Paul Moore's post is 
a good place to start IMO: 
https://mail.python.org/pipermail/python-dev/2015-July/140872.html.

--
nosy: +sjt

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



[issue24687] refleak on SyntaxError in function parameter annotation

2015-07-22 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I would prefer that compiler_visit_argannotation[s] be fixed to use the normal 
calling convention.

--

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



[issue24689] Add tips for effective online communication to devguide

2015-07-22 Thread Carol Willing

New submission from Carol Willing:

To keep the scope of issue24682 focused on the Quick Start sections of the 
devguide, I am creating this issue to add a new subsection 12.4 (Tips for 
effective online communication) to devguide/communication.

The following are suggestions for this new subsection:
* msg247161 email tips from python-dev post
* msg247162 content and links to mailman
* msg247096 suggestions for python-dev and python-ideas
* link to devguide/coredev#responsibilities
* link to devguide/faq#communications

--
components: Devguide
messages: 247165
nosy: brett.cannon, ezio.melotti, sjt, willingc
priority: normal
severity: normal
stage: needs patch
status: open
title: Add tips for effective online communication to devguide
type: enhancement

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



[issue23883] __all__ lists are incomplete

2015-07-22 Thread Martin Panter

Martin Panter added the comment:

Here is a brainstorm of alternatives that don’t require passing “self” into a 
helper function. But IMO the current proposal that does pass “self” is better.

* Passive expected_module_api() function, and manually check the return value. 
Precedent: support.detect_api_mismatch().

def test_all(self):  # In class test.test_tarfile.MiscTest
blacklist = {bltn_open, ...}
possible_exports = support.expected_module_api(tarfile, ignore=blacklist)
self.assertCountEqual(ftplib.__all__, possible_exports)

* ModuleApiTestBase class. Subclass it to use it:

class ExportsTest(support.ModuleApiTestBase):  # In module test.test_tarfile
module = tarfile
ignore = {bltn_open, ...}

* Raise AssertionError directly in case of failure. No automatic error message 
showing the different names though. Precedents: support.run_doctest(), 
.check_warnings(), script_helper.assert_python_ok(), _failure().

* Make a temporary internal TestCase instance:

def check__all__(module, etc):
expected = ...
...
TestCase().assertCountEqual(module.__all__, expected)

--

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



[issue24479] Support LMMS project files in mimetypes.guess_type

2015-07-22 Thread Nan Wu

Nan Wu added the comment:

Added a small patch. Pls let me know if anything missed.

--
nosy: +bytesflow
Added file: 
http://bugs.python.org/file39989/issue24479_support_mmp_and_mmpz_suffix_in_guess_type

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



[issue24682] Add Quick Start: Communications section to devguide

2015-07-22 Thread Stephen J. Turnbull

Stephen J. Turnbull added the comment:

I tend to disagree with Ezio about a FAQ for general questions.  A pointer to 
appropriate alternatives for off-topic posts in the Mailman listinfo 
descriptions of the various list (which can be copied into the devguide, or 
linked from there) will be sufficient for people who actually read such things 
before posting.

OTOH, once there already is a misdirected post, I feel it's appropriate to say 
This post is off-topic here because this list is for development of Python 
itself, not developing applications with Python.  Posts like yours are ignored  
by almost all participants.  You will get help (possibly better than you could 
get on this list) on pytho...@python.org.  Adding a pointer to a FAQ which 
just repeats the same thing is browbeating IMO.  It's not like we don't have 
several people who have macros to say the above (and more politely than I did) 
who typically respond within hours to off-topic posts.  What more could a FAQ 
say?  Of course this needs to be on-list so that the poster (who usually is a 
little feckless rather than deliberately abusive) doesn't get spammed, and so 
that the multiple volunteers who handle these posts don't duplicate each other.

I personally would like to see a guideline to participants that if they want to 
offer advice on the question itself to people, that they do so off-list.  
Whatever one's opinion on the utility of offering advice in response to an 
off-topic post, such advice is as off-topic as the question that elicits it.

--

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



[issue24688] Fix ast.get_docstring to support 'async def' functions

2015-07-22 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you, Benjamin.

--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue24688] Fix ast.get_docstring to support 'async def' functions

2015-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ecb13b9c4cd0 by Yury Selivanov in branch '3.5':
Issue #24688: ast.get_docstring() for 'async def' functions.
https://hg.python.org/cpython/rev/ecb13b9c4cd0

New changeset 5c8c88973709 by Yury Selivanov in branch 'default':
Merge 3.5 (Issue #24688)
https://hg.python.org/cpython/rev/5c8c88973709

--
nosy: +python-dev

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



[issue24688] Fix ast.get_docstring to support 'async def' functions

2015-07-22 Thread Benjamin Peterson

Benjamin Peterson added the comment:

lgtm

--

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



[issue24682] Add Quick Start: Communications section to devguide

2015-07-22 Thread Carol Willing

Carol Willing added the comment:

Thanks Stephen for the additional links and suggestions.

I would like to keep this issue focused on the Quick Start section added in the 
patch. 

I've opened Issue24689 to focus on tips for effective online communication. 
I have referenced the comments here and suggested an approach in the issue.

I want to keep momentum moving forward on improving the devguide and feel 
keeping issues well scoped will help us do that. If someone has the time to 
review this patch, I would appreciate the help. Thanks!

--
keywords: +needs review -patch

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



[issue24688] Fix ast.get_docstring to support 'async def' functions

2015-07-22 Thread Yury Selivanov

New submission from Yury Selivanov:

Please see the attached patch.

--
components: Library (Lib)
files: compile.patch
keywords: patch
messages: 247154
nosy: benjamin.peterson, georg.brandl, yselivanov
priority: high
severity: normal
stage: patch review
status: open
title: Fix ast.get_docstring to support 'async def' functions
type: enhancement
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39986/compile.patch

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



[issue24687] refleak on SyntaxError in function parameter annotation

2015-07-22 Thread Yury Selivanov

New submission from Yury Selivanov:

A simple way of reproducing the issue is to try to compile the following piece 
of code with refleaks check mode on:

   def foo(a:(yield)): pass

Since '(yield)' expression is outside of a function, it will trigger a 
SyntaxError.

There is a subtle bug in compile.c though, specifically in 
compiler_visit_argannotation method; it should return -1 in case of error, but 
the VISIT macro it uses returns 0 on errors.

Attached patch uses 'compiler_visit_expr' directly returning correct error code.

--
components: Interpreter Core
files: compile.patch
keywords: patch
messages: 247153
nosy: benjamin.peterson, ncoghlan, yselivanov
priority: high
severity: normal
stage: patch review
status: open
title: refleak on SyntaxError in function parameter annotation
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39985/compile.patch

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



[issue24688] Fix ast.get_docstring to support 'async def' functions

2015-07-22 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


Removed file: http://bugs.python.org/file39986/compile.patch

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



[issue24688] Fix ast.get_docstring to support 'async def' functions

2015-07-22 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


Added file: http://bugs.python.org/file39987/ast.patch

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread STINNER Victor

STINNER Victor added the comment:

For me, optimizing assembler is still an optimization. I give up, I just don't 
care of set performances.

--

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



[issue24681] Put most likely test first in set_add_entry()

2015-07-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

If PyObject_RichCompareBool() reports that a key is already present in the set, 
then set_add_entry() is under no further obligation to make an insertion.   As 
long as there is no risk of segfault, there is no more obligation to cater to 
lying or self-destructing __eq__ methods than there is to support objects that 
return randomized __hash__ values. 

The docs for set.add(...):  Add an element to a set. This has no effect if the 
element is already present.  The latter condition is determined by the 
PyObject_RichCompareBool() check.  If it reports a match, then it is reasonable 
to do nothing.

FWIW, dicts don't have a choice in this regard because they still have an 
implementation that depends on returning a currently valid entry which they 
can't do if the table is mutating during the search.  The set_add_entry() 
implementation has the advantage in that it is self-contained and need only 
report -1 is an error arose during the comparison or a 0 to indicate that no 
error arose.  Also, note that sets diverged from dicts that the outset in that 
they don't swallow exceptions like PyDict_GetItem() does.

--

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



[issue24682] Add Quick Start: Communications section to devguide

2015-07-22 Thread Carol Willing

Carol Willing added the comment:

Here's the patch for adding the `Quick Start: Community workflow` section to 
the devguide.

I made a few other minor edits to the index page (replacing beginner/advanced 
wording for starter/additional) since docs and testing are important. While 
docs and testing are great starting points for new developers, docs and testing 
have their own advanced nuances as well. :D

Ezio, Thanks for the earlier suggestions. Please do make any additional 
suggestions to improve this patch. I wanted to get it up so you had a better 
sense of my approach.

I expect that there will be other devguide changes to come after this. Perhaps 
as Ezio suggested a more detailed mailing list section in help.rst, but I think 
that those can be addressed in a separate issue.

Thanks!

--
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file39988/iss24682.patch

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



[issue21750] mock_open data is visible only once for the life of the class

2015-07-22 Thread Paul Koning

Paul Koning added the comment:

I suppose.  And it certainly is much better than the original behavior.  But if 
this is the approach chosen, it should be clearly called out  in the 
documentation, because the current wording suggests the 1.1.4 behavior, not the 
one you recommended.

--

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



[issue6087] distutils.sysconfig.get_python_lib gives surprising result when used with a Python build

2015-07-22 Thread Robert Collins

Robert Collins added the comment:

Moving this back to patch review since I'm 90% sure that the patch won't apply 
anymore (if I had a little more time I'd pull it down and double check) - but 
I've hit this myself and would totally commit it if updated.

--
nosy: +rbcollins
stage: commit review - patch review
versions: +Python 3.6

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



[issue21750] mock_open data is visible only once for the life of the class

2015-07-22 Thread Robert Collins

Robert Collins added the comment:

Which part of the docs specifically?

--

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2015-07-22 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Indeed, read(2) has the same problem. I just tested this with a small C 
program. 

I'll rework the patch for this, and will work on patches for 3.4/3.5 and 2.7 as 
well.

--

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



[issue24619] async/await parser issues

2015-07-22 Thread Stefan Krah

Stefan Krah added the comment:

This is a very nice solution!

I'm just curious if the 'ctx' is still needed:  It looks like
the outermost async def dominates all further nested scopes
w.r.t the tokenizer mode, no matter whether they're def or
async def scopes.

IOW, a single indent_level variable that follows all INDENTs/DEDENTs
once the outermost async def scope is entered might be sufficient.


[This is in no way urgent, please do not feel obliged to respond
during your holiday.]

--

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



[issue20585] urllib2 unrelease KQUEUE on Mac OSX 10.9+

2015-07-22 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I don't think it is possible to fix this crash other than by removing the use 
of _scproxy (proxy autodection on OSX) completely.

Problem is that Apple's higher level APIs (such as those used in _scproxy) 
don't take the use-case of calling fork(2), but not exec(2), to create child 
processes into account. 

BTW. I'm against removing _scproxy because that makes platform integration 
worse.

I guess this should be documented somewhere, and possibly just in the 
documentation for os.fork() with a warning about not using just fork on OSX 
when there's any chance that some C extension you use calls into a higher level 
API.

BTW. I could reproduce the crash on 10.9, but failed to do so on 10.10 earlier 
today (but that might just mean I have to try harder...)

--

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



[issue8585] zipimporter.find_module is untested

2015-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ef5c5a2bbd48 by Robert Collins in branch 'default':
Issue #8585: improved tests for zipimporter2. Patch from Mark Lawrence.
https://hg.python.org/cpython/rev/ef5c5a2bbd48

--
nosy: +python-dev

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



[issue8585] zipimporter.find_module is untested

2015-07-22 Thread Robert Collins

Robert Collins added the comment:

Applied to 3.6 only.

--
nosy: +rbcollins
resolution:  - fixed
stage: commit review - resolved
status: open - closed
versions: +Python 3.6 -Python 3.5

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



[issue24619] async/await parser issues

2015-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e4e01488afff by Yury Selivanov in branch '3.5':
Issue #24619: More tests; fix nits in compiler.c
https://hg.python.org/cpython/rev/e4e01488afff

New changeset 6f4e0c462daf by Yury Selivanov in branch 'default':
Merge 3.5 (Issue #24619)
https://hg.python.org/cpython/rev/6f4e0c462daf

--

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