[issue26032] Use scandir() to speed up pathlib globbing

2016-01-31 Thread Ben Hoyt

Ben Hoyt added the comment:

Guido, I've made some tweaks and improvements to the DirEntry docs here: 
http://bugs.python.org/issue26248 -- the idea is to fix the issues you 
mentioned to clarify when system calls are required with symlinks, mentioning 
that the results are cached separately for follow_symlinks True and False, etc.

--

___
Python tracker 

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



[issue26248] Improve scandir DirEntry docs, especially re symlinks and caching

2016-01-31 Thread STINNER Victor

STINNER Victor added the comment:

The change looks good to me. I pushed it to 3.5 & 3.6. It will be online in a 
few hours at:
https://docs.python.org/dev/library/os.html#os.DirEntry

I keep the issue open a few days to see if some others have other suggestions.

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-01-31 Thread STINNER Victor

New submission from STINNER Victor:

The issue #23601 showed speedup for the dict type by replacing PyMem_Malloc() 
with PyObject_Malloc() in dictobject.c.

When I worked on the PEP 445, it was discussed to use the Python fast memory 
allocator for small memory allocations (<= 512 bytes), but I think that nobody 
tested on benchmark.

So I open an issue to discuss that.

By the way, we should also benchmark the Windows memory allocator which limits 
fragmentations. Maybe we can skip the Python small memory allocator on recent 
version of Windows?

Attached patch implements the change. The main question is the speedup on 
various kinds of memory allocations (need a benchmark) :-)

I will try to run benchmarks.

--

If the patch slows down Python, maybe we can investigate if some Python types 
(like dict) mostly uses "small" memory blocks (<= 512 bytes).

--
files: pymem.patch
keywords: patch
messages: 259290
nosy: haypo, rhettinger, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Change PyMem_Malloc to use PyObject_Malloc allocator?
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file41767/pymem.patch

___
Python tracker 

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



[issue26252] Add an example to importlib docs on setting up an importer

2016-01-31 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue26252] Add an example to importlib docs on setting up an importer

2016-01-31 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue26173] test_ssl.bad_cert_test() exception handling

2016-01-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6d068205b580 by Martin Panter in branch '3.5':
Issue #26173: Separate bad cert file tests and client rejection test
https://hg.python.org/cpython/rev/6d068205b580

New changeset 3b211ee66b82 by Martin Panter in branch 'default':
Issue #26173: Merge SSL tests from 3.5
https://hg.python.org/cpython/rev/3b211ee66b82

--

___
Python tracker 

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



[issue23601] use small object allocator for dict key storage

2016-01-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks for the patch and for your patience.

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-01-31 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +jtaylor

___
Python tracker 

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



[issue23601] use small object allocator for dict key storage

2016-01-31 Thread STINNER Victor

STINNER Victor added the comment:

Nice change. I opened the issue #26249 to continue the investigation.

--
nosy: +haypo

___
Python tracker 

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



[issue26252] Add an example to importlib docs on setting up an importer

2016-01-31 Thread Donald Stufft

Changes by Donald Stufft :


--
nosy: +dstufft

___
Python tracker 

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



[issue23601] use small object allocator for dict key storage

2016-01-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 425fec4a79c7 by Raymond Hettinger in branch 'default':
Issue #23601:  Use small object allocator for dict key objects
https://hg.python.org/cpython/rev/425fec4a79c7

--
nosy: +python-dev

___
Python tracker 

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



[issue26221] asynco run_in_executor swallows StopIteration

2016-01-31 Thread Ian Kelly

Ian Kelly added the comment:

The place I'd expect to find it is in 
https://docs.python.org/3/library/asyncio-task.html#coroutines, in the list of 
"things a coroutine can do". The first two bullets in the list say that any 
exceptions raised will be propagated. Maybe there should be a note after the 
bullet list to the effect that "StopIteration carries special meaning to 
coroutines and will not be propagated if raised by an awaited coroutine or 
future."

--

___
Python tracker 

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



[issue26244] zlib.compressobj level default value documentation

