[issue7434] general pprint rewrite

2016-12-14 Thread Andreas Stenberg

Changes by Andreas Stenberg :


--
nosy: +astenberg

___
Python tracker 

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



[issue28689] OpenSSL 1.1.0c test failures

2016-12-14 Thread Matthias Klose

Matthias Klose added the comment:

Fyi, Debian's 1.1.0c is fixed, so please don't blacklist this version in 
general.

--
nosy: +doko

___
Python tracker 

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



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-14 Thread Manish Singh

Changes by Manish Singh :


--
nosy: +loewis

___
Python tracker 

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



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-14 Thread Manish Singh

Manish Singh added the comment:

Hi loewis,

Can you please look into this issue

--

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-12-14 Thread Wenzel Jakob

Wenzel Jakob added the comment:

Hi,

pybind11 (https://github.com/pybind/pybind11) dev here.

We're seeing massive memory increases due to this bug, which completely break 
our test suite (and likely any use of this library, which is commonly used to 
bind C++ code to Python).

Please look at the following issue ticket:

https://github.com/pybind/pybind11/issues/558

where RSS goes to 43MB to 4.3GB for the basic set of tests. The fancy fancy 
test suite which also covers NumPy/SciPy can't even be run anymore. All issues 
disappear when the dict patch listed here is applied.

We're really concerned that this is not slated to be fixed for 3.6.0. Pybind11 
is not doing anything particularly special with dicts -- if this is hitting us, 
others will likely have issues as well.

-Wenzel

--
nosy: +wenzel

___
Python tracker 

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, it was what the patch did by setting tp_new to slot_tp_new. The problem is 
that the same code is used for inherited __new__ and assigned in class body. It 
is hard to distinguish between these cases.

In any case I think that Cython shouldn't generate trivial __new__. This will 
help to change the order of __new__ resolution at least in 3.7.

--
nosy: +scoder

___
Python tracker 

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



[issue28180] sys.getfilesystemencoding() should default to utf-8

2016-12-14 Thread Nick Coghlan

Nick Coghlan added the comment:

Downstream Fedora issue proposing the above idea for F26: 
https://bugzilla.redhat.com/show_bug.cgi?id=1404918

I've also attached the patch from that issue here.

--
keywords: +patch
Added file: http://bugs.python.org/file45907/fedora-cpython-force-c-utf-8.diff

___
Python tracker 

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



[issue28971] nntplib is broken when responses are longer than _MAXLINE

2016-12-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +christian.heimes, serhiy.storchaka

___
Python tracker 

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread Benjamin Peterson

Benjamin Peterson added the comment:

BTW, at least for #25731, I think the right approach in the MI case is to 
synthesize a __new__ on the subclass that calls the solid base __new__.

--

___
Python tracker 

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



[issue18896] Remove namedtuple 255 arguments restriction

2016-12-14 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks.  The patch looks good.

--

___
Python tracker 

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



[issue28931] urllib ignores FTP 226 response, breaking further FTP requests

2016-12-14 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

Was fixed in c741ba9e37ef (3.2) . urllib gets around the ftplib issue by 
closing the session after each transfer.

--

___
Python tracker 

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



[issue28941] Update the link to Source Code in Python Docs from hg to github

2016-12-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Please let me know if I'm doing this right :) Thanks.

--

___
Python tracker 

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



[issue28941] Update the link to Source Code in Python Docs from hg to github

2016-12-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Patch for 2.7 branch.

The url will change from
https://hg.python.org/cpython/file/2.7/Lib/abc.py

into
https://github.com/python/cpython/blob/2.7/Lib/abc.py

--
Added file: http://bugs.python.org/file45906/issue28941v27.patch

___
Python tracker 

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



[issue28941] Update the link to Source Code in Python Docs from hg to github

2016-12-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Patch for 3.5 branch.

The url will change from
https://hg.python.org/cpython/file/3.5/Lib/abc.py

into
https://github.com/python/cpython/blob/3.5/Lib/abc.py

--
Added file: http://bugs.python.org/file45905/issue28941v35.patch

___
Python tracker 

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



[issue28941] Update the link to Source Code in Python Docs from hg to github

2016-12-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Attached is the patch that will work for 3.6 and 3.7 branches.

The url will be changed from
https://hg.python.org/cpython/file/3.6/Lib/abc.py

into 
https://github.com/python/cpython/blob/3.6/Lib/abc.py for python version 3.6,
and 
https://github.com/python/cpython/blob/master/Lib/abc.py for python version 3.7

--
keywords: +patch
Added file: http://bugs.python.org/file45904/issue28941.patch

___
Python tracker 

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



[issue28971] nntplib is broken when responses are longer than _MAXLINE

2016-12-14 Thread Martin Panter

Martin Panter added the comment:

Just a quick note for the moment: It may not be wise to drop the limit to 
readline(). That is undoing Issue 16040. Maybe we need a better test if this 
change doesn't fail the test suite.

--

___
Python tracker 

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



[issue28961] unittest.mock._Call ignores `name` parameter

2016-12-14 Thread Jiajun Huang

Jiajun Huang added the comment:

I think we can write `_Call.__new__` as:

def __new__(cls, value=(), name='',...)

it's much simpler and readable.

--

___
Python tracker 

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



[issue28091] Document PEP 525

2016-12-14 Thread Eric Appelt

Eric Appelt added the comment:

Thanks for the explanations and example code in the review! Working on this 
issue is really helping to improve my understanding of a number of tricky 
things like finalization.

I *think* that I have all the comments implemented in the attached patch.

I also removed a spurious 2-line fragment at the top of the Asynchronous 
generator-iterator methods section that I had neglected to delete and escaped 
review.

--
Added file: http://bugs.python.org/file45903/pep525_pep530_docs_v2.patch

___
Python tracker 

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



[issue28976] incorrect description that dose not conform to the actual behavior

2016-12-14 Thread woo yoo

woo yoo added the comment:

Forget to attach the link 
https://docs.python.org/3/reference/compound_stmts.html#compound-statements

--

___
Python tracker 

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



[issue28976] incorrect description that dose not conform to the actual behavior

2016-12-14 Thread woo yoo

New submission from woo yoo:

The paragraph that describes the precedence of semicolon encounters a minor 
error, which said :
"Also note that the semicolon binds tighter than the colon in this context, so 
that in the following example, either all or none of the print() calls are 
executed:
if x < y < z: print(x); print(y); print(z)" 
However,the series of print function calls could execute partly if the previous 
ones are legal.

--
assignee: docs@python
components: Documentation
messages: 283232
nosy: docs@python, woo yoo
priority: normal
severity: normal
status: open
title: incorrect description that dose not conform to the actual 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



[issue28954] Incorrect EBNF rule of keywords_arguments

2016-12-14 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +martin.panter

___
Python tracker 

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



[issue28961] unittest.mock._Call ignores `name` parameter

2016-12-14 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Jiajun. The _Call class is tested in CallTest (located in 
Lib/unittest/test/testmock/testhelpers.py) Would it be possible to add a test 
case to make sure that we actually fixed the bug?

--
nosy: +berker.peksag
stage: commit review -> patch review

___
Python tracker 

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



[issue28944] A lack of line 6

2016-12-14 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report, woo woo.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue28944] A lack of line 6

