[issue27341] mock.patch decorator fails silently on generators

2016-06-16 Thread Shoshana Berleant

New submission from Shoshana Berleant:

(at least in my case)

I committed two tests before I realized the tests were not being run: 
https://github.com/nipy/nipype/blob/abe7920a051f1570ccce4b71f26f50102d6e4e12/nipype/testing/tests/test_utils.py#L23

I realized this afternoon, while writing some more tests, that tests with the 
patch decorator were all reported as "OK", even when I wanted them to fail. 
Turns out they aren't being run at all.

I commented out all the yield statements, and the tests ran just as they should.

I don't know exactly what is going on here, but might raising an error or 
warning be good here?

Originally filed here: https://github.com/testing-cabal/mock/issues/366

--
components: Tests
messages: 268709
nosy: shoshber
priority: normal
severity: normal
status: open
title: mock.patch decorator fails silently on generators
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

Fixed conflicts with recent changes

--
versions: +Python 2.7 -Python 3.4
Added file: http://bugs.python.org/file43428/non-urlencoded.6.patch

___
Python tracker 

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



[issue23740] http.client request and send method have some datatype issues

2016-06-16 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +bytes-like objects with socket.sendall(), SSL, and http.client

___
Python tracker 

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



[issue27340] bytes-like objects with socket.sendall(), SSL, and http.client

2016-06-16 Thread Martin Panter

New submission from Martin Panter:

According to the documentation, HTTPSConnection.request() should accept 
arbitrary bytes-like objects, but this is not the case. Currently (since Issue 
23756), a “bytes-like object” is defined to be anything that works with 
Python’s buffer API, as long as it is C-contiguous. These objects can be passed 
to socket.sendall():

>>> byteslike = (ctypes.c_ubyte * 6).from_buffer_copy(b"DATA\r\n")
>>> s = socket.create_connection(("localhost", 80))
>>> s.sendall(byteslike)  # Server receives b"DATA\r\n"

This is not explicitly documented for socket objects. But since Issue 23539 
(3.4+), HTTPConnection.request() does document support for bytes-like objects:

>>> h = HTTPConnection("localhost", 80)
>>> # Send Content-Length: 6 and body b"DATA\r\n"
>>> h.request("POST", "/", body=byteslike)

On its own, there is no problem with Python relying on its own undocumented 
behaviour. But Python’s “ssl” module does not support arbitrary bytes-like 
objects, and as a result neither does HTTPSConnection:

>>> s = ssl.wrap_socket(socket.create_connection(("localhost", 443)))
>>> s.sendall(byteslike)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/ssl.py", line 886, in sendall
v = self.send(data[count:])
  File "/usr/lib/python3.5/ssl.py", line 856, in send
return self._sslobj.write(data)
  File "/usr/lib/python3.5/ssl.py", line 581, in write
return self._sslobj.write(data)
TypeError: a bytes-like object is required, not 'list'
>>> c = ssl.create_default_context(cafile="/lib/python3.5/test/keycert.pem")
>>> h = HTTPSConnection("localhost", 443, context=c)
>>> h.request("POST", "/", body=byteslike)
Traceback (most recent call last):
  File "/usr/lib/python3.5/http/client.py", line 885, in send
self.sock.sendall(data)
  File "/usr/lib/python3.5/ssl.py", line 886, in sendall
v = self.send(data[count:])
  File "/usr/lib/python3.5/ssl.py", line 856, in send
return self._sslobj.write(data)
  File "/usr/lib/python3.5/ssl.py", line 581, in write
return self._sslobj.write(data)
TypeError: a bytes-like object is required, not 'list'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/http/client.py", line 1083, in request
self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1128, in _send_request
self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1079, in endheaders
self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 913, in _send_output
self.send(message_body)
  File "/usr/lib/python3.5/http/client.py", line 892, in send
"or an iterable, got %r" % type(data))
TypeError: data should be a bytes-like object or an iterable, got 

This could be fixed in the implementation of SSLSocket.sendall(). But I am not 
sure if that is an appropriate change for 3.5. Another option would be to 
adjust the documentation of HTTP(S)Connection in 3.5, either not mentioning 
bytes-like objects at all, or clarifying that they don’t work with SSL.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 268707
nosy: docs@python, martin.panter
priority: normal
severity: normal
status: open
title: bytes-like objects with socket.sendall(), SSL, and http.client
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

FWIW I imagine Ubuntu overriding the option will break the example code in the 
documentation of clearing SSL_OP_NO_SSLv3: 
. If 
we keep that documentation, I think we should continue to test that clearing 
the option works, which conflicts with the proposed patch.

--

___
Python tracker 

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



[issue25724] SSLv3 test failure on Ubuntu 16.04 LTS

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

This patch was also posted to Issue 26867, with a bit more discussion and 
analysis, so closing as a duplicate.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> test_ssl test_options fails on ubuntu 16.04

___
Python tracker 

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



[issue14562] urllib2 maybe blocks too long with small chunks

2016-06-16 Thread Martin Panter

Changes by Martin Panter :


--
versions:  -Python 3.2

___
Python tracker 

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



[issue27335] Clarify that writing to locals() inside a class body is supported

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