2016-01-31 Thread Aviv Palivoda

Aviv Palivoda added the comment:

I think that we can leave the level=-1 as the default in the documentation. 
What should be added is what Z_DEFAULT_COMPRESSION means.
I tried to be as close as possible to the zlib module documentation.

--
Added file: http://bugs.python.org/file41766/zlib-compressobj-level-doc2.patch

___
Python tracker 

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



[issue26045] Improve error message for http.client when posting unicode string

2016-01-31 Thread Martin Panter

Martin Panter added the comment:

Here is my cut down version of Guido’s patch. Now it only adds the message when 
someone passes a text string as the HTTPConnection.request(body=...) parameter:

>>> c.request("POST", "", body="Celebrate \U0001F389")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/proj/python/cpython/Lib/http/client.py", line 1098, in request
self._send_request(method, url, body, headers)
  File "/home/proj/python/cpython/Lib/http/client.py", line 1142, in 
_send_request
body = _encode(body, 'body')
  File "/home/proj/python/cpython/Lib/http/client.py", line 161, in _encode
(name.title(), data[err.start:err.end], name)) from None
UnicodeEncodeError: 'latin-1' codec can't encode character '\U0001f389' in 
position 10: Body ('') is not valid Latin-1. Use body.encode('utf-8') if you 
want to send it encoded in UTF-8.

What do people think?

--
Added file: http://bugs.python.org/file41768/utfpatch.v2.diff

___
Python tracker 

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



[issue26250] no document for sqlite3.Cursor.connection

2016-01-31 Thread hao Qing

New submission from hao Qing:

it does have the Cursor.connection member in the pydoc result.
$ pydoc sqlite3.Cursor.connection
Help on member descriptor sqlite3.Cursor.connection in sqlite3.Cursor:

sqlite3.Cursor.connection
lines 1-3/3 (END)

but there is no document about sqlite3.Cursor.connection at here.
https://docs.python.org/2/library/sqlite3.html#sqlite3.Cursor

and so to version 3
https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor

--
components: Library (Lib)
messages: 259292
nosy: hao Qing
priority: normal
severity: normal
status: open
title: no document for sqlite3.Cursor.connection
type: enhancement
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



[issue26252] Add an example to importlib docs on setting up an importer

2016-01-31 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-01-31 Thread STINNER Victor

STINNER Victor added the comment:

Ok, to avoid confusion, I opened an issue specific to Windows for its 
"Low-fragmentation Heap": issue #26251.

Other issues related to memory allocators.

Merged:

- issue #21233: Add *Calloc functions to CPython memory allocation API 
(extension of the PEP 445, asked by numpy)
- issue #13483: Use VirtualAlloc to allocate memory arenas (implementation of 
the PEP 445)
- issue #3329: API for setting the memory allocator used by Python

Open:

- issue #18835: Add aligned memory variants to the suite of PyMem 
functions/macros => this one is still open, the status is unclear :-/

--

___
Python tracker 

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



[issue26251] Use "Low-fragmentation Heap" memory allocator on Windows

2016-01-31 Thread STINNER Victor

STINNER Victor added the comment:

The issue #19246 "high fragmentation of the memory heap on Windows" was 
rejected but discussed the Windows Low Fragmented Heap.

--

___
Python tracker 

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



[issue26186] LazyLoader rejecting use of SourceFileLoader

2016-01-31 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue26244] zlib.compressobj level default value documentation

2016-01-31 Thread Martin Panter

Martin Panter added the comment:

This version looks great to me.

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



[issue26248] Improve scandir DirEntry docs, especially re symlinks and caching

2016-01-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f2c68cb17e31 by Victor Stinner in branch '3.5':
Enhance os.scandir() doc
https://hg.python.org/cpython/rev/f2c68cb17e31

--
nosy: +python-dev

___
Python tracker 

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



[issue22121] IDLE should start with HOME as the initial working directory

2016-01-31 Thread Jeff Allen

Jeff Allen added the comment:

I'm also interested in a smooth experience for beginners.

