[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 `/usr/local/share/gdb/python'.
*Limited Python support is available from the _gdb module.
*Suggest passing --data-directory=/path/to/gdb/data-directory.

test_gdb skipped -- Unable to parse output from gdb.Frame.select test
test_gdb skipped

1 test skipped:
test_gdb

Total duration: 166 ms
Tests result: SUCCESS

The messages prefixed * are messages generated by invoked gdb command and I 
think they are not needed to prompt to users.

test_gdb.patch tries to suppress them. After applied, the messages cleaner.

./python -m test test_gdb
Run tests sequentially
0:00:00 [1/1] test_gdb
test_gdb skipped -- Unable to parse output from gdb.Frame.select test
test_gdb skipped

1 test skipped:
test_gdb

Total duration: 159 ms
Tests result: SUCCESS

--
components: Tests
files: test_gdb.patch
keywords: patch
messages: 274532
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: Suppress unnecessary message when running test_gdb
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44392/test_gdb.patch

___
Python tracker 

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



[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')
signal.signal(signal.SIGUSR2, sigusr2_handler)

def sub(pid):
time.sleep(1)
os.kill(pid, signal.SIGUSR2)

try:
t = mt.Thread(target=sub, args=[os.getpid()])
t.start()
time.sleep(500)
except Exception as e:
print('except: %s' % e)
else:
print('unexcepted')
finally:
t.join()


When I run the above, I get the repro after hundreds of iterations.  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 raised.

--

___
Python tracker 

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



[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 raised.

To me it looks like the problem pops up *way* before the `sleep(100)` (or 
whatever) finishes, in fact it looks consistently like the sleep is indeed 
interrupted after one second.  I would it thus interpret differently, as the 
code should not be able to advance to the `else` clause at that time.

Is that different for you?

--

___
Python tracker 

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



[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 in the IDLE editor title bar.  Ned said that with 
the his addition, it also worked on OSX.  Are you sure there is no extension in 
a file listing or title bar if you don't add .py?  What tcl/tk version are you 
using?  (See Help => About IDLE.)

The relevant code in idlelib/iomenu.py (IOBinding before 3.6),

filetypes = [
("Python files", "*.py *.pyw", "TEXT"),
("Text files", "*.txt", "TEXT"),
("All files", "*"),
]

defaultextension = '.py' if sys.platform == 'darwin' else ''
...
def asksavefile(self):
dir, base = self.defaultfilename("save")
if not self.savedialog:
self.savedialog = tkFileDialog.SaveAs(
parent=self.text,
filetypes=self.filetypes,
defaultextension=self.defaultextension)
filename = self.savedialog.show(initialdir=dir, initialfile=base)
return filename

--
components: +Tkinter
nosy: +serhiy.storchaka

___
Python tracker 

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



[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 

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



[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 

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



[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 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 raised.
>
> To me it looks like the problem pops up *way* before the `sleep(100)` (or
> whatever) finishes, in fact it looks consistently like the sleep is indeed
> interrupted after one second.  I would it thus interpret differently, as
> the code should not be able to advance to the `else` clause at that time.
>
> Is that different for you?
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[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.  Easily extracted 
from a Counter or dict using keys() and values().  Suitable for applications 
that sample the population multiple times but using different weights.  See 
https://stat.ethz.ch/R-manual/R-devel/library/base/html/sample.html and 
http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.choice.html

* Excludes a replacement=False option. That use case necessarily has integer 
weights and may be better suited to the existing random.sample() rather than 
trying to recompute a CDF on every iteration as we would have to in this 
function.

* Allows cumulative_weights to be submitted instead of individual weights.  
This supports uses cases where the CDF already exists (as in the ThinkBayes 
examples) and where we want to periodically reuse the same CDF for repeated 
samples of the same population -- this occurs in resampling applications, Gibbs 
sampling, and Monte Carlo Markov Chain applications.  Per Jake, "MCMC/Gibbs 
Sampling approaches generally boil down to a simple weighted coin toss at each 
step" and "It's definitely common to do aggregation of multiple samples, e.g. 
to compute sample statistics"

* The API allows the weights to be integers, fractions, decimals, or floats.  
Likewise, the population and weights can be any Sequence.  Population elements 
need not be hashable.

* Returning a list means that the we don't have to save state in mid-stream 
(that is why we can't use a generator).  A list feeds nicely into Counters, 
mean, median, stdev, etc for summary statistics.  Returning a list parallels 
what random.sample() does, keeping the module internally consistent.

* Default uniform weighting falls back to random.choice() which would be more 
efficient than bisecting.

* Bisecting tends to beat other approaches in the general case.  See 
http://eli.thegreenplace.net/2010/01/22/weighted-random-generation-in-python

* Incorporates error checks for len(population)==len(cum_weights) and for 
conflicting specification of both weights and cumulative weights.

There API is not perfect and there are some aspects that give me heartburn.  1) 
Not saving the computed CDF is waste and forces the user to pre-build the CDF 
if they want to save it for later use (the API could return both the selections 
and the CDF but that would be awkward and atypical).  2) For the common case of 
having small integer weights on a small population, the bisecting approach is 
slower than using random.choice on a population expanded to include the 
selections multiple times in proportion to their weights (that said, short of 
passing in a flag, there is no cheap easy way for this function to detect that 
case and give it a fast path).  3) Outputting a list is inefficient if all 
you're doing with result is summarizing it with a Counter, histogram tool, 
mean, median, or stdev.  4)  There is no cheap way to check to see if the user 
supplied cum_weights is sorted or if the weights contain negative values.

--
Added file: http://bugs.python.org/file44394/weighted_choice.diff

___
Python tracker 

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



[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 with the error:
[Errno ftp error] 200 Type set to I

I am using urllib.urlretrieve(url, local_path) to retrieve two files (one by 
one) from FTP server.

--
nosy: +Sohaib Ahmad

___
Python tracker 

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



[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 

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



[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 continue to walk 
into the `else` clause despite the sleep interruption?

[1] 
https://docs.python.org/3/library/signal.html#execution-of-python-signal-handlers

--

___
Python tracker 

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



[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 = 
>>> ssl.create_default_context(cafile='COMODORSADomainValidationSecureServerCA.crt')
>>> s = c.wrap_socket(s, server_hostname='miaosss.top')
>>> s.connect(('miaosss.top', 443))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/ssl.py", line 1019, in connect
self._real_connect(addr, False)
  File "/usr/lib/python3.5/ssl.py", line 1010, in _real_connect
self.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 988, in do_handshake
self._sslobj.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 633, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
(_ssl.c:645)

But openssl can succeed:

openssl s_client -connect miaosss.top:443 -CAfile 
COMODORSADomainValidationSecureServerCA.crt -servername miaosss.top

endswith "Verify return code: 0 (ok)"

Firefox and SSLlabs 
(https://www.ssllabs.com/ssltest/analyze.html?d=miaosss.top) both show it's 
trusted.

--
messages: 274542
nosy: lilydjwg
priority: normal
severity: normal
status: open
title: ssl: can't verify a trusted site with imcomplete certificate chain
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



[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 

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



[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 

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



[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
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[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 

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



[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 

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



[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 codecs.utf_16_le_decode(input, errors, True)
UnicodeDecodeError: 'utf16' codec can't decode bytes in position 0-1: 
unexpected end of data
>>>

--
components: Unicode
messages: 274546
nosy: ezio.melotti, haypo, lazka
priority: normal
severity: normal
status: open
title: utf-16 decoding can't handle lone surrogates
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



[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 mistake like that should raise a clearer exception. 
And maybe I am mistaken, but it should in principle be possible for the event 
loop to detect a cyclic yield, right?


import asyncio


class A:
@asyncio.coroutine
def start(self):
self.runner_task = asyncio.ensure_future(self.runner())

@asyncio.coroutine
def stop(self):
self.runner_task.cancel()
yield from self.runner_task

@asyncio.coroutine
def runner(self):
try:
while True:
yield from asyncio.sleep(5)
except asyncio.CancelledError:
yield from self.stop()
return


def do_test():
@asyncio.coroutine
def f():
a = A()
yield from a.start()
yield from asyncio.sleep(1)
yield from a.stop()

asyncio.get_event_loop().run_until_complete(f())

--
components: asyncio
messages: 274547
nosy: Max von Tettenborn, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Confusing error during cyclic yield
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



[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 

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



[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 Python but I don't understand why.

I've successfully done things like this before, but now I encounter a site that 
Python can't verify with the correct CA certificate (that other tools accept).

--

___
Python tracker 

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



[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 all intermediate certs during the TLS handshake.

You also can't pass the intermediate cert as a CA cert. It's not a trust 
anchor. You could load both the trust anchor and intermediate cert as CA certs 
(concatenate intermediate and root certs), but that is potentially dangerous. 
Safer way is 
https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_add0_chain_cert.html but 
Python does not have an API for SSL_CTX_add0_chain_cert().

Best solution: get the server fixed. It doesn't behave correctly.

--

___
Python tracker 

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



[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

___
Python tracker 

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



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

--

___
Python tracker 

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



[issue27866] ssl: get list of enabled ciphers

2016-09-06 Thread Berker Peksag

Changes by Berker Peksag :


--
status: open -> closed

___
Python tracker 

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



[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 

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



[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 recent call last):
  File "", line 1, in 
UnicodeEncodeError: 'utf-16-le' codec can't encode character '\ud83d' in 
position 0: surrogates not allowed

--
nosy: +xiang.zhang

___
Python tracker 

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



[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'
>>> u'\ud83d\uda12'.encode('utf-32-le').decode('utf-32-le')
u'\ud83d\uda12'

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 handler allows encoding and decoding lone surrogates: 

>>> u'\ud83d\uda12'.encode('utf-16le', 'surrogatepass')
b'=\xd8\x12\xda'
>>> _.decode('utf-16le', 'surrogatepass')
'\ud83d\uda12'

--
nosy: +eryksun

___
Python tracker 

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



[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 

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



[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 (test.test_socket.LinuxKernelCryptoAPI) ... ok
test_drbg_pr_sha256 (test.test_socket.LinuxKernelCryptoAPI) ... ok
test_hmac_sha1 (test.test_socket.LinuxKernelCryptoAPI) ... ok
test_sendmsg_afalg_args (test.test_socket.LinuxKernelCryptoAPI) ... ok
test_sha256 (test.test_socket.LinuxKernelCryptoAPI) ... ok

--
nosy: +xiang.zhang

___
Python tracker 

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



[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 Python 2 since it worked with other
codecs.

--

___
Python tracker 

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



[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 files (one by one) 
from FTP server.

Sample code to reproduce the problem is attached. Please update url1 and url2 
with correct values.

This problem was reported several years ago and was fixed but it is now 
reproducible on latest python 2.7 package (2.7.12).

http://bugs.python.org/issue1067702

I tried the same scenario on 2.7.10 and it worked fine. So a patch after 2.7.10 
must have broken something.

--
components: Library (Lib)
files: multiple_ftp_download.py
messages: 274559
nosy: Sohaib Ahmad
priority: normal
severity: normal
status: open
title: urllib.urlretrieve() fails on second ftp transfer
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file44396/multiple_ftp_download.py

___
Python tracker 

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



[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 handler allows encoding and decoding lone 
> surrogates:

To add some context: I was writing tests for windows paths containing
surrogates (e.g. os.listdir can return them)

--

___
Python tracker 

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



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

--

___
Python tracker 

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



[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 uses it, and folks that need compatibility with 
older versions, but +1 for recommending specifying an encoding over using that 
flag for new 3.6+ code.

--

___
Python tracker 

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



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 dead code in importlib._bootstrap
type: enhancement
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44397/importlib__bootstrap.patch

___
Python tracker 

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



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

--

___
Python tracker 

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



[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 
> front-and-centre)

No. Don't hide universal_newlines, it's different than encoding.
universal_newlines uses the locale encoding which is a good choice in
most cases.

--

___
Python tracker 

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



[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

___
Python tracker 

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



[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


But this conversion is unnecessary. int does not support either INF or NAN, so 
there is no need to convert the value to float first. If the argument is an 
int, the result must be False.

The same applies to Fraction.

--
messages: 274568
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: math.isnan(int) and math.isinf(int) should not raise OverflowError

___
Python tracker 

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



[issue27974] Remove dead code in importlib._bootstrap

2016-09-06 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +eric.snow, ncoghlan

___
Python tracker 

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



[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 

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



[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 checking gdb (closes #27969)
https://hg.python.org/cpython/rev/2c4359ff4d6d

New changeset 6e827e97c064 by Benjamin Peterson in branch 'default':
merge 3.5 (#27969)
https://hg.python.org/cpython/rev/6e827e97c064

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[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, Fraction, and Decimal inputs, the module is going to 
become much more complicated both in terms of implementation and in terms of 
cognitive load for the user.

--
nosy: +mark.dickinson

___
Python tracker 

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



[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
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 OverflowError?

I cannot speak for the implementation, except as a wild guess. It 
shouldn't be hard to do the equivalent of:

if type(x) == int: return False  # Intentionally excluding subclasses.
try:
y = float(x)
except OverflowError:
return False
else:
... # existing implementation

but since I know nothing about the C implementation maybe I'm completely 
wrong. But as far as the user's cognitive load, I don't think that:

"math.isnan(x) might return the expected result, or it might raise 
OverflowError"

is *simpler* for the user than:

"math.isnan(x) will return the expected result".

--

___
Python tracker 

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



[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 

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



[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 universal_newlines. Call it a very weak deprecation.

The new patch also removes the openers, which I think were solving a problem we 
don't have right now.

--
Added file: http://bugs.python.org/file44398/6135_3.patch

___
Python tracker 

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



[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' flag to 
./configure to use the bundled copy.  On non-Darwin platforms, a warning will 
be emitted noting that Modules/_ctypes/libffi will not be distributed with 3.7.

--
components: Build
files: deprecate_bundled_libffi.diff
keywords: patch
messages: 274576
nosy: Arfrever, Chi Hsuan Yen, berker.peksag, chris.jerdonek, doko, fabiovmp, 
gustavotemple, koobs, lemburg, meador.inge, ned.deily, r.david.murray, 
steve.dower, tim.golden, xdegaye, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Deprecate building with bundled copy of libffi on non-Darwin POSIX 
platforms
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file44399/deprecate_bundled_libffi.diff

___
Python tracker 

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



[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 

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



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

___
Python tracker 

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



[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? How should the 
implementation handle a Fraction-like object implemented by a user? Why only 
objects of exact type `int`, but not instances of subclasses? Your suggestion 
replaces a straightforward mental model (math.isnan converts its input to 
float, then operates on it, just like almost all other math module functions) 
with something more complicated.

-1 from me.

--

___
Python tracker 

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



[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 3.5 will have stdint.h available. I think we 
should start requiring it.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[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 

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



[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 

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



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

--

___
Python tracker 

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



[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 '2.7':
Issues #27850 and #27766: Remove 3DES from ssl default cipher list and add 
ChaCha20 Poly1305.
https://hg.python.org/cpython/rev/6f4f19217d9b

New changeset f586742e56cb by Christian Heimes in branch 'default':
Issues #27850 and #27766: Remove 3DES from ssl default cipher list and add 
ChaCha20 Poly1305.
https://hg.python.org/cpython/rev/f586742e56cb

--
nosy: +python-dev

___
Python tracker 

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



[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 '2.7':
Issues #27850 and #27766: Remove 3DES from ssl default cipher list and add 
ChaCha20 Poly1305.
https://hg.python.org/cpython/rev/6f4f19217d9b

New changeset f586742e56cb by Christian Heimes in branch 'default':
Issues #27850 and #27766: Remove 3DES from ssl default cipher list and add 
ChaCha20 Poly1305.
https://hg.python.org/cpython/rev/f586742e56cb

--
nosy: +python-dev

___
Python tracker 

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



[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 

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



[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

___
Python tracker 

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



[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 

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



[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 `Fraction.__ceil__()`.  The math 
module itself knows nothing else about what `ceil(Fraction)` could possibly 
mean.  All it knows is "if the type has __ceil__ use that, else convert to 
float first".

I'm also -1 on adding masses of if/else if/else if/.../else constructs to the 
math module to build in knowledge of the builtin numeric types.  Do it "right" 
or not at all.

I'd just be -0 on adding masses of new __isnan__, __isinf__, ..., special 
methods.  They're just not useful enough often enough.

--
nosy: +tim.peters

___
Python tracker 

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



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

2016-09-06 Thread Larry Hastings

Larry Hastings added the comment:

I don't think "remove de-recommended cypher" qualifies as a security fix for 
3.3 or 3.4.  Certainly you're not permitted to add ChaCha20 to 3.3 or 3.4.  IMO 
these changes should only be in 2.7 and 3.5+.

--
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue14119] Ability to adjust queue size in Executors

2016-09-06 Thread Patrik Dufresne

Patrik Dufresne added the comment:

Any update on this subject ?

Also had to monkey patch the implementation to avoid consuming all the system 
memory.

--
nosy: +Patrik Dufresne

___
Python tracker 

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



[issue27928] Add hashlib.scrypt

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d926fa1a833c by Christian Heimes in branch 'default':
Issue #27928: Add scrypt (password-based key derivation function) to hashlib 
module (requires OpenSSL 1.1.0).
https://hg.python.org/cpython/rev/d926fa1a833c

--
nosy: +python-dev

___
Python tracker 

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



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

2016-09-06 Thread Donald Stufft

Donald Stufft added the comment:

> I don't think "remove de-recommended cypher" qualifies as a security fix for 
> 3.3 or 3.4.  Certainly you're not permitted to add ChaCha20 to 3.3 or 3.4

I think that this is a bad stance to take here. The difference between a 
security feature and a security fix is incredibly hard to differentiate. For 
instance, with 3DES being de-recommended (and removed in future OpenSSLs) that 
leaves basically only AES-GCM and AES-CBC left as a secure cipher. This is a 
very precarious position to be in because all it takes is some reason that 
these constructions are less secure (it doesn't even have to be an attack on 
AES itself, could just be the way TLS uses it) and suddenly 3.3 and 3.4 don't 
have *any* secure ciphers. It is important from a security standpoint to have 
multiple secure ciphers available with different implementation details to 
protect against problems in one of them from causing widespread harm.

As far as removing 3DES, I think that we need to either remove it or we need to 
implement protections to prevent it from being used for too much data. 3DES 
isn't insecure so much as it's so old that you can only safely encrypt so much 
data with it with a single TLS key (Key == Connection roughly) before it 
becomes insecure. This is likely to hit automated tooling worse because it only 
affects things that hold long lived connections or re-use TLS session keys for 
a long period of time and a lot of tooling does just that for performance 
reasons.

--

___
Python tracker 

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



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

On Tue, Sep 06, 2016 at 05:59:08PM +, Mark Dickinson wrote:
> Why do you single out `int` for special treatment, 

Mostly as a demonstration for what could be done, not necessarily as 
what should be done. Secondly as a potential optimization. Why go to the 
expense of converting something to a float when there's a much 
cheaper(?) test?

> but not `Fraction` or `Decimal`?

They're not built-ins. They would have to be imported first, before you 
can test for their types. That could be costly, and it would rarely be 
necessary.

> How should the implementation handle Fraction objects, and why?

If some hypothetical subclass of Fraction provides a NAN or INF value, 
trust that float(x) of those values will return a float NAN or INF. If 
the conversion overflows, the value isn't a NAN or INF.

> How should the implementation handle a Fraction-like object 
> implemented by a user?

As above.

> Why only objects of exact type `int`, but not instances of subclasses?

Subclass of int might hypothetically implement their own NAN or INF 
values. In which case, trust that MyInt('nan').__float__() will return a 
NAN float as it is supposed to.

> Your suggestion replaces a straightforward 
> mental model (math.isnan converts its input to float, then operates on 
> it, just like almost all other math module functions) with something 
> more complicated.

Not more complicated. An even more simple *model*. The existing model 
for (let's say isnan):

"Convert the number x to a float, which may Overflow, then return 
whether the float is a NAN."

Versus the even simpler model:

"Return whether the number x is a NAN."

(Which of course hides a more complex *implementation*.)

Versus the practice of pushing the complexity onto the users:

"Oh gods, what sort of number is my x? If I pass it to math.isnan, will 
it blow up? Better wrap it in a try...except ValueError just in case. 
[Later] Ah, dammit, I meant OverflowError! Oh no, is there an 
UnderflowError for Fractions?"

I guess the argument boils down to whether we want to prioritise 
simplicity or usefulness in the math module.

--

___
Python tracker 

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



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

2016-09-06 Thread Eryk Sun

Eryk Sun added the comment:

Victor, it seems the only option here (other than closing this as won't fix) is 
to modify the UTF-16 decoder in 2.7 to allow lone surrogates, which would be 
consistent with the UTF-8 and UTF-32 decoders. While it's too late to enforce 
strict compliance in 2.7, it shouldn't hurt to expand the domain of acceptable 
encodings. Then if surrogates are always passed in 2.7, a silently ignored 
"surrogatepass" handler could be added for compatibility with 3.x code.

--

___
Python tracker 

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



[issue21009] Potential deadlock in concurrent futures when garbage collection occurs during Queue.get

2016-09-06 Thread Patrik Dufresne

Patrik Dufresne added the comment:

I've encounter this issue. To easily avoid this issue, I've change 
`queue.put(None)` to `queue.put(None, block=False)` to work around this.

--
nosy: +Patrik Dufresne

___
Python tracker 

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



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

2016-09-06 Thread Christian Heimes

Christian Heimes added the comment:

Donald, my OpenSSL 1.1.0 patch hasn't landed in 3.3 and 3.4 either. It's a bit 
mood to discuss ChaCha20 w/o OpenSSL 1.1.0. Rich Salz doesn't want to include 
ChaCha20 suites in 1.0.2 upstream. You either have to patch and build OpenSSL 
yourself or use LibreSSL.

--

___
Python tracker 

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



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

2016-09-06 Thread Donald Stufft

Donald Stufft added the comment:

We should backport OpenSSL 1.1.0 too *shrug*.

--

___
Python tracker 

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



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

2016-09-06 Thread Mark Dickinson

Mark Dickinson added the comment:

[Steven]
> Versus the even simpler model:
> "Return whether the number x is a NAN."

But what you're proposing doesn't match that description! Under your proposal, 
`math.isnan(10**1000)` would be `False`, but `math.isnan(Fraction(10**1000))` 
would again raise an `OverflowError`, as would `math.isnan(Decimal('1e500'))`.

--

___
Python tracker 

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



[issue27977] smtplib send_message does not correctly handle unicode addresses if message uses EmailPolicy

2016-09-06 Thread R. David Murray

New submission from R. David Murray:

In rewriting the examples in the email docs to use the new policies, I 
discovered that smtplib has a bug when handling a message that uses an 
EmailPolicy derived policy if the addresses contain unicode characters.  
Currently it is extracting the addresses as unicode strings instead of 
transport encoded strings.  It needs a special case to handle EmailPolicy 
Messages.

--
components: email
messages: 274597
nosy: barry, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: smtplib send_message does not correctly handle unicode addresses if 
message uses EmailPolicy
type: behavior
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



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

2016-09-06 Thread Mark Dickinson

Mark Dickinson added the comment:

> as would `math.isnan(Decimal('1e500'))`

Whoops, no. I'd forgotten that large finite `Decimal` objects end up as `float` 
infinities under conversion. Not sure I like that much, but it is what it is ...

--

___
Python tracker 

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



[issue27978] Executor#shutdown with timeout

2016-09-06 Thread Patrik Dufresne

New submission from Patrik Dufresne:

Would be nice to add a new parameter to timeout if the shutdown take too long.


def shutdown(self, wait=True, timeout=None):
with self._shutdown_lock:
self._shutdown = True
self._work_queue.put(None)
if wait:
for t in self._threads:
start = time.time()
t.join(timeout)
timeout = timeout + start - time.time()

--
components: Library (Lib)
messages: 274599
nosy: Patrik Dufresne
priority: normal
severity: normal
status: open
title: Executor#shutdown with timeout
type: enhancement
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



[issue27979] Remove bundled libffi

2016-09-06 Thread Zachary Ware

New submission from Zachary Ware:

The attached patch allows the bundled libffi used in non-Darwin POSIX builds 
(Modules/_ctypes/libffi, along with Modules/_ctypes/libffi.diff) to be removed. 
 It depends on the patch in #27976, and does not affect OSX or Windows.

--
components: Build, ctypes
files: remove_bundled_libffi.diff
keywords: patch
messages: 274600
nosy: zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Remove bundled libffi
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file44400/remove_bundled_libffi.diff

___
Python tracker 

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



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

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ae03163b6378 by Benjamin Peterson in branch 'default':
require standard int types to be defined (#17884)
https://hg.python.org/cpython/rev/ae03163b6378

--
nosy: +python-dev

___
Python tracker 

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



[issue27979] Remove bundled libffi

2016-09-06 Thread Zachary Ware

Changes by Zachary Ware :


--
dependencies: +Deprecate building with bundled copy of libffi on non-Darwin 
POSIX platforms

___
Python tracker 

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



[issue27980] Add better pythonw support to py launcher

2016-09-06 Thread Mark Summerfield

New submission from Mark Summerfield:

The excellent py.exe launcher on Windows always uses a python.exe interpreter 
(although another issue suggests it will use pythonw.exe when the python file 
has a .pyw suffix which is good).

However, if one wanted to provide a .bat file like this:

@echo off
pushd %~dp0
py -3 MyGuiApp.pyw %*
popd

python.exe would be used rather than pythonw.exe.

My suggestion is to add a -w and/or --win(dows) flag which forces the use of 
pythonw.exe.

--
components: Windows
messages: 274602
nosy: mark, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Add better pythonw support to py launcher
type: 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



[issue27980] Add better pythonw support to py launcher

2016-09-06 Thread Zachary Ware

Zachary Ware added the comment:

pyw.exe is installed alongside py.exe, is it insufficient?

--

___
Python tracker 

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



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

2016-09-06 Thread Mark Dickinson

Mark Dickinson added the comment:

LVGTM, if the buildbots agree.

--

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 28e280915508 by Serhiy Storchaka in branch 'default':
Issue #27078: Added BUILD_STRING opcode.  Optimized f-strings evaluation.
https://hg.python.org/cpython/rev/28e280915508

--
nosy: +python-dev

___
Python tracker 

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



[issue27980] Add better pythonw support to py launcher

2016-09-06 Thread Eryk Sun

Eryk Sun added the comment:

py.exe is a console application. There's no point in using it to run 
pythonw.exe. Use pyw.exe, as Zachary suggests. Or better yet, just run 
`MyGuiApp.pyw %*`. Unless you've reconfigured the .pyw file association, it 
should run via pyw.exe.

--
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



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

2016-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Python/dtoa.c contains a number of "#ifdef ULLong". Since now ULLong is not a 
macro but a typedef, this condition is false and the compiler now compiles 
different (less efficient and perhaps less tested) branch of the code.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Eric. I considered passing NULL, but as Antti said, 
it is already used for space separated concatenation. PyUnicode_New(0, 0) is 
the obvious way to get an empty string, and I think it is fast enough. If this 
affects performance we can add additional microoptimization later.

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

___
Python tracker 

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



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

2016-09-06 Thread Mark Dickinson

Mark Dickinson added the comment:

Good point. I'd be happy to see the non-"#ifdef ULLong" branches simply 
disappear in dtoa.c. We're long past the point of trying to keep dtoa.c in sync 
with the upstream version.

--

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-09-06 Thread Eric V. Smith

Eric V. Smith added the comment:

Now that I've looked at PyUnicode_New, I agree with using PyUnicode_New(0, 0). 
I can't imagine we could measure the difference with optimizing it in the 
opcode itself before calling PyUnicode_New.

Thanks for adding this, Serhiy. I think it's great stuff, and works well with 
FORMAT_VALUE.

--
assignee: eric.smith -> serhiy.storchaka

___
Python tracker 

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



[issue25596] Use scandir() to speed up the glob module

2016-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think the change in general is approved by GvR. If there are some 
implementation bugs, we can fix them later.

--

___
Python tracker 

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



[issue25596] Use scandir() to speed up the glob module

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cb7ee9d9cddd by Serhiy Storchaka in branch 'default':
Issue #25596: Optimized glob() and iglob() functions in the
https://hg.python.org/cpython/rev/cb7ee9d9cddd

--
nosy: +python-dev

___
Python tracker 

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



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

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8b74e5528f35 by Benjamin Peterson in branch 'default':
dtoa.c: remove code for platforms with 64-bit integers (#17884)
https://hg.python.org/cpython/rev/8b74e5528f35

--

___
Python tracker 

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



[issue24821] The optimization of string search can cause pessimization

2016-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please make a review Victor?

--

___
Python tracker 

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



[issue27905] Add documentation for typing.Type

2016-09-06 Thread Michael Lee

Michael Lee added the comment:

Ok, here's version 2, taking into account Ivan's feedback!

--
Added file: http://bugs.python.org/file44401/document-type-v2.patch

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4969f6d343b1 by Christian Heimes in branch 'default':
Issue #26798: Add BLAKE2 (blake2b and blake2s) to hashlib.
https://hg.python.org/cpython/rev/4969f6d343b1

--
nosy: +python-dev

___
Python tracker 

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



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

2016-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Include/pyport.h now includes both  and . But the 
 header shall include the  header. [1]

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html

--

___
Python tracker 

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



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

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c092eb31db05 by Benjamin Peterson in branch 'default':
only include inttypes.h (#17884)
https://hg.python.org/cpython/rev/c092eb31db05

--

___
Python tracker 

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



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

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset be8645213517 by Benjamin Peterson in branch 'default':
replace Python aliases for standard integer types with the standard integer 
types (#17884)
https://hg.python.org/cpython/rev/be8645213517

--

___
Python tracker 

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



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

2016-09-06 Thread STINNER Victor

STINNER Victor added the comment:

I dislike the idea of changing the behaviour in a minor release :-/

--

___
Python tracker 

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



[issue27980] Add better pythonw support to py launcher

2016-09-06 Thread Mark Summerfield

Mark Summerfield added the comment:

Sorry, I didn't even know that pyw.exe existed. Naturally pyw -h produces no 
output, but maybe py -h could mention it?

--

___
Python tracker 

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



[issue27981] Reference leak in fp_setreadl() of Parser/tokenizer.c

2016-09-06 Thread STINNER Victor

New submission from STINNER Victor:

Does the following function call leaks a reference?

if (PyObject_CallObject(readline, NULL) == NULL) {
readline = NULL;
goto cleanup;
}

--
messages: 274622
nosy: haypo
priority: normal
severity: normal
status: open
title: Reference leak in fp_setreadl() of Parser/tokenizer.c
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



  1   2   3   >