2016-12-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a89469328b78 by Berker Peksag in branch '3.5':
Issue #28944: Fix footnote numbering
https://hg.python.org/cpython/rev/a89469328b78

New changeset 502f5d53fb4a by Berker Peksag in branch '3.6':
Issue #28944: Merge from 3.5
https://hg.python.org/cpython/rev/502f5d53fb4a

New changeset 13b600dc4ee5 by Berker Peksag in branch 'default':
Issue #28944: Merge from 3.6
https://hg.python.org/cpython/rev/13b600dc4ee5

--
nosy: +python-dev

___
Python tracker 

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



[issue28919] Simplify `_copy_func_details` in unittest.mock

2016-12-14 Thread Berker Peksag

Berker Peksag added the comment:

Thanks, Jiajun!

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



[issue28919] Simplify `_copy_func_details` in unittest.mock

2016-12-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bbdfde7958a8 by Berker Peksag in branch 'default':
Issue #28919: Simplify _copy_func_details() in unittest.mock
https://hg.python.org/cpython/rev/bbdfde7958a8

--
nosy: +python-dev

___
Python tracker 

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



[issue28971] nntplib is broken when responses are longer than _MAXLINE

2016-12-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> I found that there were three other mails raising this same  
> NNTPDataError('line too long') in the 40 last mails.

Cannot reproduce it. These three exceptions must have been NNTPProtocolError 
instead, caused by the initial NNTPDataError.

--

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-14 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ftplib
<...>
>>> ftp.sendcmd('NOOP')
'226 Directory send OK.'