I have a factual observation with respect to Terry's comment:
'''Windows icons have a Shortcut tab with a Start-in field.  We should like to 
put %USERPROFILE% there, but this does not work -- msg253393.'''
... I note that several menu shortcuts have "Start in" set to 
%HOMEDRIVE%%HOMEPATH%. Examples are notepad, Internet Explorer and the command 
prompt. (This is on Win7x64.) What we want seems to be a normal thing to do, 
and achieved by some, but perhaps by a post installation script.

Alternatively, once a .py file exists where you want to work, right-click "Edit 
with IDLE" provides the CWD we'd like best. Idea: add a New >> Python File 
context menu item. Encourage users to create a new file that way, then open it, 
and everything from there is smooth. (New issue if liked.)

--
nosy: +jeff.allen

___
Python tracker 

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



[issue26251] Use "Low-fragmentation Heap" memory allocator on Windows

2016-01-31 Thread STINNER Victor

STINNER Victor added the comment:

"Low-fragmentation Heap":
https://msdn.microsoft.com/en-us/library/windows/desktop/aa366750%28v=vs.85%29.aspx

--

___
Python tracker 

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



[issue26119] Windows Installer can sometimes silently fail pip stage

2016-01-31 Thread Paul Hammant

Paul Hammant added the comment:

Chronalog for today, below. Status - can reproduce at will, can't produce 
%TEMP% files was for - there aren't any.

0. I deleted all Python prefixed files from %TEMP%

1. I uninstalled Python 3.4 via it's windows installer. It progressed to 
completion. I noted after that there was still a C:\python34 directory with 
some remaining items in it. There was also still a PYTHONHOME environmental 
variable.

2. I installed Python 2.7 via it's canonical windows installer, and (as per 
this bug filing) it barfs, and then (with a couple of clicks from me) proceeds 
to undo the installation.

3. I've checked the %TEMP% folder. There's nothing in there with a matching 
timestamp, nor anything at all prefixed with 'Python'

4. If I redo #2 and explicitly de-select pip, the installation completes as 
expected.

5. If I uninstall (via the installer) and attempt to reinstall WITH pip, it 
barfs (as per this bug filing)

6. If I delete the PYTHONHOME env-var and attempt, it works.

Conclusion - Pip aspect of WindowsInstaller gets caught out on presence of 
erroneous PYTHONHOME. It does so for Python 2.7.x replaceing and Python 3.5.x 
or the opposite order.

--

___
Python tracker 

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



[issue26252] Add an example to importlib docs on setting up an importer

2016-01-31 Thread Brett Cannon

New submission from Brett Cannon:

This past week a lot of people have asked me about how to set up an importer. 
It's enough to warrant adding an example in the new Examples section of the 
importlib docs to explain how to do this using the pre-existing classes in 
importlib.machinery for illustrative  purposes.

--
assignee: brett.cannon
components: Documentation
messages: 259295
nosy: brett.cannon
priority: low
severity: normal
stage: needs patch
status: open
title: Add an example to importlib docs on setting up an importer
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



[issue26251] Use "Low-fragmentation Heap" memory allocator on Windows

2016-01-31 Thread STINNER Victor

New submission from STINNER Victor:

Python has a memory allocator optimized for allocations <= 512 bytes: 
PyObject_Malloc(). It was discussed to replace it by the native 
"Low-fragmentation Heap" memory allocator on Windows.

I'm not aware of anyone who tried that. I would nice to try, especially to run 
benchmarks.

See also the issue #26249: "Change PyMem_Malloc to use PyObject_Malloc 
allocator?".

--
components: Windows
messages: 259293
nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Use "Low-fragmentation Heap" memory allocator on Windows
type: performance
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



[issue17446] doctest test finder doesnt find line numbers of properties

2016-01-31 Thread Michael Cuthbert

Michael Cuthbert added the comment:

this is my first contribution to Python core so I really have no idea how to do 
this, but I have found a solution (works in Py3.4, 2.7):

in doctest.py after line 1087 ("lineno = getattr(obj, 'co_firstlineno', 
None)-1")  add these lines:

if lineno is None and isinstance(obj, property) and \
obj.fget is not None:
obj = obj.fget.__code__
lineno = getattr(obj, 'co_firstlineno', None) 
# no need for -1 because of decorator. 

I can try to make a patch file for this, but just want to be sure I'm on the 
right track for contributing first.  I know how to do a Git pull, but not 
hg/patch.

(p.s., I think the current code "lineno = getattr(obj, 'co_firstlineno', 
None)-1" has an error; if the getattr does not find 'co_firstlineno', it will 
return None and then subtract 1 from None which is a TypeError).

--
nosy: +Michael Cuthbert

___
Python tracker 

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



[issue26119] Windows Installer can sometimes silently fail pip stage

2016-01-31 Thread Steve Dower

Steve Dower added the comment:

It's not clear which version of Python you are having trouble with, but it 
apparently isn't 3.5.

The PYTHONHOME variable is never set or modified by our installers, but some 
earlier versions may be affected by it. We recommend never setting environment 
variables globally - only in the command prompt when you're about to use them.

If the issue is with 3.4, it won't get fixed. Future releases of that branch 
will not come with builds for Windows.

Once you've cleared the stray variable, please let us know if you have trouble 
with 2.7 and/or 3.5.

--

___
Python tracker 

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



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-01-31 Thread Thomas Caswell

Thomas Caswell added the comment:

For reference https://github.com/ludwigschwardt/python-gnureadline/pull/47 is 
what a back-port of the functionality looks like.

--

___
Python tracker 

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



[issue26254] ssl server doesn't work with ECC certificates

2016-01-31 Thread Benjamin Peterson

Benjamin Peterson added the comment:

ECC certs using named curves have to have the OPENSSL_EC_NAMED_CURVE flag set. 
Pass -pkeyopt ec_param_enc:named_curve to the openssl req.

--
nosy: +benjamin.peterson
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue26173] test_ssl.bad_cert_test() exception handling

2016-01-31 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: commit 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



[issue26045] Improve error message for http.client when posting unicode string

2016-01-31 Thread Guido van Rossum

Guido van Rossum added the comment:

LGTM.

--

___
Python tracker 

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



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-01-31 Thread Thomas Caswell

Thomas Caswell added the comment:

I do not think that readline-cancel.patch is sufficient. The clean up function 
that readline uses internally 
(http://git.savannah.gnu.org/cgit/readline.git/tree/isearch.c#n720 ) also 
cleans up the context that used by isearch.

The functions to cleanup the context (and a pointer to the context) are exposed 
on `rlprivate.h` so python _can_ get at them to support old versions of rl. 
Once started down that path for isearch mode, might as well vendor all of 
rl_callback_sigcleanup() which will end up being 50-100 LoC (some of the helper 
functions will also need to be vendored).

--
nosy: +tcaswell

___
Python tracker 

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



[issue26252] Add an example to importlib docs on setting up an importer

2016-01-31 Thread Eric Fahlgren

Changes by Eric Fahlgren :


--
nosy: +eric.fahlgren

___
Python tracker 

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



[issue26253] tarfile in stream mode always set zlib compression level to 9

2016-01-31 Thread Patrik Dufresne

New submission from Patrik Dufresne:

When using tarfile.open(mode='w|gz'), the compression level is hard-coded to 9. 
Seed _Stream._init_write_gz():
self.zlib.compressobj(9,

1. In regards to zlib, I would start by replacing the value of 9 by 
zlib.Z_DEFAULT_COMPRESSION. This is the default value and zipfile is using it. 
Why using something different.

2. Then, I would also love to control the compression level when calling 
tarfile.open()

--
components: Library (Lib)
messages: 259304
nosy: Patrik Dufresne
priority: normal
severity: normal
status: open
title: tarfile in stream mode always set zlib compression level to 9
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue17446] doctest test finder doesnt find line numbers of properties

2016-01-31 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17446] doctest test finder doesnt find line numbers of properties

2016-01-31 Thread Timo Furrer

Timo Furrer added the comment:

I took the ideas from @Michael.Cuthbert and wrote a proper test. It's my first 
patch so I hope everything's fine with it. If not I'm happy for feedback :)

--
keywords: +patch
nosy: +Timo Furrer
Added file: http://bugs.python.org/file41769/fix_issue_17446.patch

___
Python tracker 

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



[issue26254] ssl server doesn't work with ECC certificates

2016-01-31 Thread Evgeny Kapun

New submission from Evgeny Kapun:

I tried to use ssl module to create a server with a certificate that uses an 
ECC key. However, this didn't work. Here is how to reproduce this:

First, generate a key and a certificate:

$ openssl req -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -x509 
-keyout key.pem -out cert.pem
(type some passphrase, then just press Enter in response to the questions 
that it asks)

Then run this Python program:

from socket import socket
from ssl import wrap_socket
s = socket()
s.bind(('localhost', 12345))
s.listen()
wrap_socket(s.accept()[0], 'key.pem', 'cert.pem', True)

This program will wait for a connection, so try to connect:

$ openssl s_client -connect localhost:12345

The program will ask for a passphrase, so type it. After that, you will get an 
exception:

Traceback (most recent call last):
  File "test.py", line 6, in 
wrap_socket(s.accept()[0], 'key.pem', 'cert.pem', True)
  File "/usr/lib/python3.5/ssl.py", line 1064, in wrap_socket
ciphers=ciphers)
  File "/usr/lib/python3.5/ssl.py", line 747, in __init__
self.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 983, in do_handshake
self._sslobj.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 628, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: NO_SHARED_CIPHER] no shared cipher (_ssl.c:645)

If the certificate uses RSA key, it works. With ECC, I had no luck. I tried 
creating a context explicitly and using set_ciphers method to enable more 
ciphers. While it appears to support ECDSA ciphersuites, it can't use them for 
some reason.

--
components: Extension Modules
messages: 259305
nosy: abacabadabacaba
priority: normal
severity: normal
status: open
title: ssl server doesn't work with ECC certificates
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



[issue26173] test_ssl.bad_cert_test() exception handling

2016-01-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6f7b2b7a029a by Martin Panter in branch '2.7':
Issue #26173: Separate bad cert file tests and client rejection test
https://hg.python.org/cpython/rev/6f7b2b7a029a

--

___
Python tracker 

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



[issue26238] httplib use wrong hostname in https request with SNI support

2016-01-31 Thread Martin Panter

Martin Panter added the comment:

The code fragment you posted looks like it is from HTTPSConnection.connect() 
. But 
_get_hostport() is already called to set self.host in __init__(), and to set 
self._tunnel_host in set_tunnel(). So I do not understand what you are 
proposing. Can you provide a patch?

Failing that, can you give a demonstration where the SNI and “request 
ServerName” (is this the Host header field?) mismatch?

The only potential bug I can see is if you specify the host by IP address, the 
IP address is sent as the SNI, when RFC 6066 seems to say a literal IP address 
is not permitted.

Client (run in Python 2.7.11):
>>> conn = HTTPSConnection("127.0.0.1:44300", 
>>> context=ssl._create_unverified_context())
>>> conn.request("GET", "/")

Server (run in Python 3.6):
>>> server = socket()
>>> server.bind(("localhost", 44300))
>>> server.listen()
>>> context = SSLContext(PROTOCOL_SSLv23)
>>> @context.set_servername_callback
... def callback(conn, name, context):
... print(f"Requested server name {name!r}")
... context = SSLContext(PROTOCOL_SSLv23)
... context.load_cert_chain("Lib/test/keycert.pem")
... conn.context = context
... 
>>> [conn, _] = server.accept()
>>> wrapped = context.wrap_socket(conn, server_side=True)
Requested server name '127.0.0.1'

My understanding is the client shouldn’t use SNI here, in which case the server 
name would be None.

--
nosy: +martin.panter
stage:  -> test needed

___
Python tracker 

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



[issue26253] tarfile in stream mode always set zlib compression level to 9

