[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2017-09-08 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

This has been backported to 3.6.
Is backport to 2.7 needed? If not we'll close the issue.

--
stage: patch review -> backport needed

___
Python tracker 

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



[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2017-09-08 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset a4baf1c543bca261c27e98ba296e42665f3cb872 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-26669: Fix nan arg value error in pytime.c (GH-3085) (GH-3467) 
https://github.com/python/cpython/commit/a4baf1c543bca261c27e98ba296e42665f3cb872


--
nosy: +Mariatta

___
Python tracker 

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



[issue29505] Submit the re, json, & csv modules to oss-fuzz testing

2017-09-08 Thread Gregory P. Smith

Gregory P. Smith added the comment:

i'd rather make this work in oss-fuzz on cpython.  can you point me to how 
oss-fuzz works and what it wants to do so i can better understand what it needs?

it it has an expectation that the thing being fuzzed is a single binary with no 
data or directory tree layout dependencies that can just be plopped somewhere 
else is not a great assumption to make.

but environment variables _should_ be able to be set to point the python binary 
at what it needs if it must work that way.

--

___
Python tracker 

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



[issue20580] IDLE should support platform-specific default config defaults

2017-09-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I miswrote.  'Alt' becomes 'Option'. The new keybindings to be added to Classic 
Mac and Classic OSX in PR2494 are the following.

force-open-completions= 
expand-word= 
force-open-calltip= 
format-paragraph= 
flash-paren= 
run-module= 
check-module= 
zoom-height= 

This leaves B3, replacing missing definitions in user files with appropriate 
defaults.  The only solution I can see is to use the system-appropriate builtin 
from idlelib/config-key.def as the default instead of the current hard-coded 
keyset.  If that file cannot be read properly, either from disk fault or user 
editing, I think it better to stop than to use a keyset that will not 
necessarily be usable.

--

___
Python tracker 

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



[issue29396] Re-opening /dev/tty breaks readline

2017-09-08 Thread Martin Panter

Martin Panter added the comment:

I agree it would be good to document when the Readline library is invoked. Yes, 
the “readline‭” module is only designed to work with the original sys.stdin and 
sys.stdout. Python’s “open” function does not use  FILE objects, but 
Python does use  FILE objects internally for its Readline hook, and 
passes them to the Readline library. Python falls back to dumber 
implementations, which may not implement history nor completion, when it 
decides not to use Readline.

The “readline” module is implemented in Modules/readline.c and uses 
“rl_instream” 
 and 
“rl_outstream” to specify  FILE objects that the Readline library 
uses. These FILE objects are passed through the PyOS_ReadlineFunctionPointer 
hook 

 from the PyOS_Readline function in Parser/myreadline.c. They are required to 
be terminals (checked with the Posix “isatty” call).

The implementation of Python’s “input” function is in the “builtin_input” C 
function in Python/bltinmodule.c. Before calling PyOS_Readline, it requires 
that sys.stdin.fileno() and sys.stdout.fileno() match the  stdin and 
stdout FILE objects. It also does its own isatty checks.

You might have some luck calling “fopen” with the “ctypes” module, or writing 
your own Readline module, but it wouldn’t be straightforward. You might be able 
to fool the check by reopening file descriptors 0 and 1, but that seems rather 
hacky. Or you might rely on the OS to provide history and/or completion (I 
think the Windows console does this in a limited way), or an external Readline 
wrapper program (e.g. search for “rlwrap”).

--

___
Python tracker 

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



[issue31026] test_dbm fails when run directly

2017-09-08 Thread Brian Moyles

Brian Moyles added the comment:

Actually, I was able to make things happy by removing libdb5.3-dev and solely 
relying on libgdbm3-dev (which suggests that Debian upstream may want to pare 
back their build requirements rather than disable the dbm test as they appear 
to do now).

--

___
Python tracker 

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



[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2017-09-08 Thread STINNER Victor

STINNER Victor added the comment:

For Python 2.7, you have at least to fix these 2 functions: 
parse_time_double_args(),  _PyTime_DoubleToTimet().

--

___
Python tracker 

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



[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2017-09-08 Thread Roundup Robot

Changes by Roundup Robot :


--
keywords: +patch
pull_requests: +3460
stage: needs patch -> patch review

___
Python tracker 

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



[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2017-09-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 829dacce4fca60fc3c3367980e75e21dfcdbe6be by Victor Stinner (Han 
Lee) in branch 'master':
bpo-26669: Fix nan arg value error in pytime.c (#3085)
https://github.com/python/cpython/commit/829dacce4fca60fc3c3367980e75e21dfcdbe6be


--

___
Python tracker 

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



[issue31400] SSL module returns incorrect error codes on Windows

2017-09-08 Thread Steve Dower

Changes by Steve Dower :


--
stage: patch review -> backport needed

___
Python tracker 

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



[issue27815] Make SSL suppress_ragged_eofs default more secure

2017-09-08 Thread Alex Gaynor

Alex Gaynor added the comment:

Mmmm, my understanding is that ignoring TCP-FIN/RST-without-TLS-closenotify is 
pretty common for a lot of different clients.

We should probably survey the landscape, see what both browsers and non-browse 
clients (e.g. curl) do before making a decision.

--

___
Python tracker 

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



[issue31366] Missing terminator option when using readline with socketserver.StreamRequestHandler

2017-09-08 Thread Martin Panter

Martin Panter added the comment:

The socket.makefile(newline=...) parameter only affects text mode, but 
StreamRequestHandler’s “rfile” attribute works in byte mode. You could call 
makefile or TextIOWrapper yourself, but neither of these options support 
reading null-terminated “lines” or packets.

I think it would be best to implement this more generally, e.g. via Issue 
1152248 or Issue 17083. Perhaps like the “asyncio.StreamReader.readuntil” or 
“telnetlib.Telnet.read_until” methods, rather than a stream configuration 
option.

--
nosy: +martin.panter

___
Python tracker 

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



[issue27815] Make SSL suppress_ragged_eofs default more secure

2017-09-08 Thread STINNER Victor

STINNER Victor added the comment:

Martin: can you please create a pull request? It would be easier to review your 
change.

--

___
Python tracker 

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



[issue30871] Add test.pythoninfo

2017-09-08 Thread STINNER Victor

STINNER Victor added the comment:

pythoninfo is now available on all buildbots, including Python 2.7 VS9.0 
buildbots:
https://bugs.python.org/issue31260#msg301747

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

___
Python tracker 

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



[issue31260] [2.7] Enhance PC/VS9.0/ project to produce python.bat, as PCbuild/

2017-09-08 Thread STINNER Victor

STINNER Victor added the comment:

Zachary Ware added pythoninfo to buildbot VS9.0 builds:
https://github.com/python/buildmaster-config/commit/c1d51a791d63c5e7d05c160ba25babd302fefe83

--

___
Python tracker 

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



[issue30822] Python implementation of datetime module is not being tested correctly.

2017-09-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 3892799668dbf2b123a52780fd1d78f8880fdeb7 by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-30822: Deduplicate ZoneInfoTest classes in test_datetime. (GH-2534) 
(#3405)
https://github.com/python/cpython/commit/3892799668dbf2b123a52780fd1d78f8880fdeb7


--

___
Python tracker 

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



[issue31260] [2.7] Enhance PC/VS9.0/ project to produce python.bat, as PCbuild/

2017-09-08 Thread Zachary Ware

Zachary Ware added the comment:

I'd rather not go through the gymnastics to actually add python.bat creation to 
the VS9.0 config, so I'm closing this as rejected.  If someone else finds it 
useful and wants to provide a patch, I'll review and merge it.

--
resolution:  -> rejected
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



[issue31361] Update feedparser.py to prevent theano compiling fail in python3

2017-09-08 Thread Wei-Shun Lo

Wei-Shun Lo added the comment:

Correct some type :

Few of them are failed, listed as following, after change the c compiler to
be gcc-7, they can be fixed.
(Twisted av cymem cytoolz dulwich gnureadline pycrypto pydsm pycurl regex
reportlab setproctitle).

************************
************
* Contact Info*
 *US Mobile: 1-408-609-7628   *

Em
ail: rali...@gmail.com
Skype : ralic_lo
************************
************

On Fri, Sep 8, 2017 at 2:42 PM, Wei-Shun Lo  wrote:

>
> Wei-Shun Lo added the comment:
>
> After patching, I've tested installed packages listed in the pip3.update.
> The default c compiler used is clang.  Few of them are failed, listed as
> following, after change the c compiler to be gcc-7. (Twisted av cymem
> cytoolz dulwich gnureadline pycrypto pydsm pycurl regex reportlab
> setproctitle). PyAudio and mercurial needs additional support to get them
> installed.
> I hope this demonstrate the reliance of this change.
>
>   Running setup.py install for PyAudio ... error
>   Running setup.py install for Twisted ... error
>   Running setup.py install for av ... error
>   Running setup.py install for cymem ... error
>   Running setup.py install for cytoolz ... error
>   Running setup.py install for dulwich ... error
>   Running setup.py install for gnureadline ... error
>   Running setup.py install for mercurial ... error
>   Running setup.py install for pycrypto ... error
>   Running setup.py install for pycurl ... error
>   Running setup.py install for pydsm ... error
>   Running setup.py install for regex ... error
>   Running setup.py install for reportlab ... error
>   Running setup.py install for setproctitle ... error
>
> --
> Added file: https://bugs.python.org/file47128/pip3.update
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31294] ZeroMQSocketListener and ZeroMQSocketHandler examples in the Logging Cookbook not working

2017-09-08 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for your contribution. Your PR has been merged into 3.6 and master, 
which will become Python 3.7 eventually.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue31392] Upgrade installers to OpenSSL 1.1.0f

2017-09-08 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3459

___
Python tracker 

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



[issue31400] SSL module returns incorrect error codes on Windows

2017-09-08 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3458

___
Python tracker 

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



[issue31392] Upgrade installers to OpenSSL 1.1.0f

2017-09-08 Thread Christian Heimes

Christian Heimes added the comment:


New changeset e6eb48c10dc389d1d70657593de6a6cb3087d3d1 by Christian Heimes 
(Steve Dower) in branch 'master':
bpo-31400: Improve SSL error handling on Windows (#3463)
https://github.com/python/cpython/commit/e6eb48c10dc389d1d70657593de6a6cb3087d3d1


--

___
Python tracker 

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



[issue31400] SSL module returns incorrect error codes on Windows

2017-09-08 Thread Christian Heimes

Christian Heimes added the comment:


New changeset e6eb48c10dc389d1d70657593de6a6cb3087d3d1 by Christian Heimes 
(Steve Dower) in branch 'master':
bpo-31400: Improve SSL error handling on Windows (#3463)
https://github.com/python/cpython/commit/e6eb48c10dc389d1d70657593de6a6cb3087d3d1


--

___
Python tracker 

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



[issue29639] test suite intentionally avoids referring to localhost, destroying abstraction away from IPv6 vs IPv4

2017-09-08 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
keywords: +patch
pull_requests: +3457
stage:  -> patch review

___
Python tracker 

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



[issue17960] Clarify the required behaviour of locals()

2017-09-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Posted as PEP 558:

* https://github.com/python/peps/blob/master/pep-0558.rst
* https://www.python.org/dev/peps/pep-0558/

--

___
Python tracker 

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



[issue28182] Expose OpenSSL verification results in SSLError

2017-09-08 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 0915360b9ef765bf84d4471a8a079f48c49bad68 by Christian Heimes in 
branch 'master':
bpo-28182: restore backwards compatibility (#3464)
https://github.com/python/cpython/commit/0915360b9ef765bf84d4471a8a079f48c49bad68


--

___
Python tracker 

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



[issue31026] test_dbm fails when run directly

2017-09-08 Thread Brian Moyles

Brian Moyles added the comment:

I ran into the same problem when running the test suite against a fresh Python 
3.6.2 build on Ubuntu 16.04. It specifically appears to be a problem with ndbm 
and retrieving an empty byte string value:

Python 3.6.2 (default, Sep  8 2017, 18:31:28)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbm.gnu, dbm.ndbm
>>> g = dbm.gnu.open('gnudb', 'c')
>>> g['0'.encode('ascii')] = b''
>>> g.keys()
[b'0']
>>> g['0'.encode('ascii')]
b''
>>>
>>> n = dbm.ndbm.open('ndbm', 'c')
>>> n['0'.encode('ascii')] = b''
>>> n.keys()
[b'0']
>>> n['0'.encode('ascii')]
Traceback (most recent call last):
  File "", line 1, in 
KeyError: b'0'

Same behavior when using the distribution's stock Python 3.5.2 so I suspect 
there's a behavioral change in libdb that's not accounted for?

--
nosy: +bmoyles

___
Python tracker 

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



[issue31361] Update feedparser.py to prevent theano compiling fail in python3

2017-09-08 Thread Wei-Shun Lo

Wei-Shun Lo added the comment:

After patching, I've tested installed packages listed in the pip3.update. 
The default c compiler used is clang.  Few of them are failed, listed as 
following, after change the c compiler to be gcc-7. (Twisted av cymem cytoolz 
dulwich gnureadline pycrypto pydsm pycurl regex reportlab setproctitle). 
PyAudio and mercurial needs additional support to get them installed. 
I hope this demonstrate the reliance of this change.

  Running setup.py install for PyAudio ... error  
  Running setup.py install for Twisted ... error
  Running setup.py install for av ... error
  Running setup.py install for cymem ... error
  Running setup.py install for cytoolz ... error
  Running setup.py install for dulwich ... error
  Running setup.py install for gnureadline ... error
  Running setup.py install for mercurial ... error
  Running setup.py install for pycrypto ... error
  Running setup.py install for pycurl ... error
  Running setup.py install for pydsm ... error
  Running setup.py install for regex ... error
  Running setup.py install for reportlab ... error
  Running setup.py install for setproctitle ... error

--
Added file: https://bugs.python.org/file47128/pip3.update

___
Python tracker 

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



[issue29631] Error “importlib.h, importlib_external.h updated. You will need to rebuild pythoncore to see the changes.” is reported when build Python on Winodws

2017-09-08 Thread Zachary Ware

Zachary Ware added the comment:

Hi Karen,

You may have already noticed that this has been fixed since you reported it; 
sorry it's taken so long for anybody to reply!  The issue was that importlib.h 
and importlib_external.h (generated files) were not checked in when their 
source files were changed, as is our convention for those files.  We have since 
enabled pre-merge CI to check this sort of thing.

--
nosy: +zach.ware
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



[issue28182] Expose OpenSSL verification results in SSLError

2017-09-08 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3456

___
Python tracker 

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



[issue22986] Improved handling of __class__ assignment

2017-09-08 Thread Eric Snow

Eric Snow added the comment:

The gmane link isn't working for me.  Here's the mailing list archive thread:

https://mail.python.org/pipermail/python-dev/2014-November/thread.html#137262
https://mail.python.org/pipermail/python-dev/2014-December/thread.html#137370

--

___
Python tracker 

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



[issue28791] update sqlite to latest version before beta 1

2017-09-08 Thread Zachary Ware

Zachary Ware added the comment:

In an effort to not forget about this, I'm setting it to deferred blocker.

--
priority: normal -> deferred blocker
title: update sqlite to 3.19.2 -> update sqlite to latest version before beta 1

___
Python tracker 

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



[issue30860] Consolidate stateful C globals under a single struct.

2017-09-08 Thread Eric Snow

Eric Snow added the comment:

FYI, the merged code introduced a bunch of new warnings on Windows.  I'm 
looking into it.

--

___
Python tracker 

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



[issue31400] SSL module returns incorrect error codes on Windows

2017-09-08 Thread Steve Dower

Changes by Steve Dower :


--
keywords: +patch
pull_requests: +3455

___
Python tracker 

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



[issue31401] Dynamic compilation that uses function in comprehension fails when compiled inside function

2017-09-08 Thread Jose Cambronero

New submission from Jose Cambronero:

Execution fails with NameError when trying to dynamically compile a Python 
program that uses a function in a comprehension, and the code is compiled 
inside a function call, rather than as a global statement.

Using the attached files to reproduce (in reproduce.zip):

python3 compile_in_function.py comprehension.py #fails
python3 compile_global.py comprehension.py # works
python2 compile_in_function.py comprehension.py #works with Python 2.7.12

--
files: reproduce.zip
messages: 301734
nosy: jpc
priority: normal
severity: normal
status: open
title: Dynamic compilation that uses function in comprehension fails when 
compiled inside function
type: compile error
versions: Python 3.6
Added file: https://bugs.python.org/file47127/reproduce.zip

___
Python tracker 

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



[issue31400] SSL module returns incorrect error codes on Windows

2017-09-08 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +alex, christian.heimes, dstufft, janssen

___
Python tracker 

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



[issue31400] SSL module returns incorrect error codes on Windows

2017-09-08 Thread Steve Dower

New submission from Steve Dower:

Because we wait so long between errors occurring and being reported, 
information about the Windows error code (WSAGetLastError) has already been 
lost.

We should capture all the info sooner.

--
assignee: steve.dower
components: SSL
messages: 301733
nosy: steve.dower
priority: normal
severity: normal
stage: patch review
status: open
title: SSL module returns incorrect error codes on Windows
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue31399] Let OpenSSL verify hostname and IP address

2017-09-08 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
pull_requests: +3454

___
Python tracker 

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



[issue31399] Let OpenSSL verify hostname and IP address

2017-09-08 Thread Christian Heimes

New submission from Christian Heimes:

Python should no longer attempt to verify hostname and ip addresses itself. 
OpenSSL 1.0.2 and newer is able to verify hostname and IP addresses itself. The 
new APIs are properly hooked into chain validation step. Hostname matching 
implements RFC 6125. CN matching and partial wildcards can be tuned with 
additional. The API is documented here: 
https://www.openssl.org/docs/man1.0.2/crypto/X509_VERIFY_PARAM_set1_host.html . 
X509_VERIFY_PARAM_set1_host is available since OpenSSL 1.0.2. LibreSSL 2.5.3+ 
implement the proper bits and pieces, too.


Why should we use OpenSSL rather than matching hostnames ourselves?

In the past, OpenSSL did not contain any code to perform host name
matching. Application were required to role their own implementation.
This caused code duplication and various security issues, because
it is far from trivial to cover all edge cases. Python had multiple
security issues just caused by incorrect or buggy hostname matching:

* Until Python 3.2 and 2.7.9, the ssl module was not capable of
  performing host name matching. ``ssl.match_hostname()`` was
  introduced in 3.2.0 and later back-ported to 2.7.9.
* Issue #12000: Subject CN was ignored when a subject alternative
  name extension (SAN) was present without dNSName entries, thus
  violating RFC 2818.
* CVE-2013-2099: Multiple wildcard characters could be abused
  for Denial-of-Service attack in the re module.
* Issue #17997: RFC 2818 was superseded by RFC 6125, which no longer
  allows multiple wildcard characters. Wildcards are only supported
  in the left-most label.
* Issue #17997: ``ssl.match_hostname()`` did not implement partial
  wildcards of international domain names correctly.
* Issue #18709: The ssl module used an inappropriate OpenSSL function
  to convert host names from ASN.1 to strings. A host name with an
  embedded NULL byte could be abused to trick validation.
* Issue #17305: The ssl module does not handle IDNA 2008-encoded
  host names correctly. It converts from IDN A-label (ASCII
  compatible encoding) to IDN U-label (unicode) with Python's idna
  encoding, which is IDNA 2003-only.
* Issue #30141: The host name is not verified when a SSLSocket is
  created with ``do_handshake_on_connect=False`` and the application
  causes an implicit handshake w/o calling do_handshake() explicitly.
* A SSLSocket performs host name matching *after* the handshake and
  during the handshake. In case of an invalid host name, a client
  is suppose to abort the connection with appropriate TLS alert.
  This causes two problem. For one the server is not informed about
  a problem with the certificate. Also an invalid host name does not
  prevent the client from sending a TLS client authentication
  cert to a malicious server. The cert typically contains personal
  information like username and department.

--
assignee: christian.heimes
components: SSL
messages: 301731
nosy: christian.heimes
priority: high
severity: normal
stage: patch review
status: open
title: Let OpenSSL verify hostname and IP address
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29505] Submit the re, json, & csv modules to oss-fuzz testing

2017-09-08 Thread Devin Jeanpierre

Devin Jeanpierre added the comment:

So here's an interesting issue: oss-fuzz requires that the built location be 
movable. IOW, we build Python into $OUT, and then the $OUT directory gets moved 
somewhere else and the fuzz test gets run from there. This causes problems 
because Python can no longer find where the modules it needs are (encodings for 
example).

First thought: wouldn't it be nice if we could make a prepackaged and hermetic 
executable that we can move around freely?

Second thought: isn't that "Hermetic Python", as used within Google?

Third thought: doesn't Google have an internal fuzz testing environment we can 
use, instead of oss-fuzz?

So unless someone says this is a bad idea, I'd propose we not run these in 
oss-fuzz and instead run them in Google proper. The alternative is if there's a 
way to make it easy to move Python around -- is there a way to build it s.t. 
the import path is relative and so on?

--

___
Python tracker 

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



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-08 Thread sds

sds added the comment:

the problem is not present in 
Python 3.6.2 (default, Jul 17 2017, 16:44:45):
```
>>> import dbm
>>> import dbm.gnu
>>> db = dbm.gnu.open("foo","c")
>>> "a" in db
False
>>> u"a" in db
False
```

--

___
Python tracker 

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



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-08 Thread sds

New submission from sds:

`in` and `has_key` have different behavior for Unicode keys for `gdbm` in 2.7:
```
>>> import gdbm
>>> db = gdbm.open("foo.gdbm","c")
>>> db.has_key("a")
0
>>> db.has_key(u"a")
0
>>> "a" in db
False
>>> u"a" in db
Traceback (most recent call last):
  File "", line 1, in 
TypeError: gdbm key must be string, not unicode
```

--
components: Unicode
messages: 301728
nosy: ezio.melotti, haypo, sam-s
priority: normal
severity: normal
status: open
title: TypeError: gdbm key must be string, not unicode
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-08 Thread sds

sds added the comment:

platform:
Python 2.7.13 (default, Jul 18 2017, 09:17:00) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin

--

___
Python tracker 

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



[issue31397] does not work import in Python 3.6.2

2017-09-08 Thread Бобёр Сатанист

New submission from Бобёр Сатанист:

How to import modules/files in Python 3.6.2? I started to study python, in the 
section about importing modules, here is an example: I created a text file with 
the text "print('Hello module world!')" and saved it with the name 
"module1.py". I put the file in a folder with a python. As stated in the book, 
simply entering 
"import module1" python imports the contents of the file, wherever it is on the 
computer, or it can be executed with the command "python module1".

In short, the method does not work on version 3.6.2,when i tried to import 
file, python did not find the file, neither through calling the Python 
interpreter from the command line, nor through IDLE. Error module not found 
error, and with the command 
"python  module1" - syntax error.

PATH on my computer is configured.Windows 10 ver.1703 x64,Python 3.6.2 x64

--
files: 1.jpg
messages: 301727
nosy: Бобёр Сатанист
priority: normal
severity: normal
status: open
title: does not work import in Python 3.6.2
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47126/1.jpg

___
Python tracker 

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



[issue31388] Provide a way to defer SIGINT handling in the current thread

2017-09-08 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Sure, but whatever overhead it has, it has. Once we're paying for it, new keys 
are free (at yield/resume time).

Compared to a bare thread-local it probably has somewhat higher overhead when 
we have to check it, but (a) that's why PEP 550 has a clever caching mechanism, 
and (b) you don't have to check it until you have a pending signal, and you 
almost never have a pending signal.

Anyway, we can wait until PEP 550 settles down before making any commitment 
here...

--

___
Python tracker 

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



[issue31361] Update feedparser.py to prevent theano compiling fail in python3

2017-09-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks to me as a bug in keras and theano. And may be in pip. Please file 
bug reports on corresponding bug trackers.

--
resolution:  -> third party
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



[issue31394] Ellipsis_token.type != token.ELLIPSIS

2017-09-08 Thread Berker Peksag

Berker Peksag added the comment:

Thank you for your detailed response, Aivar. I agree that adding 'and Ellipsis' 
would make the tokenize documentation clearer. Would you like to send a pull 
request?

--
keywords: +easy
type:  -> enhancement

___
Python tracker 

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



[issue31361] Update feedparser.py to prevent theano compiling fail in python3

2017-09-08 Thread Wei-Shun Lo

Wei-Shun Lo added the comment:

Bug encountered while installing multiple packages : 
1. keras
2. theano

Error Information : 
 ~/work/bottles @ dojos-MacBook-Pro (dojo)  
|=> pip3 install keras
Requirement already satisfied: keras in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: scipy>=0.14 in 
/usr/local/lib/python3.6/site-packages (from keras)
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/basecommand.py", line 215, 
in main
status = self.run(options, args)
  File "/usr/local/lib/python3.6/site-packages/pip/commands/install.py", line 
335, in run
wb.build(autobuilding=True)
  File "/usr/local/lib/python3.6/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 380, 
in prepare_files
ignore_dependencies=self.ignore_dependencies))
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 666, 
in _prepare_file
check_dist_requires_python(dist)
  File "/usr/local/lib/python3.6/site-packages/pip/utils/packaging.py", line 
48, in check_dist_requires_python
feed_parser.feed(metadata)
  File 
"/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/feedparser.py",
 line 175, in feed
self._input.push(data)
  File 
"/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/feedparser.py",
 line 103, in push
self._partial.write(data)
TypeError: string argument expected, got 'NoneType'

 ~/work/bottles @ dojos-MacBook-Pro (dojo)  
|=> pip3 install theano
Collecting theano
  Downloading Theano-0.9.0.tar.gz (3.1MB)
100% || 3.1MB 353kB/s 
Requirement already satisfied: numpy>=1.9.1 in 
/usr/local/lib/python3.6/site-packages (from theano)
Requirement already satisfied: scipy>=0.14 in 
/usr/local/lib/python3.6/site-packages (from theano)
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/basecommand.py", line 215, 
in main
status = self.run(options, args)
  File "/usr/local/lib/python3.6/site-packages/pip/commands/install.py", line 
335, in run
wb.build(autobuilding=True)
  File "/usr/local/lib/python3.6/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 380, 
in prepare_files
ignore_dependencies=self.ignore_dependencies))
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 666, 
in _prepare_file
check_dist_requires_python(dist)
  File "/usr/local/lib/python3.6/site-packages/pip/utils/packaging.py", line 
48, in check_dist_requires_python
feed_parser.feed(metadata)
  File 
"/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/feedparser.py",
 line 175, in feed
self._input.push(data)
  File 
"/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/feedparser.py",
 line 103, in push
self._partial.write(data)
TypeError: string argument expected, got 'NoneType'

--

___
Python tracker 

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



[issue31354] Fixing a bug related to LTO only build

2017-09-08 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2017-09-08 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Here's the patch I mentioned: 
https://github.com/njsmith/cpython/commit/62547dc5ea323a07c25c2047636a02241f518013

It has a crude but effective technique for handling the hanging issue :-). 
Alternatively one could use the World's Stupidest Coroutine Runner:

def run(coro):
try:
coro.send(None)
except StopIteration:
pass
else:
raise RuntimeError("yielded")

> I'm also wondering how far we might be able to get by adjusting the pending 
> signal processing such that we always execute at least one line from a 
> function before checking for pending signals

Huh, that's a neat idea. I think it's defeated by 'while True: pass', though 
:-(. (You have to write it on two lines, but it compiles down to a single 
instruction that jumps to itself.)

--

___
Python tracker 

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



[issue31354] Fixing a bug related to LTO only build

2017-09-08 Thread Gregory P. Smith

Gregory P. Smith added the comment:


New changeset 4c81401b3a9ffa48fc9e19963cbad5111e33 by Gregory P. Smith 
(octaviansoldea) in branch 'master':
bpo-31354: Let configure --with-lto work on all builds
https://github.com/python/cpython/commit/4c81401b3a9ffa48fc9e19963cbad5111e33


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2017-09-08 Thread Nick Coghlan

Nick Coghlan added the comment:

This is being proposed for the gc module, not contextlib, so I'm not sure how 
the previous comment applies.

This is just a convenience API for folks already doing this kind of 
manipulation themselves.

--

___
Python tracker 

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



[issue28182] Expose OpenSSL verification results in SSLError

2017-09-08 Thread Christian Heimes

Christian Heimes added the comment:

The ssl module now reports cause of validation failure:

>>> import ssl
>>> import ssl, socket
>>> ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
>>> sock = ctx.wrap_socket(socket.socket(), server_hostname='www.python.org')
>>> sock.connect(('www.python.org', 443))
Traceback (most recent call last):
...
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate 
verify failed: unable to get local issuer certificate (_ssl.c:825)

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



[issue28182] Expose OpenSSL verification results in SSLError

2017-09-08 Thread Christian Heimes

Christian Heimes added the comment:


New changeset b3ad0e5127bdeb6e506301e0d65403fa23c4177b by Christian Heimes in 
branch 'master':
bpo-28182: Expose OpenSSL verification results (#3412)
https://github.com/python/cpython/commit/b3ad0e5127bdeb6e506301e0d65403fa23c4177b


--

___
Python tracker 

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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2017-09-08 Thread Nick Coghlan

Nick Coghlan added the comment:

I updated the PR at https://github.com/ncoghlan/cpython/pull/2/files with 
another attempt at reinstating the asynchronous CM test case that also tweaks 
the eval loop to ensure that the first few opcodes in a function are always 
executed before pending calls are checked.

This version highlights why I think asyncio really needs work before the async 
behaviour can be tested robustly in the standard library: it *hangs* somewhere 
in _asyncio.TaskStepMethWrapper once pending call handling is deferred long 
enough for the __aexit__ method to actually finish.

--

___
Python tracker 

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



[issue27354] SSLContext.load_verify_locations cannot handle paths on Windows which cannot be encoded using mbcs

2017-09-08 Thread STINNER Victor

STINNER Victor added the comment:

>> On Python 3.5, PyUnicode_FSConverter() uses MBCS, which is CP-1552 on your 
>> system.
>
> Will the behavior of Python 3.6 be different? Could you point me to relevant 
> notes or code?

See the PEP 529.

--

___
Python tracker 

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



[issue27354] SSLContext.load_verify_locations cannot handle paths on Windows which cannot be encoded using mbcs

2017-09-08 Thread Ilya Kulakov

Ilya Kulakov added the comment:

> On Python 3.5, PyUnicode_FSConverter() uses MBCS, which is CP-1552 on your 
> system.

Will the behavior of Python 3.6 be different? Could you point me to relevant 
notes or code?

> If I understood correctly, it's possible to work around the issue by encoding 
> the filename manually to utf-8.

That's correct. I'm not sure that this is true for all versions though.

--

___
Python tracker 

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



[issue27354] SSLContext.load_verify_locations cannot handle paths on Windows which cannot be encoded using mbcs

2017-09-08 Thread STINNER Victor

STINNER Victor added the comment:

> I'm closing this issue was WONTFIX 3.5

If I understood correctly, it's possible to work around the issue by encoding 
the filename manually to utf-8.

ssl_function(filename.encode('utf-8'))

--

___
Python tracker 

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



[issue31394] Ellipsis_token.type != token.ELLIPSIS

2017-09-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I think we should add 'and Ellipsis' in the tokenize doc to get
'all Operators and Delimiters tokens and Ellipsis are returned ...'.  I would 
actually prefer 'Operator and Delimiter tokens' but I don't know if the 's' is 
needed to trigger the current linkage.

--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python, terry.reedy
stage: resolved -> needs patch
versions: +Python 3.7 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-09-08 Thread Zachary Ware

Zachary Ware added the comment:


New changeset 1911cf3dd2ae67d600c166ba52872fdcf3e85824 by Zachary Ware in 
branch '2.7':
[2.7] bpo-30450: Fall back on the old env.bat (GH-3443)
https://github.com/python/cpython/commit/1911cf3dd2ae67d600c166ba52872fdcf3e85824


--

___
Python tracker 

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



[issue27815] Make SSL suppress_ragged_eofs default more secure

2017-09-08 Thread Christian Heimes

Christian Heimes added the comment:

I don't consider myself qualified enough to make a decision. Alex, Victor, what 
do you think?

--
assignee: christian.heimes -> 
nosy: +alex, haypo

___
Python tracker 

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



[issue25404] ssl.SSLcontext.load_dh_params() does not handle unicode filenames properly

2017-09-08 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
pull_requests: +3453

___
Python tracker 

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



[issue25404] ssl.SSLcontext.load_dh_params() does not handle unicode filenames properly

2017-09-08 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee:  -> christian.heimes
keywords:  -patch

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2017-09-08 Thread Josh Rosenberg

Josh Rosenberg added the comment:

I'd be -1 on this without a demonstrated broad need for this in at least some 
context outside of microbenchmarking utilities (which presumably have already 
implemented similar stuff).

If a minimum bar for applicability isn't applied, we'll end up with dozens of 
these special purpose managers justified by the last limited applicability one. 
Stuff like contextlib.closing is justifiable (though I wish it allowed you to 
replace the method name called, so it could call terminate, kill, release, 
what-have-you) since cleanup close is so common, but disabling and reenabling 
gc is usually for timing purposes, and there aren't *that* many tools that need 
it.

It doesn't seem all that useful for real time purposes either; sure, it 
disables gc, but it doesn't disable other forms of implicit non-local code 
execution that are surprisingly hard to predict (e.g. object destruction, 
including __del__, for non-cyclic cases is going to depend on whether the stuff 
being decref-ed is still owned outside the block). Disabling GC means a lot in 
Java, because *all* cleanup is GC; in Python, it's just cycle collection, so 
you're not giving much in the way of guarantees, as the code in question has to 
be written with a *lot* of assumptions that Python usually can't support (it's 
hardly a realtime language).

Seems like if you want a speed up and reliability for this case (and all other 
context managers intended to be low overhead), it would be better to move parts 
of contextlib to the C layer (e.g. contextmanager and the classes it's 
implemented in terms of), so the simple and correct throwaway implementations 
for arbitrary custom use cases are fast enough; atomicity clearly doesn't 
actually matter here (it can't be made atomic in any meaningful sense given the 
lack of thread safety), so any real problem with the provided implementations 
(assuming they had try/finally added to make them robust) is overhead, not 
atomicity; the code posted so far would be fine (after adding try/finally) 
without the speed issues.

--
nosy: +josh.r

___
Python tracker 

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



[issue31036] building the python docs requires the blurb module

2017-09-08 Thread Ned Deily

Ned Deily added the comment:


New changeset 9cc332094c5f8cbaa47400633ab3ba372da61c9d by Ned Deily in branch 
'3.5':
[3.5] bpo-31036: Allow sphinx and blurb to be found automatically (GH-3440)
https://github.com/python/cpython/commit/9cc332094c5f8cbaa47400633ab3ba372da61c9d


--

___
Python tracker 

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



[issue27354] SSLContext.load_verify_locations cannot handle paths on Windows which cannot be encoded using mbcs

2017-09-08 Thread Christian Heimes

Christian Heimes added the comment:

Ilya,

The exception "TypeError: cafile should be a valid filesystem path" is raised 
by Python, not by OpenSSL. On Python 3.5, PyUnicode_FSConverter() uses MBCS, 
which is CP-1552 on your system. CP-1552 cannot convert Arabic character set 
and fails to encode your user name to bytes. This issue has been addressed by 
PEP 529 in Python 3.6. Starting with Python 3.6, the file system encoding is 
UTF-8, see https://www.python.org/dev/peps/pep-0529/

3.5 is in security fix-only mode. You either have to keep encoding the path as 
UTF-8 explicitly or update to Python 3.6. I'm closing this issue was WONTFIX 
3.5 and FIXED >= 3.6.

--
assignee: steve.dower -> christian.heimes
resolution:  -> fixed

___
Python tracker 

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



[issue27354] SSLContext.load_verify_locations cannot handle paths on Windows which cannot be encoded using mbcs

2017-09-08 Thread Christian Heimes

Changes by Christian Heimes :


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



[issue30860] Consolidate stateful C globals under a single struct.

2017-09-08 Thread Eric Snow

Changes by Eric Snow :


--
keywords: +patch
pull_requests: +3452

___
Python tracker 

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



[issue31394] Ellipsis_token.type != token.ELLIPSIS

2017-09-08 Thread Aivar Annamaa

Aivar Annamaa added the comment:

(Sorry, I didn't mean to challenge the authority of a core developer. I simply 
didn't notice that adding a comment reopens the issue. I hope this time I 
selected correct parameters and this doesn't happen again)

I'm trying to rephrase my concern. 

Initially I thought there was a mistake in the tokenizer or in the token module.

After you pointed out the documentation about token.OP and exact_type, I'm 
worried about a smaller detail. The documentation only talks about *operators* 
and *delimiters* having type attribute set to token.OP. According to my 
understanding (and also the listings at 
https://docs.python.org/3/reference/lexical_analysis.html#operators), ellipsis 
is neither operator nor delimiter. 

Am I right about this? 

(I understand that the source representation of both ELLIPSIS and DOT tokens 
contains period *character(s)*, but I don't see why is this relevant when we 
discuss the properties of *tokens*)

Anyway, if ellipsis is neither operator nor delimiter, (and if there is a 
reason why it is treated similarly with operators and delimiters) then I 
recommend to update the documentation by replacing 

> all Operators and Delimiters tokens 
> are returned using the generic token.OP token type

with 

> all Operators, Delimiters and Ellipsis tokens
> are returned using the generic token.OP token type


(I understand, that this is not a serious issue. If you prefer not to discuss 
it further then I'm happy to leave it as it is.)

--

___
Python tracker 

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



[issue30389] distutils._msvccompiler cannot find VS 2017

2017-09-08 Thread STINNER Victor

STINNER Victor added the comment:

Python 3.6 is also impacted:
http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.6/builds/104

--

___
Python tracker 

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



[issue31388] Provide a way to defer SIGINT handling in the current thread

2017-09-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 08/09/2017 à 19:27, Nathaniel Smith a écrit :
> 
> This seems a bit pointless if we have context local state available though, 
> because using context local state adds zero overhead to yields, and we yield 
> approximately 10,000,000x more frequently than we receive SIGINT.

But what overhead does context local state add to ceval.c?
Of course, we don't have the answer until Yuri actually submits an
implementation, but I'm not sure it can be as light-weight as currently.

--

___
Python tracker 

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



[issue31388] Provide a way to defer SIGINT handling in the current thread

2017-09-08 Thread Nathaniel Smith

Nathaniel Smith added the comment:

... it's true I did write such an example. And a few lines up in the same 
message I wrote an example where I was protecting an event loop from 
interrupts. In both cases the tricky question is how to manage the transitions 
between protected and unprotected without race conditions. Context-local state 
is a great solution for part of this problem.

I did realize this morning that technically it is *possible* to make a plain 
thread local work: you have to move all the state management into task context. 
So each time you start a task, wrap it in a helper that enables interrupts, and 
in early lowest level function that yields, reenable interrupts. This seems a 
bit pointless if we have context local state available though, because using 
context local state adds zero overhead to yields, and we yield approximately 
10,000,000x more frequently than we receive SIGINT.

--

___
Python tracker 

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



[issue31396] Configure and make will fail with enabling --with-pydebug

2017-09-08 Thread Christian Heimes

Christian Heimes added the comment:

You have to restart with a clean checkout. Either run ``make distclean`` or 
``git clean -xdf`` to get rid of all build files.

--
nosy: +christian.heimes
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



[issue31396] Configure and make will fail with enabling --with-pydebug

2017-09-08 Thread Zhenqing Hu

New submission from Zhenqing Hu:

When I updated the source code into the latest version, and configure as well 
as build with following command:
./configure --with-pydebug && make -j4
Build will fail with following error message:
==
Could not import runpy module
Traceback (most recent call last):
  File "/home/kevin/research/openSource/cpython/Lib/runpy.py", line 14, in 

import importlib.machinery # importlib first so we can test #15386 via -m
  File "/home/kevin/research/openSource/cpython/Lib/importlib/__init__.py", 
line 57, in 
import types
  File "/home/kevin/research/openSource/cpython/Lib/types.py", line 175, in 

import functools as _functools
  File "/home/kevin/research/openSource/cpython/Lib/functools.py", line 21, in 

from collections import namedtuple
  File "/home/kevin/research/openSource/cpython/Lib/collections/__init__.py", 
line 32, in 
from reprlib import recursive_repr as _recursive_repr
  File "/home/kevin/research/openSource/cpython/Lib/reprlib.py", line 7, in 

from _thread import get_ident
ModuleNotFoundError: No module named '_thread'
generate-posix-vars failed
Makefile:561: recipe for target 'pybuilddir.txt' failed
make: *** [pybuilddir.txt] Error 1
==

--
components: Build
messages: 301701
nosy: huzq85
priority: normal
severity: normal
status: open
title: Configure and make will fail with enabling --with-pydebug
type: compile error
versions: Python 3.7

___
Python tracker 

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



[issue28638] Optimize namedtuple creation

2017-09-08 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Side-note: Some of the objections to a C level namedtuple implementation appear 
to be based on the maintenance hurdle, and other have noted that a 
structseq-based namedtuple might be an option. I have previously attempted to 
write a C replacement for namedtuple that dynamically created a StructSequence. 
I ran into a roadblock due to PyStructSequence_NewType (the API that exists to 
allow creation of runtime defined structseq) being completely broken (#28709).

If the struct sequence API was fixed, it should be a *lot* easier to implement 
a C level namedtuple with minimal work, removing (some) of the maintenance 
objections by simply reducing the amount of custom code involved.

The testnewtype.c code attached to #28709 (that demonstrates the bug) is 66 
lines of code, and implements a basic C level namedtuple creator function (full 
support omitted for brevity, but aside from _source, most of it would be easy). 
I'd expect a finished version to be low three digit lines of custom code, a 
third or less of what the cnamedtuple project needed to write the whole thing 
from scratch.

--
nosy: +josh.r

___
Python tracker 

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



[issue31395] Docs Downloads are 404s

2017-09-08 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +ned.deily

___
Python tracker 

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



[issue31395] Docs Downloads are 404s

2017-09-08 Thread Nathan Henrie

New submission from Nathan Henrie:

Please see my (closed) issue, I was told to resubmit here. 
https://github.com/python/pythondotorg/issues/1140

Basically, I usually download a local copy of the epub and HTML docs so I can 
reference offline (and faster using the "custom search engine" feature of 
several modern browsers). Tried to download 3.6.2 and noticed I was getting a 
404: https://docs.python.org/3/archives/python-3.6.2-docs-html.zip

Testing the other links on the page, looks like most are down:

```shell_session
$ curl -s https://docs.python.org/3/download.html | grep -o '"archives/.*"' | 
xargs -I{} bash -c 'echo; url="https://docs.python.org/3/{};; echo "${url}"; c
url -s -I "${url}" | head -n 1'

https://docs.python.org/3/archives/python-3.6.2-docs-pdf-letter.zip
HTTP/1.1 404 Not Found

https://docs.python.org/3/archives/python-3.6.2-docs-pdf-letter.tar.bz2
HTTP/1.1 200 OK

https://docs.python.org/3/archives/python-3.6.2-docs-pdf-a4.zip
HTTP/1.1 404 Not Found

https://docs.python.org/3/archives/python-3.6.2-docs-pdf-a4.tar.bz2
HTTP/1.1 404 Not Found

https://docs.python.org/3/archives/python-3.6.2-docs-html.zip
HTTP/1.1 404 Not Found

https://docs.python.org/3/archives/python-3.6.2-docs-html.tar.bz2
HTTP/1.1 404 Not Found

https://docs.python.org/3/archives/python-3.6.2-docs-text.zip
HTTP/1.1 404 Not Found

https://docs.python.org/3/archives/python-3.6.2-docs-text.tar.bz2
HTTP/1.1 404 Not Found

https://docs.python.org/3/archives/python-3.6.2-docs.epub
HTTP/1.1 404 Not Found
```

I looked to see if this was an existing issue, sorry if it's a duplicate.

--
assignee: docs@python
components: Documentation
messages: 301699
nosy: docs@python, n8henrie
priority: normal
severity: normal
status: open
title: Docs Downloads are 404s

___
Python tracker 

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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2017-09-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Yeah, I was already thinking the lookaside table might be a better idea 
(similar to co_lnotab replacing the old SET_LINENO opcodes), especially since 
that would also provide a quick way of introspecting code objects to see if 
they included any try/finally constructs. The special case was just a quick 
check to see if the problem was what I thought it was.

That's also a good point regarding __aexit__ (I figured out that was the 
problem in the sync case, but hadn't realised it also applied to the async 
case), so I'll restore those tests and opcode updates.

I'm also wondering how far we might be able to get by adjusting the pending 
signal processing such that we always execute at least one line from a function 
before checking for pending signals (that should be enough to protect the 
test's __aexit__, and it would also be enough to get inside a with statement 
that guarded a function body against signals).

--

___
Python tracker 

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



[issue29136] Add OP_NO_TLSv1_3

2017-09-08 Thread Christian Heimes

Changes by Christian Heimes :


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

___
Python tracker 

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



[issue31394] Ellipsis_token.type != token.ELLIPSIS

2017-09-08 Thread Berker Peksag

Berker Peksag added the comment:

Please don't reopen an issue if it was closed by a core developer.

It's not clear to me what exactly do you want to change in the implementation 
or documentation.

 A sequence of three periods has a special meaning as an ellipsis literal.

is literally describes how the ELLIPSIS token is identified in 
Parser/tokenizer.c (see PyToken_ThreeChars in that file) So a sequence of three 
periods is identified as an ellipsis literal which is an expression in Python.

Do you want to change tokenize.tokenize() (it's in Lib/tokenize.py) so it will 
return

TokenInfo(type=52 (ELLIPSIS), ...)

instead of

TokenInfo(type=53 (OP), ...)

? Note that ELLIPSIS has been added to tokenize.EXACT_TOKEN_TYPES in issue 
24622. To me, since it has been added to tokenize.EXACT_TOKEN_TYPES there is no 
need to special case ELLIPSIS in Lib/tokenize.py.

Or do you want to clarify

To simplify token stream handling, all Operators and Delimiters tokens are 
returned using the generic token.OP token type.

at https://docs.python.org/3/library/tokenize.html?

--

___
Python tracker 

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



[issue30403] PEP 547: Running extension modules using -m switch

2017-09-08 Thread Marcel Plch

Marcel Plch added the comment:

I have made a patch both for cython and cpython implementing a way to use 
Py_mod_create in cython.

Basically module def that specifies a new "Py_mod_cython" slot are excluded 
from the rule of no module creation, so these modules can be executed directly 
even though they specify Py_mod_create.

Is this approach safe or does it make easy for things to go wrong?

cpython - 
https://github.com/Traceur759/cpython/commit/51a7508d176b23dcf3547b970cf7e6a50898aae2

cython - 
https://github.com/Traceur759/cython/commit/2ca706e10f469cd38947eecd8b92c142532b20bc

--

___
Python tracker 

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



[issue15670] PEP 3121, 384 Refactoring applied to ssl module

2017-09-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

PyType_FromSpec provides a rather neat way to initialize C extension types.  
However, there are a couple of pitfalls to look out for:

https://bugs.python.org/issue16690
https://bugs.python.org/issue26979

--
nosy: +pitrou

___
Python tracker 

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



[issue31394] Ellipsis_token.type != token.ELLIPSIS

2017-09-08 Thread Aivar Annamaa

Aivar Annamaa added the comment:

But ellipsis is a distinct token, not a sequence of three period tokens.

Also, I can't see how we could conceptually treat ellipsis as a delimiter or 
operator -- it's a literal.

I still think either documentation or implementation needs to be fixed here.

--
resolution: not a bug -> 
status: closed -> open
title: Ellipsis token.type != token.ELLIPSIS -> Ellipsis_token.type != 
token.ELLIPSIS
type: behavior -> 

___
Python tracker 

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



[issue31388] Provide a way to defer SIGINT handling in the current thread

2017-09-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

You just wrote an example where you are protecting __exit__ from interrupts.  
Do you schedule coroutines inside __exit__?

--

___
Python tracker 

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



[issue31388] Provide a way to defer SIGINT handling in the current thread

2017-09-08 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Yes... low-level routines like coroutine schedulers where you need to defer 
interrupts inside the scheduler but not inside the coroutines being scheduled. 
It's not gold plating, it's actually the original motivation :-)

https://vorpus.org/blog/control-c-handling-in-python-and-trio/#how-do-we-know-which-code-should-be-protected

--

___
Python tracker 

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



[issue31394] Ellipsis token.type != token.ELLIPSIS

2017-09-08 Thread Berker Peksag

Berker Peksag added the comment:

If you look at 
https://docs.python.org/3/reference/lexical_analysis.html#delimiters '.' 
(period) is listed as delimiter and there is the following sentence to answer 
your question:

A sequence of three periods has a special meaning as an ellipsis literal.

--

___
Python tracker 

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



[issue31394] Ellipsis token.type != token.ELLIPSIS

2017-09-08 Thread Aivar Annamaa

Aivar Annamaa added the comment:

But it looks like Ellipsis is neither operator nor delimiter: 
https://docs.python.org/3/reference/lexical_analysis.html#operators

--

___
Python tracker 

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




[issue31388] Provide a way to defer SIGINT handling in the current thread

2017-09-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 08/09/2017 à 03:54, Nathaniel Smith a écrit :
> 
> The main feature we would like is for it to automatically vary depending on 
> the execution context -- in particular, naively sticking it into a 
> thread-local won't work, because if you use send/throw/next to switch 
> contexts you want that to switch the deferred state as well.

Perhaps you are gold-plating this too much.  This is primitive for a
couple low-level routine writers, not for the average developer.

--

___
Python tracker 

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



[issue31394] Ellipsis token.type != token.ELLIPSIS

2017-09-08 Thread Berker Peksag

Berker Peksag added the comment:

Thank you for the report, but this behavior is already documented at 
https://docs.python.org/3/library/tokenize.html

To simplify token stream handling, all Operators and Delimiters
tokens are returned using the generic token.OP token type. The
exact type can be determined by checking the exact_type property
on the named tuple returned from tokenize.tokenize().

If you replace the following line

print(ellipsis)

with

print(ellipsis.exact_type)

you will see that it prints '52'.

--
nosy: +berker.peksag
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue31394] Ellipsis token.type != token.ELLIPSIS

2017-09-08 Thread Aivar Annamaa

New submission from Aivar Annamaa:

Type code for ellipsis token doesn't match with the constant token.ELLIPSIS:
---
import io
import token
import tokenize

source = "..."

tokens = list(tokenize.tokenize(io.BytesIO(source.encode('utf-8')).readline))
ellipsis = tokens[1]

print(ellipsis)
print(token.ELLIPSIS) 
-

This code outputs following in Python 3.5 and 3.6:

> TokenInfo(type=53 (OP), string='...', start=(1, 0), end=(1, 3), line='...')
> 52

and following in Python 3.4

> TokenInfo(type=52 (OP), string='...', start=(1, 0), end=(1, 3), line='...')
> 51

--
components: Interpreter Core
messages: 301687
nosy: Aivar.Annamaa
priority: normal
severity: normal
status: open
title: Ellipsis token.type != token.ELLIPSIS
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue15670] PEP 3121, 384 Refactoring applied to ssl module

2017-09-08 Thread Andrew Svetlov

Andrew Svetlov added the comment:

The patch consists from two changes: replacing static vars with module state 
and using slot based way for constructing classes.

The first change is obvious but I not sure if we need second transformation.

--

___
Python tracker 

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



[issue31393] Fix the use of PyUnicode_READY()

2017-09-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue31393] Fix the use of PyUnicode_READY()

2017-09-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset ddb536ba7b7c6022424e39d666c3cc81772645c0 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-31393: Fix the use of PyUnicode_READY(). (GH-3451). (#3453)
https://github.com/python/cpython/commit/ddb536ba7b7c6022424e39d666c3cc81772645c0


--

___
Python tracker 

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



[issue28638] Optimize namedtuple creation

2017-09-08 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
pull_requests: +3451

___
Python tracker 

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



[issue31393] Fix the use of PyUnicode_READY()

2017-09-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3450

___
Python tracker 

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



[issue31393] Fix the use of PyUnicode_READY()

2017-09-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c by Serhiy Storchaka in 
branch 'master':
bpo-31393: Fix the use of PyUnicode_READY(). (#3451)
https://github.com/python/cpython/commit/e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c


--

___
Python tracker 

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



[issue31252] Operator.itemgetter documentation should include dictionary keys example

2017-09-08 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue27354] SSLContext.load_verify_locations cannot handle paths on Windows which cannot be encoded using mbcs

2017-09-08 Thread Ilya Kulakov

Ilya Kulakov added the comment:

Christian,

If you have windows under your hand and can try an alike path, you should see 
the problem right away if it's still there.

I think the original problem was unnecessary PyUnicode_FSConverter: it failed 
to encode string into mbcs, while OpenSSL did not have any problems 
understanding a UTF-8 on Windows.

--

___
Python tracker 

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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2017-09-08 Thread Nathaniel Smith

Nathaniel Smith added the comment:

> a special case for WITH_CLEANUP_START

I guess this works for the sync case, but it seems kinda fragile, and obviously 
won't work for the async case. Do you think it's worth revisiting this idea 
from the OP?: "The eval loop's "check for signal handlers" code is run rarely, 
so we could afford to do relatively expensive things like check a lookaside 
table that says "no signal handlers when 13 < f_lasti <= 22"."

(Of course it should be 13 <= f_lasti < 22, apparently I was writing in a 
mirror or something.)

BTW, I looked at your branch, and figured out the problem with your async test. 
Asyncio isn't a problem (YIELD_FROM doesn't yield to the event loop, only an 
actual 'yield' statement does that); the problem was just that your test case's 
__aexit__ is written in Python, so you were exceptions delayed until the 
__aexit__ call, and then they were raised inside __aexit__ and the test 
couldn't detect that properly. I have a patch against 9b8891a7ca5 that makes it 
pass. (It switches the pass condition to "either tracking_cm.enter_without_exit 
is False OR AsyncTrackingCM.__aexit__ is in the exception's traceback".) But of 
course it still has the problem with jumping past DEFER_PENDING_UNTIL. Do you 
want me to post the patch here, or in the other issue?

--

___
Python tracker 

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



[issue26904] Difflib quick_ratio() could use Counter()

2017-09-08 Thread Michael Cuthbert

Michael Cuthbert added the comment:

I've tried to get the system to not be slower on small sets by not creating a 
Counter for less than 60 items, and managed to get within 10% of the speed for 
small sequences while maintaining the 3-3.6x speedup for big comparisons and 
testing that the results were unchanged, but the code just became far too 
unmanageable for such a small function as quick_ratio, with code forking that 
would be hard to maintain.  

I'll upload the stub of the replacement for quick_ratio for future 
developments, in case the creation of Counter objects (the bottleneck) ever 
disappears, in which case this code will be simpler and faster than the current 
implementation, but until then, I think it's best to close this issue.

--
resolution:  -> later
stage: patch review -> resolved
status: open -> closed
Added file: https://bugs.python.org/file47125/newQuickRatio.py

___
Python tracker 

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



  1   2   >