There are no changes in and `ntransfercmd' between 2.7 and default branches 
save for cosmetic ones.

--

___
Python tracker 

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



[issue28975] os.walk generator giving inconsistent results

2016-12-14 Thread Colin David Chen

Colin David Chen added the comment:

Ah, you're correct. The behavior is consistent if you use strings in both 
invocations. The Path conversion strips the final '\\'. Doc examples do use the 
names of directories rather than a Path object.

I will close the issue. Thanks for the quick response!

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

___
Python tracker 

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



[issue28975] os.walk generator giving inconsistent results

2016-12-14 Thread Eric V. Smith

Eric V. Smith added the comment:

Assuming Path is pathlib.Path, this is equivalent to the difference between:

>>> list(os.walk('/tmp'))
[('/tmp', 

and:
>>> list(os.walk('/tmp/'))
[('/tmp/',  

Because:
>>> pathlib.Path('/tmp')
PosixPath('/tmp')
>>> pathlib.Path('/tmp/')
PosixPath('/tmp')

--

___
Python tracker 

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



[issue28975] os.walk generator giving inconsistent results

2016-12-14 Thread Eric V. Smith

Eric V. Smith added the comment:

Isn't the difference that you use os.walk(Path(source)) in the first example, 
and os.walk(source) in the second one?

--
nosy: +eric.smith

___
Python tracker 

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



[issue28975] os.walk generator giving inconsistent results

2016-12-14 Thread Colin David Chen

Changes by Colin David Chen :


--
title: os.walk generator vs -> os.walk generator giving inconsistent results

___
Python tracker 

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



[issue28975] os.walk generator vs

2016-12-14 Thread Colin David Chen

New submission from Colin David Chen:

os.walk in 3.6rc1 (Windows) appears to generate different output depending on 
its invocation.

In the first invocation, I use the generator to yield one result at a time:
source = "C:\\cdchen_data\\downloads\\python-xlib-0.18\\"
texasranger = os.walk(Path(source))
roottree = [next(texasranger)]
roottree[0][0]
Output:
'C:\\cdchen_data\\downloads\\python-xlib-0.18'

The same result occurs when using the generator in a for loop.

In the second invocation, I generate the complete list first:
sourcetree = [x for x in os.walk(source)]
sourcetree[0][0]

Output:
'C:\\cdchen_data\\downloads\\python-xlib-0.18\\'

The particular behavior causing me trouble is the omission in the first result 
of the final '\\'. I checked in 2.7.6 and os.walk is consistent and I believe 
more correct in that it will yield equivalent results and includes the '\\'.

Not sure if earlier Python 3 implementations have this problem, I couldn't get 
3.5 to run this function without failing.

--
components: Library (Lib)
messages: 283221
nosy: Colin David Chen
priority: normal
severity: normal
status: open
title: os.walk generator vs
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue28974] Make default __format__ be equivalent to __str__

2016-12-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Originally PEP 3101 defined the default __format__ implementation, 
object.__format__ as

 def __format__(self, format_spec):
 return format(str(self), format_spec)

After few changes (issue7994, issue28385) it now looks as

 def __format__(self, format_spec):
 assert format_spec == ''
 return format(str(self), '')

Proposed patch makes it yet simpler:

 def __format__(self, format_spec):
 assert format_spec == ''
 return str(self)

This is equivalent to the previous form except obscure case when str() returns 
not exact str, but strict subclass with overridden __format__.

The benefit of this change is simpler semantical model of the default 
implementation.

See the start of the discussion in issue28385 and the discussion on Python-Dev: 
https://mail.python.org/pipermail/python-dev/2016-October/146765.html.

--
components: Interpreter Core
files: simpler-object-__format__.patch
keywords: patch
messages: 283220
nosy: eric.smith, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Make default __format__ be equivalent to __str__
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45902/simpler-object-__format__.patch

___
Python tracker 

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



[issue28931] urllib ignores FTP 226 response, breaking further FTP requests

2016-12-14 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I can't reproduce the issue on Python 3.5 (but I can on 2.7).

--
nosy: +giampaolo.rodola
versions:  -Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28971] nntplib is broken when responses are longer than _MAXLINE

2016-12-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

When the server sends a line longer than _MAXLINE, nntplib reads only _MAXLINE 
+ 1 bytes leaving the remaining bytes left to be processed by the next command 
that will interpret those bytes as a protocol error. Hence the failing tests 
that follow the first NNTPDataError exception in the failing test_nntplib.

The patch increases _MAXLINE from 2048 to 4096 and fixes the above problem. It 
also takes care to read up to (and including) the terminator so that the 
following lines or the terminator is not interpreted as a protocol error by the 
next nntp command.

The patch does not include a test case.

--
keywords: +patch
stage:  -> patch review
title: nntplib fails on all buildbots -> nntplib is broken when responses are 
longer than _MAXLINE
versions: +Python 2.7
Added file: http://bugs.python.org/file45901/nntplib_maxline.patch

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-14 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

* The initial msg253326 has a code snippet using ftplib directly and showing 
the error.
* The linked issue28931 has another snippet that uses ftplib through urllib and 
results in the same error.

There isn't a single mention of "thread" in either.
Could you just run either of them and see for yourself?

I can rub your nose in it, but I thought you're better than that :)

Oh well...

C:\Ivan>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit 
Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ftplib
>>> ftp = ftplib.FTP()
>>> ftp.connect('ftp.debian.org', timeout=10)
'220 ftp.debian.org FTP server'
>>> ftp.login('anonymous','u...@example.com')
'230 Login successful.'
>>> ftp.sendcmd('TYPE A')
'200 Switching to ASCII mode.'
>>> s = ftp.transfercmd('LIST')
>>> fp = s.makefile('r')
>>> fp.read()
'drwxr-xr-x9 1176 1176 4096 Dec 14 15:08 debian\r\n'
>>> fp.close()
>>> s.close()
>>> # Now the session is broken:
...
>>> ftp.sendcmd('NOOP')
'226 Directory send OK.'
>>> ftp.dir()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Py\lib\ftplib.py", line 534, in dir
self.retrlines(cmd, func)
  File "C:\Py\lib\ftplib.py", line 437, in retrlines
conn = self.transfercmd(cmd)
  File "C:\Py\lib\ftplib.py", line 376, in transfercmd
return self.ntransfercmd(cmd, rest)[0]
  File "C:\Py\lib\ftplib.py", line 334, in ntransfercmd
host, port = self.makepasv()
  File "C:\Py\lib\ftplib.py", line 312, in makepasv
host, port = parse227(self.sendcmd('PASV'))
  File "C:\Py\lib\ftplib.py", line 830, in parse227
raise error_reply, resp
ftplib.error_reply: 200 Switching to ASCII mode.

--

___
Python tracker 

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



[issue18896] Remove namedtuple 255 arguments restriction

2016-12-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2016-12-14 Thread Aviv Palivoda

Aviv Palivoda added the comment:

As we talk here about stdin and stdout which we don't want to close I think 
this issue is irrelevant to python2. In any case the patch in issue #13824 
cover that problem.
I actually write a lot of small scripts and if I need to open the file in 
binary mode I don't use FileType because of this issue.
Any way I think this discussion is irrelevant because it does not seem like any 
core developer is currently working on argparse.

--

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-14 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Maybe it's me but I still fail to understand what's the issue here. From what I 
understand from the last message(s) it seems there is complaint about not being 
able to use ftplib with threads.
FTP is a "command - response" protocol which is designed to handle one request 
at a time, meaning you send a command then you are supposed to *wait* to get a 
response back. 
If you want to do multiple transfers in parallel then you need a separate 
connection, not a separate thread using the same connection.
ftplib should *not* be thread-safe because of how FTP works.

--

___
Python tracker 

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



[issue28849] do not define sys.implementation._multiarch on Android

2016-12-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ab3d870aa3bc by Xavier de Gaye in branch '3.6':
Issue #28849: Skip test_sysconfig.test_triplet_in_ext_suffix on non linux 
platforms.
https://hg.python.org/cpython/rev/ab3d870aa3bc

New changeset 0ff181ca7558 by Xavier de Gaye in branch 'default':
Issue #28849: Merge 3.6.
https://hg.python.org/cpython/rev/0ff181ca7558

--

___
Python tracker 

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



[issue28683] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-12-14 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2016-12-14 Thread paul j3

paul j3 added the comment:

The problem with Python2.7 is that 'open' does not take 'closefd', or any of 
the other parameters that were added for Python3.

open(name[, mode[, buffering]])

'rb' may make a difference on Py2 on Windows, but I haven't done any work in 
the environment in a long time.

I wasn't aware of that other issue.  Some core Python developers have 
participated in that one.  I suspect a lot of the discussion is beyond my level 
of expertise.

I once wrote that I thought 'FileType' was included primarily as an example of 
a 'type' factory.  Something users could copy and extend for their own use.  
Bethard corrected me, saying that it was meant for quick-n-dirty script uses, 
ones with an input file, output file and a few options.  In a bigger scripts, 
the users are encouraged to open/close files in 'with' contexts.

See http://bugs.python.org/issue22884 and the issues I reference there.

--

___
Python tracker 

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



[issue7434] general pprint rewrite

2016-12-14 Thread Louis Riviere

Louis Riviere added the comment:

I've made a Pretty Printer and I'd like to know if anybody thinks it could of 
some help here. (I do)

It's easily extensible and customizable to support any type in any way. 

https://github.com/louis-riviere-xyz/prettypy.git

--
nosy: +dugres

___
Python tracker 

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



[issue28871] Destructor of ElementTree.Element is recursive

2016-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch fixes the crash.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file45900/etree-trashcan.patch

___
Python tracker 

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2016-12-14 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Hi paul thanks for looking into this. First are you sure this is a bug in 
python 2? If so I will happily port this patch once it is reviewed.
As for use cases you may look at issue #26488. Although the patch was rejected 
you can see that I first used argparse.FileType and moved it because of this 
issue. I can't prove this patch is free of backward's compatibility issue's but 
there are tests now which should help to avoid problem.

--

___
Python tracker 

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
priority: release blocker -> normal

___
Python tracker 

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f89ef18f9824 by Serhiy Storchaka in branch '2.7':
Issue #5322: Restored tests for __new__.
https://hg.python.org/cpython/rev/f89ef18f9824

New changeset 06e4b9f2e4b0 by Serhiy Storchaka in branch '3.5':
Revert changeset 1f31bf3f76f5 (issue5322) except tests.
https://hg.python.org/cpython/rev/06e4b9f2e4b0

--

___
Python tracker 

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



[issue28971] nntplib fails on all buildbots

2016-12-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

BTW while searching for this problem, I found that there were three other mails 
raising this same  NNTPDataError('line too long') in the 40 last mails.

--

___
Python tracker 

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



[issue28965] Multiprocessing spawn/forkserver fails to pass Queues

2016-12-14 Thread Davin Potts

Changes by Davin Potts :


--
nosy: +davin
type: crash -> behavior

___
Python tracker 

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



[issue28971] nntplib fails on all buildbots

2016-12-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The problem is when getting an overview of the following comp.lang.python mail:
OT - "Soft" ESC key on the new MacBook Pro   Michael Torrie
Tue Dec 13 21:33:07 EST 2016

This is at index (last - 16) now and that is why the buildbots do not fail 
anymore.
The response received from the server for this mail in the _getline() function 
is 2058 bytes long and _getline() raises NNTPDataError because this is greater 
than _MAXLINE (2048). Setting _MAXLINE to 4096 fixes the problem.

There remains to explain the failures in the other tests.

--

___
Python tracker 

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



[issue28973] The fact that multiprocess.Queue uses serialization should be documented.

2016-12-14 Thread Davin Potts

Davin Potts added the comment:

All communication between processes in multiprocessing has consistently used 
pickle to serialize the data being communicated (this includes what is 
described in the "Shared memory" section of the docs).  The documentation has 
not done a great job of making this clear, instead only describing the 
requirement that data be pickleable in select places.  For example, in the 
section on Queues:
Note: When an object is put on a queue, the object is pickled and a
background thread later flushes the pickled data to an underlying pipe.

Though it only applies to 3.6+, issue28053 still needs its own documentation 
improvement to make clear that the mechanism for communicating data defaults to 
serialization by pickle but that this can be replaced by alternatives.

I agree that the documentation around the use of pickle in multiprocessing 
deserves improvement.

--
nosy: +davin
stage:  -> needs patch
type: behavior -> enhancement
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue28971] nntplib fails on all buildbots

2016-12-14 Thread Zachary Ware

Zachary Ware added the comment:

This appears to have been a transient failure; all builders are passing a 
forced build.  I'm no expert on nntplib, but I'm not sure there's much we can 
do here beyond replacing the outside connection with a mock server.  That 
pretty much defeats the purpose of the tests, though.

--

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

Ignore my previous comment, PyDict_GET_SIZE-3.patch LGTM.


> I don't think the changes in _datetimemodule.c and typeobject.c change the 
> behavior.

Oh wait, it seems like I misunderstood the new code.

Modules/_datetimemodule.c:

 dictptr = _PyObject_GetDictPtr(self);
-if (dictptr && *dictptr && PyDict_Size(*dictptr)) {
+if (dictptr && *dictptr &&
+(!PyDict_Check(*dictptr) || PyDict_GET_SIZE(*dictptr))) {
 state = *dictptr;

If *dictptr is set and is not a dict, the test is true for the old and new 
code. Hum, I misunderstood the new code: I understood that 
(!PyDict_Check(*dictptr) || PyDict_GET_SIZE(*dictptr)) is false is *dictptr is 
not a dict, but it's true.

Hum, the only difference is that the old code raises an exception 
(SystemError), the new code doesn't raise an exception.

Since I'm not able to create an object with a __dict__ attribute which is not a 
dict, I don't really case of the small behaviour change.

--

___
Python tracker 

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



[issue20754] Distribution.parse_config_files uses interpolation since Python 3

2016-12-14 Thread Jason R. Coombs

Jason R. Coombs added the comment:

I've created a backport implementation in 
https://github.com/pypa/setuptools/issues/889.

All that remains then is to have a test for Python, which can probably borrow 
from the fix for issue20120. I'll leave it to others to draft the patch for the 
test.

--

___
Python tracker 

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



[issue28963] Use-after-free in _asyncio_Future_remove_done_callback() of _asynciomodule.c

2016-12-14 Thread Ned Deily

Ned Deily added the comment:

This doesn't sound like a showstopper issue so I think it can wait for 3.6.1.

--

___
Python tracker 

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



[issue28963] Use-after-free in _asyncio_Future_remove_done_callback() of _asynciomodule.c

2016-12-14 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy:  -giampaolo.rodola

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't think the changes in _datetimemodule.c and typeobject.c change the 
behavior.

--

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

PyDict_GET_SIZE-3.patch: Except of the changes in _datetimemodule.c and 
typeobject.c on *dictptr type, the patch LGTM. I suggest to open a new issue 
for these two specific changes, since it changes the behaviour and it's a weird 
corner case unrelated to this issue.

--

___
Python tracker 

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



[issue28973] The fact that multiprocess.Queue uses serialization should be documented.

2016-12-14 Thread R. David Murray

R. David Murray added the comment:

Yeah, that's why I said "in the general case".  Making it clear in the overview 
seems reasonable to me.

--

___
Python tracker 

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



[issue28971] nntplib fails on all buildbots

2016-12-14 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +martin.panter

___
Python tracker 

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



[issue28973] The fact that multiprocess.Queue uses serialization should be documented.

2016-12-14 Thread Bernhard10

Bernhard10 added the comment:

My first thought was that Queue was implemented using shared memory.
I guess from the fact that the "Shared memory" section is separate in the 
multiprocessing documentation I should have known better, though.

So I guess some clarification in the documentation would be helpful.

--

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

I wrote a short script to check the size of dict:
---
import sys

def size(obj):
print(sys.getsizeof(obj))

size({})
size({i:i for i in range(3)})
size({i:i for i in range(10)})
size({i:i for i in range(100)})
---

On Linux x86_64, the sizes don't change with the patch:

240
240
368
4704

A size increase would be a regression, but it's not the case, so it's fine ;-)

--

___
Python tracker 

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



[issue28949] Stdlib modules disappear from file system

2016-12-14 Thread Jason R. Coombs

Jason R. Coombs added the comment:

I paused the Dropbox sync and ran the `rm -R .tox; tox` routine many times 
without incident, which strongly implicates Dropbox. I'm going to now re-enable 
Dropbox sync and see if I can trigger the behavior.

Now even with Dropbox updated back to the latest version (16.3.27) and 
performing the same operations I was two days ago, I've been unable to elicit 
the behavior. I've confirmed I still have access to delete those files that 
were being deleted, but yet I can't trigger the failure. Perhaps whatever 
environmental thing that happened on Monday was a fluke and I'll go back not to 
being bothered ever by this condition.

--

___
Python tracker 

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



[issue28973] The fact that multiprocess.Queue uses serialization should be documented.

2016-12-14 Thread R. David Murray

R. David Murray added the comment:

That fact that this is so is implicit in the name multi*process*ing and
the documented restrictions of the id function.  That is, it is the purpose of 
the module is to manage computation across multiple processes.  Since different 
processes have distinct memory spaces, you cannot depend on object identity 
between processes, by the definition of object identity (it is constant only 
for the lifetime of the object in memory, and the different processes have 
different memory spaces, therefore the object id may be different in the 
different processes).  By construction this applies also to any multiprocessing 
mechanism that is used to transmit objects, even if the transmission turns out 
to be to the same process in a particular case.  You can't *depend* on the id 
in that case, because the transmission mechanism must be free to change the 
object identity in order to work in the general case.

Should we document this explicitly?  Perhaps so.  Maybe in the multiprocessing 
introduction?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue20754] Distribution.parse_config_files uses interpolation since Python 3

2016-12-14 Thread Jason R. Coombs

Jason R. Coombs added the comment:

I reviewed the docs for configparser, and I agree - using 
ConfigParser(interpolation=None) is preferable to the "legacy" RawConfigParser.

--

___
Python tracker 

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



[issue28973] The fact that multiprocess.Queue uses serialization should be documented.

2016-12-14 Thread Bernhard10

Bernhard10 added the comment:

See http://stackoverflow.com/a/925241/5069869

Apparently multiprocessing.Queue uses pickle to serialize the objects in the 
queue, which explains the change of identity, but is absolutely unclear from 
the documentation.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
title: multiprocess.Queue changes objects identity -> The fact that 
multiprocess.Queue uses serialization should be documented.

___
Python tracker 

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



[issue28973] multiprocess.Queue changes objects identity

2016-12-14 Thread Bernhard10

New submission from Bernhard10:

When I did some tests involving unittest.mock.sentinel and 
multiprocessing.Queue, I noticed that multiprocessing.Queue changes the id of 
the sentinel.

This behaviour is definitely surprising and not documented.

--
files: mwe.py
messages: 283192
nosy: Bernhard10
priority: normal
severity: normal
status: open
title: multiprocess.Queue changes objects identity
type: behavior
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file45899/mwe.py

___
Python tracker 

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



[issue28960] Small typo in Thread.join docs

2016-12-14 Thread Ryan

Ryan added the comment:

Removing the comma instead of the double-dash

--
Added file: http://bugs.python.org/file45898/fixdoc2.patch

___
Python tracker 

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



[issue28961] unittest.mock._Call ignores `name` parameter

2016-12-14 Thread Emanuel Barry

Changes by Emanuel Barry :


--
stage: needs patch -> commit review

___
Python tracker 

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



[issue28972] Document all "python -m" utilities

2016-12-14 Thread Miki Tebeka

New submission from Miki Tebeka:

Several modules can be invoked with -m and are pretty handy (json.tool, 
zipfile, tarfile ...).

There should be a section in the documentation that groups all of these "python 
-m" tools together. Something like 
http://pythonwise.blogspot.nl/2015/01/python-m.html

--
assignee: docs@python
components: Documentation
messages: 283190
nosy: docs@python, tebeka
priority: normal
severity: normal
status: open
title: Document all "python -m" utilities
type: enhancement

___
Python tracker 

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



[issue28971] nntplib fails on all buildbots

2016-12-14 Thread Xavier de Gaye

New submission from Xavier de Gaye:

All the buildbots are currently failing at test_nntplib.
See the errors in attached test_nntplib.log.
The same error messages can be reproduced with a 3.5.2 interpreter:

$ python
Python 3.5.2 (default, Nov  7 2016, 11:31:36)
[GCC 6.2.1 20160830] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from nntplib import NNTP_SSL
>>> s = NNTP_SSL('nntp.aioe.org')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> resp, overviews = s.over((last - 1, last))  # does not 
>>> fail
>>> resp, overviews = s.over((last - 9, last))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/nntplib.py", line 831, in over
resp, lines = self._longcmdstring(cmd, file)
  File "/usr/lib/python3.5/nntplib.py", line 525, in _longcmdstring
resp, list = self._getlongresp(file)
  File "/usr/lib/python3.5/nntplib.py", line 494, in _getlongresp
line = self._getline()
  File "/usr/lib/python3.5/nntplib.py", line 434, in _getline
raise NNTPDataError('line too long')
nntplib.NNTPDataError: line too long
>>> resp, overviews = s.over((last - 1, last))  # fails now
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/nntplib.py", line 831, in over
resp, lines = self._longcmdstring(cmd, file)
  File "/usr/lib/python3.5/nntplib.py", line 525, in _longcmdstring
resp, list = self._getlongresp(file)
  File "/usr/lib/python3.5/nntplib.py", line 476, in _getlongresp
resp = self._getresp()
  File "/usr/lib/python3.5/nntplib.py", line 458, in _getresp
raise NNTPProtocolError(resp)
nntplib.NNTPProtocolError: 
a657tkkpsmkkozcp9rkpdchwanythhx4xfyllmw...@mail.gmail.com> 

[issue28970] ctypes.from_buffer counterpart to actively remove the mapping

2016-12-14 Thread Hans-Peter Jansen

New submission from Hans-Peter Jansen:

In an attempt of using ctypes.from_buffer() to map a structure to a memory 
mapped file, it is important to destroy the mapping after use, because the mmap 
won't be resizable or freeable correctly until then.

The best approach, I was able to came up with is using a context manager, but 
calling the dtor of the mapping in __exit__ is not enough, which results to 
code like this:

with StructMap(ctypes_struct, mm, offest) as smap:
smap.xxx = 'blabla'
del smap # necessary, but ugly

Without the del, the "with" variable still exist in the local context, hence 
the mapping still exist, until it is explicitly destroyed.

I hope, that ctypes is able to (or can be made to) actively remove the mapping 
in the __exit__ part of the context manager.

I've put some code on stackoverflow to play with this:

http://stackoverflow.com/questions/41077696/python-ctypes-from-buffer-mapping-with-context-manager-into-memory-mapped-file

The problem seems to exist with the linux mmap implementation only.

--
components: ctypes
messages: 283188
nosy: frispete
priority: normal
severity: normal
status: open
title: ctypes.from_buffer counterpart to actively remove the mapping
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-14 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file45896/callmethod-doc3.patch

___
Python tracker 

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



[issue28960] Small typo in Thread.join docs

2016-12-14 Thread Evan

Evan added the comment:

I think the patch should remove the comma, not the double dash. This is a 
parenthetical remark and should end the same way it starts.

See 
https://www.grammarly.com/handbook/punctuation/dash/2/dash-parenthetical-information/

--
nosy: +evan_

___
Python tracker 

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



[issue28683] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-12-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b65ae19bc42a by Xavier de Gaye in branch '3.6':
Issue #28683: Fix the tests that bind() a unix socket and raise PermissionError
https://hg.python.org/cpython/rev/b65ae19bc42a

New changeset 0350e0634a4b by Xavier de Gaye in branch 'default':
Issue #28683: Merge 3.6.
https://hg.python.org/cpython/rev/0350e0634a4b

--
nosy: +python-dev

___
Python tracker 

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



[issue28969] fnmatch is not threadsafe

2016-12-14 Thread Nicolas Savoire

New submission from Nicolas Savoire:

With python3.5, fnmatch appears not to be thrad safe. It fails with the 
following exception:

Traceback (most recent call last):
  File "test.py", line 18, in 
f.result()
  File "/opt/anaconda3/lib/python3.5/concurrent/futures/_base.py", line 405, in 
result
return self.__get_result()
  File "/opt/anaconda3/lib/python3.5/concurrent/futures/_base.py", line 357, in 
__get_result
raise self._exception
  File "/opt/anaconda3/lib/python3.5/concurrent/futures/thread.py", line 55, in 
run
result = self.fn(*self.args, **self.kwargs)
  File "test.py", line 12, in foo
fnmatch(ref, s)
  File "/opt/anaconda3/lib/python3.5/fnmatch.py", line 36, in fnmatch
return fnmatchcase(name, pat)
  File "/opt/anaconda3/lib/python3.5/fnmatch.py", line 70, in fnmatchcase
match = _compile_pattern(pat)
KeyError: ('SXJ8WZ9F7Z', )

Here is a minimal example reproducing the issue:

import concurrent.futures
from fnmatch import fnmatch
import random
import string

def str_generator(size=10, chars=string.ascii_uppercase + string.digits):
   return ''.join(random.choice(chars) for _ in range(size))


def foo(strs, ref):
for s in strs:
fnmatch(ref, s)

some_strings = [str_generator() for _ in range(500)]
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [executor.submit(foo, some_strings, some_strings[0]) for _ in 
range(8)]
for f in futures:
f.result()



$ python3 --version
Python 3.5.2 :: Anaconda 4.2.0 (64-bit)

--
components: Library (Lib)
files: test.py
messages: 283185
nosy: Nicolas Savoire
priority: normal
severity: normal
status: open
title: fnmatch is not threadsafe
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file45895/test.py

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2016-12-14 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
dependencies:  -setup.py: do not add system header locations when cross 
compiling

___
Python tracker 

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



[issue20211] setup.py: do not add system header locations when cross compiling

2016-12-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Same patch, but this one is properly set to be handled by Rietveld.

--
Added file: http://bugs.python.org/file45894/multiarch_2.patch

___
Python tracker 

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



[issue20211] setup.py: do not add system header locations when cross compiling

2016-12-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

>> this assumption is wrong for the multiarch case.
>
> Please explain why it is wrong.

Sadly no explanations have been given, we have to take Matthias word for it.
This new patch updates the add_multiarch_paths() method and includes LIBDIR and 
INCLUDEDIR in their corresponding search paths for the multiarch case.

--
assignee: xdegaye -> 
stage: commit review -> patch review
Added file: http://bugs.python.org/file45893/multiarch.patch

___
Python tracker 

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



[issue20211] setup.py: do not add system header locations when cross compiling

2016-12-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d1b400943483 by Xavier de Gaye in branch '3.6':
Issue #20211: Do not add the directory for installing C header files and
https://hg.python.org/cpython/rev/d1b400943483

New changeset fcc9f19fcc13 by Xavier de Gaye in branch 'default':
Issue #20211: Merge 3.6.
https://hg.python.org/cpython/rev/fcc9f19fcc13

--
nosy: +python-dev

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Victor's issue. _PyDict_GET_SIZE is renamed to 
PyDict_GET_SIZE and now it includes an assertion. This is good argument for 
introducing this macro against using PyDict_Size (without checking the result 
for error) and Py_SIZE (which doesn't check the type).

> Can someone check if it has an impact of the size of the structure (because 
> of the complex rules of alignment)?

There are special tests for that.

Actually I think that switching to PyObject_VAR_HEAD is different issue. The 
patch can be pushed without changes to dictobject.c and the structure of a dict.

--
Added file: http://bugs.python.org/file45892/PyDict_GET_SIZE-3.patch

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-14 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file45891/callmethod-doc2.patch

___
Python tracker 

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



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-14 Thread Manish Singh

New submission from Manish Singh:

I have used xml rpc library with transport http. My client and server are 
running on same host.

In normal load scenario(20% cpu usage, 80% memory usage, 18 GB memory free), 
some request of xml rpc client fails with connection reset by peer error. I 
have used xmlrpclib.ServerProxy() to call remote method on xml rpc server 
running on an empherial port.

This issue has happen many times.

log snippet,

  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1237, in request
errcode, errmsg, headers = h.getreply()
  File "/usr/lib64/python2.6/httplib.py", line 1064, in getreply
response = self._conn.getresponse()
  File "/usr/lib64/python2.6/httplib.py", line 990, in getresponse
response.begin()
  File "/usr/lib64/python2.6/httplib.py", line 391, in begin
version, status, reason = self._read_status()
  File "/usr/lib64/python2.6/httplib.py", line 349, in _read_status
line = self.fp.readline()
  File "/usr/lib64/python2.6/socket.py", line 433, in readline
data = recv(1)
error: [Errno 104] Connection reset by peer

--
components: Library (Lib)
messages: 283180
nosy: manu
priority: normal
severity: normal
status: open
title: xml rpc server fails with connection reset by peer error no 104
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-14 Thread INADA Naoki

Changes by INADA Naoki :


Removed file: http://bugs.python.org/file45890/callmethod-doc2.patch

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-14 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file45890/callmethod-doc2.patch

___
Python tracker 

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



[issue28963] Use-after-free in _asyncio_Future_remove_done_callback() of _asynciomodule.c

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

_asyncio_Future_remove_done_callback() is still wrong with  Issue28963.patch: 
what if an evil __eq__() methods inserts or remove directly items of the future 
callbacks list?

By design, it's not safe to iterate on a list if the body of the list calls 
arbitrary Python code.

(I don't know how exactly, but everything in Python is possible, see the gc 
module to retrieve private fields of a C objecct.)

--

___
Python tracker 

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

Since this change seems to break the backward compatibility, is it safe to 
apply it to Python 3.5.x and Python 3.6.x? The bug was reported in 2009, 7 
years ago. Can the fix wait for Python 3.7?

test_file contains code which worked well before the change and started to 
crash after the change. If it occurs for an application, I expect users to be 
unhappy of getting such "behaviour change" in a minor release, no?

--

Is it possible to prevent the crash of test_file without modifying its code 
(without the change 4a610bc8577b "Change order of io.UnsupportedOperation base 
classes")? Sorry, I didnd't follow this issue.

--

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

INADA Naoki: "My current idea is adding new `tp_fastcall` slot which has same 
signature to _PyFunction_FastCallDict or _PyCFunction_FastCallDict."

FYI I'm working on a solution to avoid tuple and dict to pass parameters to 
tp_new, tp_init and tp_call. I have PoC implementations (yeah, more than one). 
Please come to me directly if you are interested, this issue is not the right 
place to discuss.

--

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

> dict doesn't end with array.

Right, but...

Recently I looked at dict internals. As a newcomer, I have to confess that it's 
currently really hard to understand the purpose of each dict field: they are 
many "sizes": size of the hash table, number of usable entries, number of used 
entries, number of items in the dictionary, etc.

I like the idea of using the standard ob_size field (PyVarObject) to make it 
more explicitl that this field is the expected result of len(obj).

Technically, I don't know any function inside Python core which rely on the 
fact that object data is at the end of the main memory block.

Other builtin Python types:

* tuple: PyVarObject
* list: PyVarObject
* bytes: PyVarObject
* bytearray: PyVarObject
* memoryview: PyVarObject
* set: "used" field
* str: "length" field

The str type is super optimized for memory footprint, there are technical 
reasons for not used PyVarObject here, like backward compatibility.

It may make sense to modify PySetObject to use PyVarObject as well, but that's 
a different topic :-)

--

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

> Should we use Py_SIZE or _PyDict_GET_SIZE?

I prefer _PyDict_GET_SIZE() just to make the code more readable: it helps to 
repeat the type of variables.

Moreover, it can give you a free check on the type if you agree my suggestion 
to add an assertion into the macro directly.

Technically, it's already possible to use Py_SIZE() on lists and tuples, but 
PyTuple_GET_SIZE() and PyList_GET_SIZE() are used almost everywhere, again, for 
readability.

--

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

> It looks like the struct of a dict is already arranged in a way that it could 
> switch to PyObject_VAR_HEAD

Can someone check if it has an impact of the size of the structure (because of 
the complex rules of alignment)? If the structure has the same size, I'm in 
favor of using PyObject_VAR_HEAD.

I reviewed _PyDict_GET_SIZE-2.patch: I like the overall change, but I added 
many comments.

When changes are not direct replacement ma_used => _PyDict_GET_SIZE(), please 
push the changes in a separated commit when you will push the whole change (I'm 
thinking to a micro-optimization in ceval.c).

In typeobject.c, you added a check to test if *dictptr is a dict or not. This 
change seems strange to me. I'm not sure about the right behaviour here. You 
might open a separated issue for this change. I don't know if an exception 
should be raised or not.

And my comments on the macro itself:

Please add a tiny inline documentation:

   /* Get the number of items of a dictionary. */

I don't think that it's worth it to make the macro private, just name it 
PyDict_GET_SIZE(). The macro is not defined in the limited API, and we already 
expose like "everything" in the default API... No need to make the API harder 
to use. I was always surprised to have to check if the result if PyDict_Size() 
is negative and that no macro existed.

Your change is a large and so hard to review. I would be more confident if you 
add an assertion here, as done in crazy macros of unicodeobject.h:

   #define _PyDict_GET_SIZE(mp) (assert(PyDict_Check(mp),Py_SIZE(mp))

We can add such assertion since it's a new macro. I'm not sure that we can do 
it in existing macros like PyTuple_GET_SIZE(), since these macros may be abused 
to modify the size, not only get it.

--

___
Python tracker 

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



[issue28963] Use-after-free in _asyncio_Future_remove_done_callback() of _asynciomodule.c

2016-12-14 Thread Yury Selivanov

Yury Selivanov added the comment:

Inada-san, thanks for the review. You're right, we need to fix another 
edge-case.  I'll upload a new patch tomorrow.

Victor, fourth option we should go with is to commit the attached patch (with 
Inada-san review comment fixed).

I guess it's up to Ned if he want to cherry-pick the patch to Python 3.6.  I 
agree that the bug is very unlikely to appear in any real-world code.

--

___
Python tracker 

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



[issue28963] Use-after-free in _asyncio_Future_remove_done_callback() of _asynciomodule.c

2016-12-14 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Use-after-free in _asynciomodule.c -> Use-after-free in 
_asyncio_Future_remove_done_callback() of _asynciomodule.c

___
Python tracker 

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



[issue28963] Use-after-free in _asynciomodule.c

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

I see three options:

* avoid PyObject_RichCompareBool() which can run arbitrary Python code: this 
can be complicated since callbacks can be proxies, functools.partial, lambda, 
and other funny callable objects
* reimplement the same algorithm than the Python implementation: create a new 
list.
* do nothing: if you do weird things, it's your fault :-)

My favorite option is to work on a new list.

--

___
Python tracker 

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



[issue28963] Use-after-free in _asynciomodule.c

2016-12-14 Thread STINNER Victor

STINNER Victor added the comment:

> Oh, this is a release blocker. I'll take a look later today.

The bug requires to have an "evil" class which is unlikely in an application. I 
don't think that it's a release blocker.

--
priority: release blocker -> 

___
Python tracker 

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