[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Tim Peters
Tim Peters added the comment: The only sane way to do things "like this" is to allow types to define their own special methods (like `__isnan__()`), in which case the math module defers to such methods when they exist. For example, this is how `math.ceil(Fraction)` works, by deferring to

[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-09-06 Thread Christian Heimes
Christian Heimes added the comment: See #27850. ChaCha20 is even less relevant for 3.3 an 3.4. It either requires LibreSSL, patch #26470 or a patched OpenSSL installation. -- nosy: +georg.brandl, larry stage: -> commit review ___ Python tracker

[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-09-06 Thread Christian Heimes
Christian Heimes added the comment: Larry, Georg I haven't pushed the new cipher suite list to 3.3 and 3.4 yet. It can break compatibility with ancient IE versions on Windows XP machines. The risk of 3DES is small for a typical application. -- nosy: +georg.brandl, larry

[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-09-06 Thread Christian Heimes
Changes by Christian Heimes : -- stage: -> commit review ___ Python tracker ___ ___

[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset d209fd77 by Christian Heimes in branch '3.5': Issues #27850 and #27766: Remove 3DES from ssl default cipher list and add ChaCha20 Poly1305. https://hg.python.org/cpython/rev/d209fd77 New changeset 6f4f19217d9b by Christian Heimes in branch

[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset d209fd77 by Christian Heimes in branch '3.5': Issues #27850 and #27766: Remove 3DES from ssl default cipher list and add ChaCha20 Poly1305. https://hg.python.org/cpython/rev/d209fd77 New changeset 6f4f19217d9b by Christian Heimes in branch

[issue27323] ncurses putwin() fails in test_module_funcs

2016-09-06 Thread Xavier de Gaye
Xavier de Gaye added the comment: > Just wondering, how you built Python with ncurses 6.0 Xavier? I am using archlinux ncurses 6.0 [1] (sorry for the delay, no internet on a sail crossing). [1] https://www.archlinux.org/packages/core/x86_64/ncurses/ --

[issue17884] Try to reuse stdint.h types like int32_t

2016-09-06 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___

[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Mark Dickinson
Mark Dickinson added the comment: > As a convenience for whom? I was referring to the general math module model. Being able to type `sqrt(2)` rather than having to type `sqrt(float(2))` or `sqrt(2.0)` is a convenience. -- ___ Python tracker

[issue17884] Try to reuse stdint.h types like int32_t

2016-09-06 Thread Benjamin Peterson
Benjamin Peterson added the comment: In 3.6, I just deprecated support for platforms without "long long". https://bugs.python.org/issue27961 "deprecated" is a strong word because I couldn't actually find a modern Python version that compiles without it. I'm informed that the MSVC we're since

[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Mark Dickinson
Mark Dickinson added the comment: > It shouldn't be hard to do the equivalent of: Right, that's not hard at all. But is it what we *want* to do? Why do you single out `int` for special treatment, but not `Fraction` or `Decimal`? How should the implementation handle Fraction objects, and why?

[issue23085] update internal libffi copy to 3.2.1

2016-09-06 Thread Zachary Ware
Zachary Ware added the comment: I'm closing this as superseded by #27976, which deprecates building with the bundled libffi. -- resolution: -> rejected stage: -> resolved status: open -> closed superseder: -> Deprecate building with bundled copy of libffi on non-Darwin POSIX

[issue27976] Deprecate building with bundled copy of libffi on non-Darwin POSIX platforms

2016-09-06 Thread Zachary Ware
Changes by Zachary Ware : -- components: +ctypes ___ Python tracker ___ ___

[issue27976] Deprecate building with bundled copy of libffi on non-Darwin POSIX platforms

2016-09-06 Thread Zachary Ware
New submission from Zachary Ware: Nosy list copied from #23085. Here's a patch that deprecates building _ctypes with the bundled copy of libffi (Modules/_ctypes/libffi/). The default on all platforms (other than Windows) is now to use a system copy of libffi; use the '--without-system-ffi'

[issue6135] subprocess seems to use local encoding and give no choice

2016-09-06 Thread Steve Dower
Steve Dower added the comment: > universal_newlines uses the locale encoding which is a good choice in most cases. Well, some cases, and only really by accident. I won't hide the parameter, but it is promoted as "frequently used" and I'll make sure to document encoding before

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-09-06 Thread R. David Murray
R. David Murray added the comment: If you want to help out with tracking this down, you could hg bisect the commits and find out which one broke it. -- nosy: +r.david.murray ___ Python tracker

[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: As a convenience for whom? Certainly not the poor user, who thinks that math.isnan(x) should return False if the number x is not a NAN. Since neither 10**1 nor 10**10 are NANs, why should one return correctly and the other raise a completely spurious

[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Mark Dickinson
Mark Dickinson added the comment: Related: #18842 -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Mark Dickinson
Mark Dickinson added the comment: I see this as a documentation issue: the vast majority of math module functions are designed to operate on floats, and if given a non-float input, simply convert that input to a float as a convenience. If we start special-casing math module functions for int,

[issue27969] Suppress unnecessary message when running test_gdb

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5e75bf8e5526 by Benjamin Peterson in branch '2.7': suppress stderr output when checking gdb (closes #27969) https://hg.python.org/cpython/rev/5e75bf8e5526 New changeset 2c4359ff4d6d by Benjamin Peterson in branch '3.5': suppress stderr output when

[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-09-06 Thread Brett Cannon
Brett Cannon added the comment: It sounds like you have a backport ready, Senthil. Is that true? If so then go ahead and apply the changes. You're right it could be backported, I just didn't due to laziness/lack of time. -- ___ Python tracker

[issue27974] Remove dead code in importlib._bootstrap

2016-09-06 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +eric.snow, ncoghlan ___ Python tracker ___ ___

[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Steven D'Aprano
New submission from Steven D'Aprano: Currently, math.isnan(n) and math.isinf(n) for n an int may raise OverflowError if n is too big to convert to a float, e.g.: py> math.isnan(10**1) Traceback (most recent call last): File "", line 1, in OverflowError: int too large to convert to float

[issue27967] Remove unused variables causing compile warnings in sqlite3 module

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset ecaa1af8fe04 by Benjamin Peterson in branch '2.7': fix unused variable warnings in pysqlite (closes #27967) https://hg.python.org/cpython/rev/ecaa1af8fe04 -- nosy: +python-dev resolution: -> fixed stage: -> resolved status: open -> closed

[issue6135] subprocess seems to use local encoding and give no choice

2016-09-06 Thread STINNER Victor
STINNER Victor added the comment: Steve Dower added the comment: > Given specifying an encoding will do the same thing as universal_newlines > would have, should I just "hide" references to universal_newlines in the doc? > (i.e. only mention it under a versionchanged banner, rather than >

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-06 Thread STINNER Victor
STINNER Victor added the comment: UTF codecs must not encode surrogate characters: http://unicodebook.readthedocs.io/issues.html#non-strict-utf-8-decoder-overlong-byte-sequences-and-surrogates Python 3 is right, sadly it's too late to fix Python 2. --

[issue27974] Remove dead code in importlib._bootstrap

2016-09-06 Thread Xiang Zhang
New submission from Xiang Zhang: _ManageReload in importlib._bootstrap seems obsolete since reve729b946cc03, remove it? -- files: importlib__bootstrap.patch keywords: patch messages: 274564 nosy: brett.cannon, xiang.zhang priority: normal severity: normal status: open title: Remove

[issue27575] dict viewkeys intersection slow for large dicts

2016-09-06 Thread David Su
David Su added the comment: ping -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6135] subprocess seems to use local encoding and give no choice

2016-09-06 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, excellent point about "encoding='utf-8'" already being a less cryptic replacement for universal_newlines=True, so consider my questions withdrawn :) As far as universal_newlines goes, that needs to remain documented for the sake of folks reading code that

[issue6135] subprocess seems to use local encoding and give no choice

2016-09-06 Thread Steve Dower
Steve Dower added the comment: Given specifying an encoding will do the same thing as universal_newlines would have, should I just "hide" references to universal_newlines in the doc? (i.e. only mention it under a versionchanged banner, rather than front-and-centre) --

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-06 Thread Christoph Reiter
Christoph Reiter added the comment: On Tue, Sep 6, 2016 at 4:10 PM, Eryk Sun wrote: > Lone surrogate codes aren't valid Unicode. In Python 3 they get used > internally for tricks like the "surrogateescape" error handler. In Python > 3.4+. the 'surrogatepass' error

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-09-06 Thread Sohaib Ahmad
New submission from Sohaib Ahmad: urllib.urlretrieve() fails on ftp: - start and complete a transfer - immediately start another transfer The second transfer will fail with the following error: [Errno ftp error] 200 Type set to I I am using urllib.urlretrieve(url, filename) to retrieve two

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-06 Thread Christoph Reiter
Christoph Reiter added the comment: On Tue, Sep 6, 2016 at 3:43 PM, Xiang Zhang wrote: > > Xiang Zhang added the comment: > > With the latest build, even encode will fail: With Python 3 you have to use the "surrogatepass" error handler. I assumed this was the default in

[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-09-06 Thread Xiang Zhang
Xiang Zhang added the comment: My PC is Ubuntu15.10, kernel 4.2, though CPU not Skylake. Everything works fine. test_aead_aes_gcm (test.test_socket.LinuxKernelCryptoAPI) ... skipped "('[Errno 2] No such file or directory', 'aead', 'gcm(aes)')" test_aes_cbc

[issue27962] null poiter dereference in set_conversion_mode due uncheck _ctypes_conversion_encoding

2016-09-06 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> null poiter dereference in set_conversion_mode due uncheck _ctypes_conversion_errors ___ Python tracker

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-06 Thread Eryk Sun
Eryk Sun added the comment: Probably Python 2's UTF-16 decoder should be as broken as the encoder, which will match the broken behavior of the UTF-8 and UTF-32 codecs: >>> u'\ud83d\uda12'.encode('utf-8').decode('utf-8') u'\ud83d\uda12' >>>

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-06 Thread Xiang Zhang
Xiang Zhang added the comment: With the latest build, even encode will fail: Python 3.6.0a4+ (default:dad4c42869f6, Sep 6 2016, 21:41:38) [GCC 5.2.1 20151010] on linux Type "help", "copyright", "credits" or "license" for more information. >>> u"\ud83d".encode("utf-16-le") Traceback (most

[issue27970] ssl: can't verify a trusted site with imcomplete certificate chain

2016-09-06 Thread lilydjwg
lilydjwg added the comment: I understand now, thank you! It's much easier to work around such issues than fix other people's sites. -- ___ Python tracker

[issue27866] ssl: get list of enabled ciphers

2016-09-06 Thread Berker Peksag
Changes by Berker Peksag : -- status: open -> closed ___ Python tracker ___ ___

[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-09-06 Thread Christian Heimes
Christian Heimes added the comment: Some distributions mess with the Kernel or disable user-space crypto. I have added some tweaks and fixed a couple of buildbots. I don't know what is going on with x86-64 Ubuntu 15.10 Skylake CPU. It's a Kernel 4.2 machine and should support AES-CBC.

[issue27866] ssl: get list of enabled ciphers

2016-09-06 Thread Christian Heimes
Christian Heimes added the comment: I have relaxed the tests and stabilized the buildbots. Some Gentoo machines don't have ECDHE cipher suites enabled. -- dependencies: -Make OpenSSL module compatible with OpenSSL 1.1.0 resolution: -> fixed stage: patch review -> resolved

[issue27970] ssl: can't verify a trusted site with imcomplete certificate chain

2016-09-06 Thread Christian Heimes
Christian Heimes added the comment: >From https://www.ssllabs.com/ssltest/analyze.html?d=miaosss.top Chain issuesIncomplete Extra download COMODO RSA Domain Validation Secure Server CA Python does not support extra downloads of incomplete chains. The server must return the EE cert and

[issue27970] ssl: can't verify a trusted site with imcomplete certificate chain

2016-09-06 Thread lilydjwg
lilydjwg added the comment: Please read my code. I've provided the CA certificate; this should work because I've downloaded the certificate manually and feed it to Python. openssl command line tool works. gnutls-cli works too. wget (with openssl) works too. curl (with openssl) fails like

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-06 Thread Christoph Reiter
Christoph Reiter added the comment: Same problem on 3.3.6. But works on 3.4.5. So I guess this was fixed but not backported. -- ___ Python tracker ___

[issue27972] Confusing error during cyclic yield

2016-09-06 Thread Max von Tettenborn
New submission from Max von Tettenborn: Below code reproduces the problem. The resulting error is a RecursionError and it is very hard to trace that to the cause of the problem, which is the runner task and the stop task yielding from each other, forming a deadlock. I think, an easy to make

[issue27971] utf-16 decoding can't handle lone surrogates

2016-09-06 Thread Christoph Reiter
New submission from Christoph Reiter: Using Python 2.7.12 >>> u"\ud83d".encode("utf-16-le") '=\xd8' >>> u"\ud83d".encode("utf-16-le").decode("utf-16-le") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/encodings/utf_16_le.py", line 16, in decode return

[issue27958] 'zlib compression' not found in set(['RLE', 'ZLIB', None])

2016-09-06 Thread Christian Heimes
Changes by Christian Heimes : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue27866] ssl: get list of enabled ciphers

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset dad4c42869f6 by Christian Heimes in branch 'default': Issue 27866: relax get_cipher() test even more. Gentoo buildbot has no ECDHE https://hg.python.org/cpython/rev/dad4c42869f6 -- ___ Python tracker

[issue27970] ssl: can't verify a trusted site with imcomplete certificate chain

2016-09-06 Thread Christian Heimes
Christian Heimes added the comment: Yes, that is to be expected. Python does not use AIA to fetch missing certs. The server must return all intermediate certs. Browsers have workarounds and local caches, Python doesn't. Other tools like curl behave the same. -- nosy: +christian.heimes

[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset e3b83bfa02c5 by Christian Heimes in branch 'default': Issue 27744: skip test if AF_ALG socket bind fails https://hg.python.org/cpython/rev/e3b83bfa02c5 -- ___ Python tracker

[issue27350] Compact and ordered dict

2016-09-06 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file44395/compact-dict.patch ___ Python tracker ___

[issue27970] ssl: can't verify a trusted site with imcomplete certificate chain

2016-09-06 Thread lilydjwg
New submission from lilydjwg: This fails: Python 3.5.2 (default, Jun 28 2016, 08:46:01) [GCC 6.1.1 20160602] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> import socket >>> s = socket.socket() >>> c = >>>

[issue27889] ctypes interfers with signal handling

2016-09-06 Thread Andre Merzky
Andre Merzky added the comment: I think we are on the same page then, thanks. AFAIU, the C-level signal handler results in a flag being set, which is evaluated at some later point in time[1], after a certain number of opcodes have been executed. Could it be that those opcodes blindly

[issue27866] ssl: get list of enabled ciphers

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9377ed49746b by Christian Heimes in branch 'default': Issue 27866: relax test case for set_cipher() and allow more cipher suites https://hg.python.org/cpython/rev/9377ed49746b -- ___ Python tracker

[issue1067702] urllib fails with multiple ftp transfers

2016-09-06 Thread Sohaib Ahmad
Sohaib Ahmad added the comment: The problem is reproducible on latest python 2.7 package (2.7.12). I tried the same scenario on 2.7.10 and it worked fine. I am not sure if this issue can be reopened or should I create a new one? In my case first transfer succeeds but second ftp transfer fails

[issue18844] allow weights in random.choice

2016-09-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Latest draft patch attached (w/o tests or docs). Incorporates consultation from Alan Downey and Jake Vanderplas. * Population and weights are separate arguments (like numpy.random.choice() and sample() in R). Matches the way data would arrive in Pandas.

[issue27889] ctypes interfers with signal handling

2016-09-06 Thread George Slavin
George Slavin added the comment: The docs say the sleep call will end if a signal is caught, so once the main thread wakes, it won't go back to sleep. On Sep 6, 2016 12:35 AM, "Andre Merzky" wrote: > > Andre Merzky added the comment: > > Hi George, > > > From these

[issue27106] configparser.__all__ is incomplete

2016-09-06 Thread Jacek Kołodziej
Jacek Kołodziej added the comment: That's completely fine for me. I'm attaching the patch that just adds test for __all__, then. :) -- Added file: http://bugs.python.org/file44393/configparser_all.v2.patch ___ Python tracker

[issue27965] Automatic .py extension when saving with IDLE on OSX

2016-09-06 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: automatic .py extension -> Automatic .py extension when saving with IDLE on OSX type: -> behavior ___ Python tracker

[issue27965] automatic .py extension

2016-09-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: This issue is essentially a duplicate of $4832, in which Ned Deily added 'defaultextension' in the code below. Saving works fine on Windows, The added default extension is not shown in the input box of the SaveAs dialog but it is visible in file listing or

[issue27889] ctypes interfers with signal handling

2016-09-06 Thread Andre Merzky
Andre Merzky added the comment: Hi George, > From these results, it appears there is no guarentee that the signal handler > will run before the main thread continues execution at the time.sleep(500) > line. This would explain why we advance to the else clause before the > exception is

[issue27889] ctypes interfers with signal handling

2016-09-06 Thread George Slavin
George Slavin added the comment: In case anyone else sees this thread, here's my trimmed down script to repro the issue: #!/usr/bin/env python2 import threading as mt import signal import time import os def sigusr2_handler(signum, frame): raise RuntimeError('caught sigusr2')

[issue27969] Suppress unnecessary message when running test_gdb

2016-09-06 Thread Xiang Zhang
New submission from Xiang Zhang: Right now, when running test_gdb generates following message: ./python -m test test_gdb Run tests sequentially 0:00:00 [1/1] test_gdb *Python Exception No module named gdb: *gdb: warning: *Could not load the Python gdb module from

[issue27889] ctypes interfers with signal handling

2016-09-06 Thread Andre Merzky
Andre Merzky added the comment: Also thanks for the reply! :) Interesting that our results differ: as said, my code stumbles over it rather frequently, and I can't reproduce w/o ctypes activities. But indeed, the latter might just reinforce a race condition which is present either way...

[issue27889] ctypes interfers with signal handling

2016-09-06 Thread George Slavin
George Slavin added the comment: Thanks for the reply! I've managed to reproduce the issue without using ctypes, so we can exclude ctypes as the cause of the problem :) The bug only occurs for me after hundreds of iterations of the script, so it is very intermittent. >From my results, it

[issue27968] test_coroutines generates some warnings

2016-09-06 Thread Xiang Zhang
New submission from Xiang Zhang: ./python -m test test_coroutines Run tests sequentially 0:00:00 [1/1] test_coroutines /home/angwer/cpython/Lib/test/test_coroutines.py:891: RuntimeWarning: coroutine 'CoroutineTest.test_await_12..coro' was never awaited return await Awaitable()

[issue27967] Remove unused variables causing compile warnings in sqlite3 module

2016-09-06 Thread Xiang Zhang
New submission from Xiang Zhang: Compile py2.7 will generate two unused variable warnings in sqlite3 module. The variables have already not existed in py3. /home/angwer/py2.7/Modules/_sqlite/cursor.c: In function ‘pysqlite_cursor_dealloc’: /home/angwer/py2.7/Modules/_sqlite/cursor.c:121:9:

<    1   2   3