I think my proposed patch for Issue 17546 addresses this. That patch was also 
written to address Issue 17960.

--
nosy: +martin.panter

___
Python tracker 

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




[issue27278] py_getrandom() uses an int for syscall() result

2016-06-16 Thread STINNER Victor

STINNER Victor added the comment:

> Adding a cast would solve this compiler warning:

I changed the code to use the long type. It should fix the warning, even if it 
was no more a real bug: the original bug was already fixed.

I close the issue, it's now solved.

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

___
Python tracker 

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



[issue27278] py_getrandom() uses an int for syscall() result

2016-06-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 193f50babfa4 by Victor Stinner in branch '3.5':
py_getrandom(): use long type for the syscall() result
https://hg.python.org/cpython/rev/193f50babfa4

--

___
Python tracker 

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



[issue27339] Security Issue: Typosquatting

2016-06-16 Thread STINNER Victor

STINNER Victor added the comment:

Hum, I guess that you are talking about https://pypi.python.org/pypi ? If yes, 
you should open an issue in their bug tracker:
https://bitbucket.org/pypa/pypi/issues

By the way, I don't see any obvious fix for typo squatting.

--
nosy: +haypo
resolution:  -> third party
status: open -> closed

___
Python tracker 

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



[issue26171] heap overflow in zipimporter module

2016-06-16 Thread Vlad K.

Vlad K. added the comment:

Here's the patch that I made for FreeBSD's Python 3.3 port. With this patch, on 
FreeBSD, Python 3.3 built fine and passed the zipimport related unit tests. 
It's basically the same code from 3.4, 3.5 and 2.7, just placed at appropriate 
place in the source.

--
versions:  -Python 3.3
Added file: 
http://bugs.python.org/file43427/patch-Modules_zipimport-CVE-2016-5636.c

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-06-16 Thread Michael Felt

Michael Felt added the comment:

updated patch for Python 2.7 (shall adopt and submit new patch for Python3 
based on this - next week)

used gnu diff to generate diff output.

Additional tests in util.py are for demo only, would expect them to be removed, 
however, the additional test in test/test_loading.py could remain.

--
Added file: http://bugs.python.org/file43426/Python2.Lib.ctypes.160611.patch

___
Python tracker 

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



[issue26171] heap overflow in zipimporter module

2016-06-16 Thread Ned Deily

Ned Deily added the comment:

reopening for 3.3.7 evaluation.  Georg?

--
nosy: +georg.brandl, ned.deily
priority: normal -> 
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
versions: +Python 3.3

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-06-16 Thread Michael Felt

Michael Felt added the comment:

The patch for Python2 - however, only now see the change in selections for 
version. Will need to redo/test Lib/ctypes/*.py in newer version.

Note also, the additional tests in util.py are for my testing - I do not expect 
them to stay, but I do want you aware of how I am testing - see also change in 
Lib/ctypes/test/test_loading.py

--

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-06-16 Thread Michael Felt

Michael Felt added the comment:

_aixutil.py to be paired with Python2.Lib.ctypes.16.06.11.patch

--
Added file: http://bugs.python.org/file43425/_aixutil.py

___
Python tracker 

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



[issue27336] --without-threads build fails due to undeclared _PyGILState_check_enabled

2016-06-16 Thread STINNER Victor

STINNER Victor added the comment:

issue27336.diff LGTM with a minor comment on the review.

--

___
Python tracker 

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



[issue27336] --without-threads build fails due to undeclared _PyGILState_check_enabled

2016-06-16 Thread STINNER Victor

STINNER Victor added the comment:

@Alex Willmer: Why do you build Python without threads?

--

___
Python tracker 

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



[issue26171] heap overflow in zipimporter module

2016-06-16 Thread Vlad K.

Vlad K. added the comment:

I believe this should be applied to Python 3.3 as well, since the same problem 
(unchecked data_size before adding +1 for bytes_size) exists there too, and is 
thus a security issue.

--
nosy: +vladk

___
Python tracker 

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



[issue27339] Security Issue: Typosquatting

2016-06-16 Thread YoSTEALTH

New submission from YoSTEALTH:

I read this new article that explains Typosquatting well: 
http://incolumitas.com/2016/06/08/typosquatting-package-managers/ making it 
known here so python developers can address this issue accordingly!

--
messages: 268692
nosy: YoSTEALTH
priority: normal
severity: normal
status: open
title: Security Issue: Typosquatting

___
Python tracker 

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



[issue27338] python 2.7 platform.system reports wrong on Mac OS X El Capitan

2016-06-16 Thread Audric D'Hoest (Dr. Pariolo)

Changes by Audric D'Hoest (Dr. Pariolo) :


--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue27338] python 2.7 platform.system reports wrong on Mac OS X El Capitan

2016-06-16 Thread Audric D'Hoest (Dr. Pariolo)

Audric D'Hoest (Dr. Pariolo) added the comment:

Hello Ned,

That is a brilliant answer!

After reporting this initially, I tried with 3.5.1, and uname... Convinced it 
was a 2.7.1, I could not be more wrong! What a stupid and confusing output does 
the OS report.

platform.mac_ver() does the trick!

thank you!

--

___
Python tracker 

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



[issue27336] --without-threads build fails due to undeclared _PyGILState_check_enabled

2016-06-16 Thread Berker Peksag

Berker Peksag added the comment:

The attached patch should fix this.

--
keywords: +patch
nosy: +berker.peksag
Added file: http://bugs.python.org/file43424/issue27336.diff

___
Python tracker 

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



[issue27336] --without-threads build fails due to undeclared _PyGILState_check_enabled

2016-06-16 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +haypo
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue27338] python 2.7 platform.system reports wrong on Mac OS X El Capitan

2016-06-16 Thread Ned Deily

Ned Deily added the comment:

Python's platform module has both platform-independent and platform-dependent 
functions as noted in its documentation.  While it isn't as clearly documented 
as perhaps it should be, on most "Unix-y" platforms, like OS X, much of the 
platform-independent system information comes from the same source as the 
platform's "uname" command.  You can see that, if you use platform.uname(), it 
matches the output of OS X's uname(1) command:

>>> platform.uname()
('Darwin', 'kitt.local', '15.5.0', 'Darwin Kernel Version 15.5.0: Tue Apr 19 
18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64', 'x86_64', 'i386')
>>> platform.system()
'Darwin'
>>> platform.release()
'15.5.0'

$ uname -a
Darwin kitt.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 
2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64

Somewhat confusingly, "Darwin" is how the OS X kernel identifies itself and 
"15.5.0" is the Darwin version number that corresponds to OS X 10.11.5.  And 
the uname output is what the platform module uses.

For OS X, the platform module does provide a Mac-specific function, 
platform.mac_ver.  From it, you can get the OS X version information, rather 
than the Darwin kernel information.

>>> platform.mac_ver()
('10.11.5', ('', '', ''), 'x86_64')

Suggestions on how to improve the documentation are welcome!  But changing the 
results from the platform-independent functions after all these years is not 
likely to happen.

https://docs.python.org/2.7/library/platform.html#cross-platform
https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history

--
nosy: +lemburg

___
Python tracker 

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



[issue27330] Possible leaks in ctypes

2016-06-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e04c054beb53 by Serhiy Storchaka in branch '2.7':
Issue #27330: Fixed possible leaks in the ctypes module.
https://hg.python.org/cpython/rev/e04c054beb53

New changeset 41f99ee19804 by Serhiy Storchaka in branch '3.5':
Issue #27330: Fixed possible leaks in the ctypes module.
https://hg.python.org/cpython/rev/41f99ee19804

New changeset 27e7945c4ecd by Serhiy Storchaka in branch 'default':
Issue #27330: Fixed possible leaks in the ctypes module.
https://hg.python.org/cpython/rev/27e7945c4ecd

--
nosy: +python-dev

___
Python tracker 

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



[issue27338] python 2.7 platform.system reports wrong on Mac OS X El Capitan

2016-06-16 Thread Audric D'Hoest (Dr. Pariolo)

Changes by Audric D'Hoest (Dr. Pariolo) :


--
title: python 2.7 platform.system reports wrong -> python 2.7 platform.system 
reports wrong on Mac OS X El Capitan

___
Python tracker 

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



[issue27338] python 2.7 platform.system reports wrong

2016-06-16 Thread Audric D'Hoest (Dr. Pariolo)

New submission from Audric D'Hoest (Dr. Pariolo):

Mac mini late 2014, upgraded to El capitan.

Out of the box python 2.7 reports the wrong system info.

platform.system() should report El Capitan
platform.release() should report 10.11.5

--
components: Macintosh
files: pybug.png
messages: 268687
nosy: Audric D'Hoest (Dr. Pariolo), ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: python 2.7 platform.system reports wrong
versions: Python 2.7
Added file: http://bugs.python.org/file43423/pybug.png

___
Python tracker 

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



[issue27337] 3.6.0a2 tarball has weird paths

2016-06-16 Thread Ned Deily

Changes by Ned Deily :


--
Removed message: http://bugs.python.org/msg268685

___
Python tracker 

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



[issue27337] 3.6.0a2 tarball has weird paths

2016-06-16 Thread Ned Deily

Ned Deily added the comment:

That's unfortunate and my fault, basically, the .tgz tarball was built with a 
BSD-ish tar while the .xz one was built with a GNU tar, as intended.  I hate to 
do a stealth update, unless absolutely necessary, and I don't get see any 
errors unpacking the .tgz one with a recent GNU tar.  Can you say with which 
version of tar and on what platform you see the tar failure?  I'll make sure it 
doesn't happen in subsequent releases.

--

___
Python tracker 

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



[issue27337] 3.6.0a2 tarball has weird paths

2016-06-16 Thread Ned Deily

Ned Deily added the comment:

That's unfortunate and my fault, basically, the .tgz tarball was built with a 
BSD-ish while the .xz one was built with GNU tar, as intended.  I hate to do a 
stealth update, unless absolutely necessary, and I don't get see any errors 
unpacking the .tgz one with a recent GNU tar.  Can you say with which version 
of tar and on what platform you see the tar failure?  I'll make sure it doesn't 
happen in subsequent releases.

--

___
Python tracker 

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



[issue27305] Crash with "pip list --outdated" on Windows 10 with Python 2.7.12rc1

2016-06-16 Thread Christoph Gohlke

Changes by Christoph Gohlke :


--
nosy: +cgohlke

___
Python tracker 

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



[issue27337] 3.6.0a2 tarball has weird paths

2016-06-16 Thread Ned Deily

Changes by Ned Deily :


--
assignee:  -> ned.deily
priority: normal -> high

___
Python tracker 

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



[issue27337] 3.6.0a2 tarball has weird paths

2016-06-16 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +ned.deily

___
Python tracker 

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



[issue27337] 3.6.0a2 tarball has weird paths

2016-06-16 Thread Peter Eisentraut

New submission from Peter Eisentraut:

The file Python-3.6.0a2.tgz contains paths that start with "..", e.g., 

$ tar tf Python-3.6.0a2.tgz | head
../Python-3.6.0a2/
../Python-3.6.0a2/Doc/
../Python-3.6.0a2/Grammar/
../Python-3.6.0a2/Include/
../Python-3.6.0a2/LICENSE
../Python-3.6.0a2/Lib/
../Python-3.6.0a2/Mac/
../Python-3.6.0a2/Makefile.pre.in
../Python-3.6.0a2/Misc/
../Python-3.6.0a2/Modules/

This causes tar to error out when unpacking the file.

This was not the case in previous tarballs and also not in 
Python-3.6.0a2.tar.xz.

--
components: Build
messages: 268684
nosy: petere
priority: normal
severity: normal
status: open
title: 3.6.0a2 tarball has weird paths
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



[issue27336] --without-threads build fails due to undeclared _PyGILState_check_enabled

2016-06-16 Thread Alex Willmer

New submission from Alex Willmer:

Building current tip (rev 102062:3d726dbfca31), on Ubuntu 16.04/x86_64, using 
--without-thread fails; with the following error
gcc -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes-Werror=declaration-after-statement   -I. -IInclude 
-I./Include-DPy_BUILD_CORE -o Python/pylifecycle.o Python/pylifecycle.c
Python/pylifecycle.c: In function ‘Py_NewInterpreter’:
Python/pylifecycle.c:751:5: error: ‘_PyGILState_check_enabled’ undeclared 
(first use in this function)
 _PyGILState_check_enabled = 0;
 ^
Python/pylifecycle.c:751:5: note: each undeclared identifier is reported only 
once for each function it appears in
Makefile:1575: recipe for target 'Python/pylifecycle.o' failed
make: *** [Python/pylifecycle.o] Error 1

I've attached the full build log.

--
components: Build
files: without-threads.build.log
messages: 268683
nosy: Alex.Willmer
priority: normal
severity: normal
status: open
title: --without-threads build fails due to undeclared _PyGILState_check_enabled
versions: Python 3.6
Added file: http://bugs.python.org/file43422/without-threads.build.log

___
Python tracker 

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



[issue27335] Clarify that writing to locals() inside a class body is supported

2016-06-16 Thread Steven D'Aprano

New submission from Steven D'Aprano:

The docs for locals() warn not to write to the dict returned, as it may not 
have the intended effect of modifying the actual variables seen by the 
interpreter.

https://docs.python.org/3/library/functions.html#locals

But as I understanding it, using locals() inside a class body is intentionally 
supported:

class K:
locals()['x'] = 1

assert K.x == 1

is not just an accident of implementation, but the intended behaviour and a 
language guarantee.

--
assignee: docs@python
components: Documentation
messages: 268682
nosy: docs@python, steven.daprano
priority: normal
severity: normal
status: open
title: Clarify that writing to locals() inside a class body is supported
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue24887] Sqlite3 has no option to provide open flags

2016-06-16 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> out of date
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



[issue27139] Increased test coverage for statistics.median_grouped

2016-06-16 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Thanks Julio,

I hope to get to this over the next week. Please feel free to prod me if 
you see no action by then.

--

___
Python tracker 

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



[issue27334] pysqlite3 context manager not performing rollback when a database is locked elsewhere for non-DML statements

2016-06-16 Thread Berker Peksag

Berker Peksag added the comment:

You may also want to check that the method_name is "commit". A test case would 
nice to have.

Note that the connection context manager will still fail cases like nested 
context managers. See issue 16958.

--
nosy: +berker.peksag, ghaering
stage:  -> patch review
type:  -> behavior
versions: +Python 3.5

___
Python tracker 

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



[issue27139] Increased test coverage for statistics.median_grouped

2016-06-16 Thread Julio C Cardoza

Julio C Cardoza added the comment:

Updated patch file to condense four functions into one function

--
Added file: http://bugs.python.org/file43421/test_median_grouped.patch

___
Python tracker 

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



[issue27334] pysqlite3 context manager not performing rollback when a database is locked elsewhere for non-DML statements

2016-06-16 Thread Luca Citi

New submission from Luca Citi:

I have reported this bug to the pysqlite module for python2 ( 
https://github.com/ghaering/pysqlite/issues/103 ) but I also report it here 
because it applies to python3 too.

The pysqlite3 context manager does not perform a rollback when a transaction 
fails because the database is locked by some other process performing non-DML 
statements (e.g. during the sqlite3 command line .dump method).

To reproduce the problem, open a terminal and run the following:

```bash
sqlite3 /tmp/test.db 'drop table person; create table person (id integer 
primary key, firstname varchar)'
echo -e 'begin transaction;\nselect * from person;\n.system sleep 
1000\nrollback;' | sqlite3 /tmp/test.db
```

Leave this shell running and run the python3 interpreter from a different 
shell, then type:

```python
import sqlite3
con = sqlite3.connect('/tmp/test.db')
with con:
con.execute("insert into person(firstname) values (?)", ("Jan",))
pass
```

You should receive the following:

```
  1 with con:
  2 con.execute("insert into person(firstname) values (?)", 
("Jan",))
> 3 pass
  4 

OperationalError: database is locked
```

Without exiting python, switch back to the first shell and kill the `'echo ... 
| sqlite3'` process. Then run:

```bash
sqlite3 /tmp/test.db .dump
```

you should get:

```
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
/ ERROR: (5) database is locked */
ROLLBACK; -- due to errors
```

This means that the python process never executed a `rollback` and is still 
holding the lock. To release the lock one can exit python (clearly, this is not 
the intended behaviour of the context manager).

I believe the reason for this problem is that the exception happened in the 
implicit `commit` that is run on exiting the context manager, rather than 
inside it. In fact the exception is in the `pass` line rather than in the 
`execute` line. This exception did not trigger a `rollback` because the it 
happened after `pysqlite_connection_exit` checks for exceptions.

The expected behaviour (pysqlite3 rolling back and releasing the lock) is 
recovered if the initial blocking process is a Data Modification Language (DML) 
statement, e.g.:

```bash
echo -e 'begin transaction; insert into person(firstname) values 
("James");\n.system sleep 1000\nrollback;' | sqlite3 /tmp/test.db
```

because this raises an exception at the `execute` time rather than at `commit` 
time.

To fix this problem, I think the `pysqlite_connection_exit` function in 
src/connection.c should handle the case when the commit itself raises an 
exception, and invoke a rollback. Please see patch attached.

--
components: Extension Modules
files: fix_pysqlite_connection_exit.patch
keywords: patch
messages: 268678
nosy: lciti
priority: normal
severity: normal
status: open
title: pysqlite3 context manager not performing rollback when a database is 
locked elsewhere for non-DML statements
versions: Python 3.6
Added file: http://bugs.python.org/file43420/fix_pysqlite_connection_exit.patch

___
Python tracker 

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



[issue27333] validate_step in rangeobject.c, incorrect code logic but right result

2016-06-16 Thread Xiang Zhang

Changes by Xiang Zhang :


--
components: +Interpreter Core
type:  -> behavior
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27333] validate_step in rangeobject.c, incorrect code logic but right result

2016-06-16 Thread Xiang Zhang

New submission from Xiang Zhang:

Here is a drawback in validate_step of rangeobject. PyNumber_AsSsize_t returns 
clipped value and won't set an exception when the argument *exc* is set NULL. 
So if step overflows, istep is always PY_SSIZE_MAX or PY_SSIZE_MIN. But the 
following code is to check if istep is -1 and there is an exception. The code 
actually conflicts. But fortunately the result is always right. I suggest to 
make the code logic right.

--
files: incorrect_logic_in_validate_step.patch
keywords: patch
messages: 268677
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: validate_step in rangeobject.c, incorrect code logic but right result
Added file: 
http://bugs.python.org/file43419/incorrect_logic_in_validate_step.patch

___
Python tracker 

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



[issue27332] Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef*

2016-06-16 Thread Petr Viktorin

New submission from Petr Viktorin:

Currently, Argument Clinic generates "PyModuleDef * module" for the first 
argument of module-level functions. But, the functions are passed the actual 
module object, not the ModuleDef.

The correct type to use is PyObject*, which is used for modules in the 
PyModule_* API.

(It turns out nothing in core Python currently uses the argument except passing 
it to other _impl functions, but this could change as PEP 489 is improved upon.)

The attached patch contains manual changes only. Please run `make clinic` after 
applying it to regenerate a the code.

--
components: Argument Clinic
files: 0001-clinic-Switch-the-module-argument-to-PyObject.patch
keywords: patch
messages: 268676
nosy: encukou, larry, ncoghlan
priority: normal
severity: normal
status: open
title: Clinic: first parameter for module-level functions should be PyObject*, 
not PyModuleDef*
versions: Python 3.6
Added file: 
http://bugs.python.org/file43418/0001-clinic-Switch-the-module-argument-to-PyObject.patch

___
Python tracker 

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



[issue26171] heap overflow in zipimporter module

2016-06-16 Thread STINNER Victor

Changes by STINNER Victor :


--
versions: +Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue27256] email header indentation destroyed

2016-06-16 Thread Hans-Peter Jansen

Hans-Peter Jansen added the comment:

Sorry guys for not providing this earlier.

It turned out, that the sub optimal behaviour is related to a unfortunate 
policy choice: email.policy.SMTP.

--
Added file: http://bugs.python.org/file43417/email_flatten.py

___
Python tracker 

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



[issue27257] get_addresses results in traceback with an addrspec with an empty local part.

2016-06-16 Thread Hans-Peter Jansen

Hans-Peter Jansen added the comment:

Sorry guys for not providing this earlier.

It turned out, that the sub optimal behaviour is related to a unfortunate 
policy choice: email.policy.SMTP.

--
Added file: http://bugs.python.org/file43416/email_flatten.py

___
Python tracker 

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



[issue27258] Exception in BytesGenerator.flatten

2016-06-16 Thread Hans-Peter Jansen

Hans-Peter Jansen added the comment:

Sorry guys for not providing this earlier.

It turned out, that the sub optimal behaviour is related to a unfortunate 
policy choice: email.policy.SMTP.

--
Added file: http://bugs.python.org/file43415/email_flatten.py

___
Python tracker 

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



[issue24424] xml.dom.minidom: performance issue with Node.insertBefore()

2016-06-16 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26985] Information about CodeType in inspect documentation is outdated

2016-06-16 Thread Xiang Zhang

Xiang Zhang added the comment:

Hmm, when I am going to delete the list in the docstring, I find other 
functions get lists too in inspect.py. So maybe we should open another issue to 
clean them after first merging this thread?

--

___
Python tracker 

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



[issue24424] xml.dom.minidom: performance issue with Node.insertBefore()

2016-06-16 Thread Robert Haschke

Robert Haschke added the comment:

Uploaded a "hg diff" against the recent 2.7 branch of the source repo.

--
Added file: http://bugs.python.org/file43414/minidom.insertBefore.patch

___
Python tracker 

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



[issue6057] sqlite3 error classes should be documented

2016-06-16 Thread Jaysinh shukla

Jaysinh shukla added the comment:

Adding forgotten reference of ProgrammingError to last patch. Please review 
issue6057_python3_6_v2.diff
Thanks!

--
Added file: http://bugs.python.org/file43413/issue6057_python3_6_v2.diff

___
Python tracker 

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



[issue24424] xml.dom.minidom: performance issue with Node.insertBefore()

2016-06-16 Thread Berker Peksag

Berker Peksag added the comment:

Please attach the patch in unified diff format. See 
https://docs.python.org/devguide/patch.html for details.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue27282] Raise BlockingIOError in os.urandom if kernel is not ready

2016-06-16 Thread Donald Stufft

Changes by Donald Stufft :


--
nosy:  -dstufft

___
Python tracker 

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



[issue27266] Always use getrandom() in os.random() on Linux and add block=False parameter to os.urandom()

2016-06-16 Thread Donald Stufft

Changes by Donald Stufft :


--
nosy:  -dstufft

___
Python tracker 

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



[issue27250] Add os.urandom_block()

2016-06-16 Thread Donald Stufft

Changes by Donald Stufft :


--
nosy:  -dstufft

___
Python tracker 

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



[issue27288] secrets should use getrandom() on Linux

2016-06-16 Thread Donald Stufft

Changes by Donald Stufft :


--
nosy:  -dstufft

___
Python tracker 

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



[issue27297] Add support for /dev/random to "secrets"

2016-06-16 Thread Donald Stufft

Changes by Donald Stufft :


--
nosy:  -dstufft

___
Python tracker 

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



[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

2016-06-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

ctypes_util_popen-6.py2.patch LGTM.

--

___
Python tracker 

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



[issue6057] sqlite3 error classes should be documented

2016-06-16 Thread Jaysinh shukla

Jaysinh shukla added the comment:

Submitting the patch for Python 3.6.

--
keywords: +patch
Added file: http://bugs.python.org/file43412/issue6057_python3_6.diff

___
Python tracker 

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



[issue27292] Warn users that os.urandom() can return insecure values

2016-06-16 Thread Donald Stufft

Changes by Donald Stufft :


--
nosy:  -dstufft

___
Python tracker 

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



[issue27292] Warn users that os.urandom() can return insecure values

2016-06-16 Thread STINNER Victor

STINNER Victor added the comment:

> As far as I can see (looking at Python/random.c and configure.ac), the 
> Solaris version should also use GRND_NONBLOCK:

Oh, you're right: I didn't notice that GRND_NONBLOCK was also used on Solaris. 
The change is not deliberate, but it is good to do that :-)

Solaris getrandom() is documented to fail with EAGAIN if "No entropy is 
available and GRND_NONBLOCK is set."
https://docs.oracle.com/cd/E53394_01/html/E54765/getrandom-2.html

The question is more if reading from /dev/urandom block in this case.

If we don't know, I would prefer to keep the "On Linux" prefix in the doc, and 
don't say anything about Solaris.

I'm able to check the behaviour of Solaris.

You should contact the developers who get access to Solaris, you can meet them 
in the previous random issues specific to Solaris: issue #25003 and issue 
#26735.

--

___
Python tracker 

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



[issue22228] Adapt bash readline operate-and-get-next function

2016-06-16 Thread Lele Gaifax

Lele Gaifax added the comment:

I will try to address your concerns.

--

___
Python tracker 

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



[issue24424] xml.dom.minidom: performance issue with Node.insertBefore()

2016-06-16 Thread GuiHome

GuiHome added the comment:

kindly ping

--

___
Python tracker 

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



[issue27292] Warn users that os.urandom() can return insecure values

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

Rebased so Rietveld can work with it, earlier version was my fault.

As far as I can see (looking at Python/random.c and configure.ac), the Solaris 
version should also use GRND_NONBLOCK:

#ifdef MS_WINDOWS
#elif defined(HAVE_GETENTROPY) && !defined(sun)
#else

#if defined(HAVE_GETRANDOM) || defined(HAVE_GETRANDOM_SYSCALL)
const int flags = GRND_NONBLOCK;
#ifdef HAVE_GETRANDOM
n = getrandom(dest, n, flags);
#else
n = syscall(SYS_getrandom, dest, n, flags);
#endif

Apart from using a C function call versus syscall(), I don’t see there is much 
difference between the Solaris and Linux cases. Correct me if I’m wrong though.

--
Added file: http://bugs.python.org/file43411/urandom-doc.patch

___
Python tracker 

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



[issue27292] Warn users that os.urandom() can return insecure values

2016-06-16 Thread STINNER Victor

STINNER Victor added the comment:

Strange, I don't see the [Review] button.

.. versionchanged:: 3.5.2
-  On Linux, if ``getrandom()`` blocks (the urandom entropy pool is not
+  If ``getrandom()`` blocks (the urandom entropy pool is not
   initialized yet), fall back on reading ``/dev/urandom``.

Please keep "On Linux", getrandom() is also used on Solaris, and my change is 
really restricted to Linux.

--

___
Python tracker 

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



[issue22228] Adapt bash readline operate-and-get-next function

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

I will try to have a closer look at this some time, but my immediate worry is 
it looks like you are directly copying Bash code (GPL) into Python (less 
restrictive license).

Perhaps a more general solution would be to expose rl_add_defun() to native 
Python code, if that is possible.

--

___
Python tracker 

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



[issue27330] Possible leaks in ctypes

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

Mostly looks good. I left a two comments.

--
nosy: +martin.panter

___
Python tracker 

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



[issue22228] Adapt bash readline operate-and-get-next function

2016-06-16 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



[issue22228] Adapt bash readline operate-and-get-next function

2016-06-16 Thread Berker Peksag

Berker Peksag added the comment:

The review comments are at http://bugs.python.org/review/8/#ps12743 (you 
can also click to the 'review' link above)

--

___
Python tracker 

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



[issue27258] Exception in BytesGenerator.flatten

2016-06-16 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for helping to triage this, Pedro. I think there is a typo in your 
example: ``email.message_from_binary_file(fp)`` needs to be passed to 
``bs.flatten()``.

With the following script I'm also unable to reproduce the issue in Python 3.4+:

import email
import email.generator
import sys

with open('flatten-exception.mail', 'rb') as f:
msg = email.message_from_binary_file(f)
gen = email.generator.BytesGenerator(sys.stdout.buffer)
gen.flatten(msg)

Hans-Peter, could you share a reproducer with us? Thanks!

--
nosy: +berker.peksag

___
Python tracker 

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



[issue22228] Adapt bash readline operate-and-get-next function

2016-06-16 Thread Lele Gaifax

Lele Gaifax added the comment:

The patch does not apply cleanly anymore, with current 3.6a3.

If there is any chance it could be taken into consideration, I will try to 
rebase it on top of current version.

@Berker: as I don't use Rietveld, is it possible for me to reach the comment 
you mentioned?

--

___
Python tracker 

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



[issue27292] Warn users that os.urandom() can return insecure values

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

Here is a possible patch for 3.5+ based on my modest understanding of the 
concerns about insecure results and blocking. I hope that my wording is clear, 
couldn’t be confused with Linux’s /dev/random blocking and running out of fresh 
entropy, etc.

I also tried to make it clearer what APIs are used in what circumstances. It is 
not just Linux: we also call getrandom() on Solaris, because its getentropy() 
is not good enough.

--
keywords: +patch
Added file: http://bugs.python.org/file43410/urandom-doc.patch

___
Python tracker 

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



[issue27140] Opcode for creating dict with constant keys

2016-06-16 Thread STINNER Victor

STINNER Victor added the comment:

Nice enhancement.

--

___
Python tracker 

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



[issue10839] email module should not allow some header field repetitions

2016-06-16 Thread Berker Peksag

Berker Peksag added the comment:

> Right, that's what I meant by "plumb". :)

Sorry, apparently I can't read in the mornings :) I have just opened issue 
27331 to implement this idea.

--

___
Python tracker 

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



[issue27331] Add a policy argument to email.mime.MIMEBase

2016-06-16 Thread Berker Peksag

New submission from Berker Peksag:

Quoting Barry's message msg268430 from issue 10839:

On Jun 13, 2016, at 06:38 AM, Berker Peksag wrote:

>I don't know if it's a good idea or API but can we add a 'policy' keyword
>argument to email.mime.base.MIMEBase? Right now, this is the only way to
>change the default policy without using high level functions like
>email.message_from_string():
>
>m = MIMEMultipart()
>m.policy = email.policy.default

I think we just need to plumb a `policy` argument through to the ultimate 
base
class, email.message.Message

--
components: email
files: mimebase_policy.diff
keywords: patch
messages: 268653
nosy: barry, berker.peksag, r.david.murray
priority: normal
severity: normal
stage: patch review
status: open
title: Add a policy argument to email.mime.MIMEBase
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43409/mimebase_policy.diff

___
Python tracker 

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



[issue27213] Rework CALL_FUNCTION* opcodes

2016-06-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Do you take this for your Demur?

--

___
Python tracker 

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



[issue27140] Opcode for creating dict with constant keys

2016-06-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue27324] Error when building Python extension

2016-06-16 Thread Mark

Mark added the comment:

The problem is that I don't have the choice, the compiler we use for the 
project is VS13. Anyway, my colleagues are aware of this limitation but they 
could build their extensions all the same.

I set the variables as you recommended, and the obj files have been created. 
But the link fails with the following error:

LINK : fatal error LNK1181: impossible to open the input file 'ucrt.lib'

This library does not exist in my VS13 environment.

 Message d'origine 
De : Zachary Ware 
À : tib...@netcourrier.com
Objet : [issue27324] Error when building Python extension
Date : 15/06/2016 18:54:39 CEST

Zachary Ware added the comment:

Using the wrong compiler, you may wind up with an extension that appears to 
work, and you may never have a problem with it if conditions are just right. 
This article[1] looks like a pretty good explanation of why you don't want to 
do it, though (note: I've only skimmed the article).

If you really want to shoot yourself in the foot, you can try running 
vcvarsall.bat yourself, then make sure MSsdk is set (distutils doesn't care 
what it's set to, just that it's set), and set DISTUTILS_USE_SDK (again, 
doesn't matter to what).

Also, note that this problem should be a thing of the past with Python 3.5+ and 
VS2015+.

[1] http://siomsystems.com/mixing-visual-studio-versions/

--

___
Python tracker 

___

--

___
Python tracker 

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



[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-16 Thread Xiang Zhang

Xiang Zhang added the comment:

Sorry, I suddenly find that I've misunderstood one of your comments. I changed 
according then. Please use the new version.

--
Added file: http://bugs.python.org/file43408/64bit_support_for_zlib_v3.patch

___
Python tracker 

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



[issue27292] Warn users that os.urandom() can return insecure values

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

As far as this bug goes, 3.5 is not very different from 2.7

--
nosy: +martin.panter
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



[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-16 Thread Xiang Zhang

Xiang Zhang added the comment:

I'm willing to and thanks for your work too :) I have replied to your comments 
and adjusted my patch accordingly. But there are still several I am confused or 
want to negotiate more. 

I now upload the adjusted patch.

--
Added file: http://bugs.python.org/file43407/64bit_support_for_zlib_v2.patch

___
Python tracker 

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



[issue6057] sqlite3 error classes should be documented

2016-06-16 Thread Jaysinh shukla

Changes by Jaysinh shukla :


--
nosy: +jaysinh.shukla

___
Python tracker 

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



[issue27165] Skip callables when displaying exception fields in cgitb

2016-06-16 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Hi Adam,

Thanks for the patch. I reviewed it. It's a good change. As you mentioned in 
the comments, making both HTML and Text formatter behave consistently and skip, 
underscores, callables, _callables will be a good idea. Please include change.

Also, if there is a test coverage for this change, it will be great. Thanks!

--
nosy: +orsenthil

___
Python tracker 

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



[issue27330] Possible leaks in ctypes

2016-06-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch fixes memory leaks in ctypes in case of errors.

--
components: Extension Modules, ctypes
files: ctypes_leaks.patch
keywords: patch
messages: 268646
nosy: amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Possible leaks in ctypes
type: resource usage
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43406/ctypes_leaks.patch

___
Python tracker 

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



[issue27258] Exception in BytesGenerator.flatten

2016-06-16 Thread Pedro Lacerda

Pedro Lacerda added the comment:

I was unable to reproduce this bug using the following snippet

import email, sys
from email.generator import BytesGenerator
from email.mime.text import MIMEText

fp = open('flatten-exception.mail', 'rb')
email.message_from_binary_file(fp)
bs = BytesGenerator(sys.stdout.buffer)
bs.flatten(MIMEText('msg', 'plain', 'utf-8'))

--
nosy: +Pedro Lacerda

___
Python tracker 

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



[issue27268] Incorrect error message on float('')

2016-06-16 Thread Pedro Lacerda

Pedro Lacerda added the comment:

Following the bug pointed by Adam and Eryk.

--
keywords: +patch
nosy: +Pedro Lacerda
Added file: http://bugs.python.org/file43405/float.patch

___
Python tracker 

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



[issue26836] Add memfd_create to os module

2016-06-16 Thread Pedro Lacerda

Pedro Lacerda added the comment:

Maybe useful at mmapmodule.c replacing

/* SVR4 method to map anonymous memory is to open /dev/zero */
fd = devzero = _Py_open("/dev/zero", O_RDWR);

tagname is unused at UNIX version of new_mmap_object() so if provided something 
like could be added for Linux only
fd = memfd_create(tagname, O_RDWR);

--
nosy: +Pedro Lacerda

___
Python tracker 

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