2016-01-31 Thread Martin Panter

Martin Panter added the comment:

It looks like the default has been hard-coded to 9 ever since tarfile was added 
to Python. The gzip module is also hard-coded to 9 since it was added. If 
tarfile is changed, maybe gzip should too.

Why would you want to use zlib’s default (apparently 6)? Memory usage or speed 
perhaps? If we do change the default, maybe it is best to only do it in 3.6. I 
don’t see it as a bug fix, and there is a chance it could break someone’s code.

To be able to control the compression level, perhaps you can already do it by 
wrapping the tar stream with GzipFile (untested):

gz_writer = GzipFile(fileobj=raw_writer, mode="wb", compresslevel=...)
tar_writer = tarfile.open(fileobj=gz_writer, mode="w|")
tar_writer.addfile(...)
tar_writer.close()
gz_writer.close()

If the default is changed, it certainly makes sense to add an easy compression 
level parameter, to be able to restore the old behaviour.

--
nosy: +martin.panter
type: behavior -> enhancement
versions:  -Python 2.7, Python 3.2, Python 3.3, 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



[issue22923] No prompt for "display all X possibilities" on completion-enabled input()

2016-01-31 Thread Yoha

Changes by Yoha :


--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue26245] AttributeError (GL_READ_WRITE) when importing OpenGL.GL

2016-01-31 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report, Yoha. Your third example shows that this is either an 
error in PyOpenGL or there is something wrong in your PyOpenGL installation. 
Please report this to their issue tracker.

--
nosy: +berker.peksag
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue26173] test_ssl.bad_cert_test() exception handling

2016-01-31 Thread Berker Peksag

Berker Peksag added the comment:

Looks good to me. Thanks Martin.

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

___
Python tracker 

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



[issue26246] Code output toggle button uses removed jQuery method

2016-01-31 Thread Liang Bo Wang

New submission from Liang Bo Wang:

The code output toggle button (the `>>>` button on the top right) has been 
disappeared and not functional on the current online documentation (both 3.4+ 
and 2.7). 


For example, see any doc page that has interpreter outputs:

https://docs.python.org/3/tutorial/introduction.html#numbers
https://docs.python.org/3.5/tutorial/introduction.html#numbers
https://docs.python.org/3.4/tutorial/introduction.html#numbers
https://docs.python.org/2/tutorial/introduction.html#numbers


These toggle buttons are created dynamically using jQuery by the script at 
Doc/tools/static/copybutton.js. However, the method .toggle() it used for click 
event handling has been deprecated since jQuery 1.8 and removed since jQuery 
1.9.

https://api.jquery.com/toggle-event/


Current Python documentation ships with jQuery v1.11.1 and it has a new 
.toggle() method with totally different behavior, which controls animation and 
hide the element. Therefore those buttons are invisible and has no effect.

https://api.jquery.com/toggle/


To achieve the old behavior, one now needs to create this toggle event on one's 
own. The most popular way to store the toggle state is by jQuery's .data() data 
storage.

A patch is attached to make the button functional again.

--
assignee: docs@python
components: Documentation
files: copybutton_js.patch
keywords: patch
messages: 259279
nosy: Liang Bo Wang, docs@python, eric.araujo, ezio.melotti, georg.brandl
priority: normal
severity: normal
status: open
title: Code output toggle button uses removed jQuery method
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41764/copybutton_js.patch

___
Python tracker 

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



[issue26245] AttributeError (GL_READ_WRITE) when importing OpenGL.GL

2016-01-31 Thread Yoha

New submission from Yoha:

Importing `OpenGL.GL` fails on Python 3.5:

```
Python 3.5.1+ (default, Jan 13 2016, 15:09:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenGL.GL
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3/dist-packages/OpenGL/GL/__init__.py", line 3, in 

from OpenGL.GL.VERSION.GL_1_1 import *
  File "/usr/lib/python3/dist-packages/OpenGL/GL/VERSION/GL_1_1.py", line 10, 
in 
from OpenGL import platform, constants, constant, arrays
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/__init__.py", line 22, in 

formathandler.FormatHandler.loadAll()
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/formathandler.py", line 
28, in loadAll
cls.loadPlugin( entrypoint )
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/formathandler.py", line 
35, in loadPlugin
plugin_class = entrypoint.load()
  File "/usr/lib/python3/dist-packages/OpenGL/plugins.py", line 14, in load
return importByName( self.import_path )
  File "/usr/lib/python3/dist-packages/OpenGL/plugins.py", line 28, in 
importByName
module = __import__( ".".join(moduleName), {}, {}, moduleName)
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/vbo.py", line 430, in 

def mapVBO( vbo, access=GL.GL_READ_WRITE ):
AttributeError: module 'OpenGL.GL' has no attribute 'GL_READ_WRITE'
```

It seems to work fine in Python 3.4:

```
Python 3.4.4 (default, Jan  5 2016, 15:35:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenGL.GL
>>> 
```

Or by first importing `OpenGL.GLU`:

```
Python 3.5.1+ (default, Jan 13 2016, 15:09:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenGL.GLU
>>> import OpenGL.GL
>>> 
```

--
components: Extension Modules
messages: 259276
nosy: yoha
priority: normal
severity: normal
status: open
title: AttributeError (GL_READ_WRITE) when importing OpenGL.GL
type: crash
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



[issue26247] Document Chrome/Chromium for python2.7

2016-01-31 Thread Ismail s

New submission from Ismail s:

The table of browser types in 
https://docs.python.org/2.7/library/webbrowser.html?highlight=webbrowser#webbrowser.register
 does not say that Google Chrome/Chromium is available on python2.7, even 
though it is (https://hg.python.org/cpython/file/2.7/Lib/webbrowser.py#l307).

Also, according to the docs for python.3.5 
(https://docs.python.org/3.5/library/webbrowser.html?highlight=webbrowser#webbrowser.register
 , just below the table), support for google chrome/chromium was added in 
python3.3, so maybe this was backported to python2.7 and the docs not updated?

--
assignee: docs@python
components: Documentation
messages: 259280
nosy: Ismail s, docs@python
priority: normal
severity: normal
status: open
title: Document Chrome/Chromium for python2.7
type: enhancement
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



[issue26248] Improve scandir DirEntry docs, especially re symlinks and caching

2016-01-31 Thread Ben Hoyt

New submission from Ben Hoyt:

Per Guido's comment about DirEntry documentation on Issue 26032, especially 
http://bugs.python.org/issue26032#msg257665, it'd be good to improve the docs 
of the scandir DirEntry methods with regard to symlinks and caching.

Attaching my stab at a documentation fix. Changes here are:

1) Clarify that the return values of is_dir()/is_file()/etc are cached 
separately for follow_symlinks True and False.
2) Be more specific about when the functions require a system call, and how it 
relates to caching and follow_symlinks.
3) DRY up common stuff between is_dir and is_file by saying "Caching, system 
calls made, and exceptions raised are as per is_dir" in is_file.
4) Tweak to the first paragraph of docs for is_dir/is_file to simplify: assume 
the follow_symlinks=True default, then note the follow_symlinks=False 
non-default case after.

I think they're all improvements, though I'm not sure about #3. Is it better to 
just repeat those couple of paragraphs verbatim?

I'm also not 100% sure about mentioning the DT_UNKNOWN thing. But you really 
can't get more specific about when system calls are required on Unix without 
mentioning it.

--
assignee: docs@python
components: Documentation
files: direntry_doc_improvements.patch
keywords: patch
messages: 259282
nosy: benhoyt, docs@python, gvanrossum, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve scandir DirEntry docs, especially re symlinks and caching
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41765/direntry_doc_improvements.patch

___
Python tracker 

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



[issue26247] Document Chrome/Chromium for python2.7

2016-01-31 Thread SilentGhost

SilentGhost added the comment:

It's due to issue 17536 and particularly 5a1429e9b621
I presume doko would be happy to follow up on that.

--
nosy: +SilentGhost, doko

___
Python tracker 

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