[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-22 Thread Dustin Spicuzza

Dustin Spicuzza  added the comment:

Finally got around to looking at this.

# cat /proc/sys/kernel/random/entropy_avail 
183

.. ran python3 -c 'import os; os.getrandom(1, flags=os.GRND_NONBLOCK)' a few 
times, but didn't run into a hang. Seems like the entropy_avail is staying at 
about the same level?

It's worth noting that I ran into this error with last year's firmware image, 
and I haven't actually tested this year's firmware image for this particular 
issue... just that I had it on my TODO list to fix for this year. :)

I think it's still a good change to make regardless.

--

___
Python tracker 

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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Are one of the variants of this patch ready to apply?  I'm hoping that the 
window for 3.7 isn't missed.

--

___
Python tracker 

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



[issue32399] _uuidmodule.c cannot build on AIX - different typedefs of uuid_t, etc..

2017-12-22 Thread Michael Felt

Change by Michael Felt :


--
type:  -> behavior

___
Python tracker 

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



[issue32399] _uuidmodule.c cannot build on AIX - different typedefs of uuid_t, etc..

2017-12-22 Thread Michael Felt

Michael Felt  added the comment:

Understood.

What I have learned.

Although the types are quite different, they are both 16 bytes.

Starting with AIX 6.1, libc includes uuid_create(&uuid, &status)
which fills "uuid" with a uuid.uuid1() like result.
After calling uuid_to_string( &uuid, &uuid_string, &status); the result:
"13d866fa-e6f1-11e7-8017-fad18cf76204"

Further reading of the documentation within """ and """ in Lib/uuid.py helps me 
realize that the AIX approach aligns with the UUID fields description:

fields  a tuple of the six integer fields of the UUID,
which are also available as six individual attributes
and two derived attributes:

time_lowthe first 32 bits of the UUID
time_midthe next 16 bits of the UUID
time_hi_version the next 16 bits of the UUID
clock_seq_hi_variantthe next 8 bits of the UUID
clock_seq_low   the next 8 bits of the UUID
nodethe last 48 bits of the UUID


So - with this: there is also more than can be done for AIX re: 
https://bugs.python.org/issue28009

More to come...

--

___
Python tracker 

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



[issue32390] AIX (xlc_r) compile error with Modules/posixmodule.c: Function argument assignment between types "unsigned long" and "struct fsid_t" is not allowed

2017-12-22 Thread Michael Felt

Michael Felt  added the comment:

Well, replied via email response - but it did not show up here.

You suggestion worked. I'll start a PR and we can see if your suggestion also 
works for all the other platforms.

--

___
Python tracker 

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



[issue32390] AIX (xlc_r) compile error with Modules/posixmodule.c: Function argument assignment between types "unsigned long" and "struct fsid_t" is not allowed

2017-12-22 Thread Michael Felt

Change by Michael Felt :


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

___
Python tracker 

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



[issue32337] Dict order is now guaranteed, so add tests and doc for it

2017-12-22 Thread shangdahao

Change by shangdahao :


--
keywords: +patch
pull_requests: +4864
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



[issue32399] _uuidmodule.c cannot build on AIX - different typedefs of uuid_t, etc..

2017-12-22 Thread Michael Felt

Change by Michael Felt :


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

___
Python tracker 

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



[issue32409] venv activation doesn't work, if project is in a Windows folder that has latin-1 supplement characters (such as ä,ö,å) in its path

2017-12-22 Thread Jaakko Roponen

New submission from Jaakko Roponen :

Let's say I have a folder c:\test-ä in Windows

Now if I run: py -m venv env
and activate: env\scripts\activate
and check: where python

the result is incorrectly just: 
C:\Users\Username\AppData\Local\Programs\Python\Python36\python.exe

If I run: path 
the result is: PATH=C:\test-ä\env\Scripts;...

So clearly the encoding is broken for the folder name.

I can fix this by changing activate.bat character encoding to OEM-US and then 
replacing "test-├ż" by "test-ä".

If I now activate and run: where python
the result is (as should be): 
C:\test-ä\env\Scripts\python.exe
C:\Users\Username\AppData\Local\Programs\Python\Python36\python.exe

By running: path
I get: PATH=C:\test-ä\env\Scripts;...

So looks good here as well.

I suggest that what ever is creating activate.bat file, is using incorrect 
character encoding for the creation of the file. If this is somehow platform 
specific, there could be a guide in the venv documentation about how to fix 
this.

--
components: Extension Modules
messages: 308931
nosy: Jac0
priority: normal
severity: normal
status: open
title: venv activation doesn't work, if project is in a Windows folder that has 
latin-1 supplement characters (such as ä,ö,å) in its path
type: behavior
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



[issue32410] Implement loop.sock_sendfile method

2017-12-22 Thread Andrew Svetlov

New submission from Andrew Svetlov :

The method should be low-level coroutine, implemented on loops with native 
sendfile support only (UnixEventLoop).

The signature should be close to socket.sendfile() method

Next step is implementing loop.sendfile(transport, ...) with fallback to 
sending by chunks if sendfile is not supported.

--
components: Library (Lib), asyncio
messages: 308932
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Implement loop.sock_sendfile method
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



[issue32410] Implement loop.sock_sendfile method

2017-12-22 Thread Andrew Svetlov

Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue32396] Implement method to write/read to serials without blocking on windows with asyncio

2017-12-22 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Looking on serial port support in twisted 
(https://github.com/twisted/twisted/blob/trunk/src/twisted/internet/_win32serialport.py)
 I see that it is implemented by OVERLAPPED structure and ReadFile/WriterFile 
calls.

On other hand loop.sock_send() in ProactorEventLoop uses Proactor.send() 
(https://github.com/python/cpython/blob/master/Lib/asyncio/windows_events.py#L457).

The method calls WriteFile is sock is not socket.socket instance.

Did you check if `loop.sock_send()`/`loop.sock_recv()` works for serail port 
object?

--

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2017-12-22 Thread Eryk Sun

Eryk Sun  added the comment:

The CMD shell decodes batch scripts using the attached console's output 
codepage, which defaults to OEM. OTOH, venv writes the replacement values for 
the template activate.bat as UTF-8 (codepage 65001), which is correct and 
should not be downgraded to OEM. 

Instead, the batch script could temporarily switch the console to codepage 
65001. Then restore the previous codepage at the end. For example:

@echo off
for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do (
set "CODEPAGE=%%a"
)
"%SystemRoot%\System32\chcp.com" 65001 > nul

[rest of script]

"%SystemRoot%\System32\chcp.com" %CODEPAGE% > nul
set "CODEPAGE="
:END

--
components: +Library (Lib), Unicode, Windows -Extension Modules
nosy: +eryksun, ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, 
zach.ware
stage:  -> needs patch
title: venv activation doesn't work, if project is in a Windows folder that has 
latin-1 supplement characters (such as ä,ö,å) in its path -> venv activate.bat 
is UTF-8 encoded but uses current console codepage
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



[issue22908] ZipExtFile in zipfile can be seekable

2017-12-22 Thread John Jolly

John Jolly  added the comment:

Please be gentle, this is my first submission to python.

The use case for me was a recursive zip-within-a-zip situation. I wanted to 
allow the creation of a zipfile.ZipFile from an existing zipfile.ZipExtFile, 
but the lack of seek prevented this.

I simply treated forward seeks as a read, and backward seeks as a 
reset-and-read. The reset was the tricky part as it required restoring several 
original values such as the remaining compressed length, remaining data length, 
and the running crc32.

I pushed this into the latest upstream branch, but as I am testing this in v3.4 
it should be easy to backport if necessary (I suspect not).

I based my fix on a little program that I wrote to test the feasibility of this 
idea. I am attaching that test program here.

--
nosy: +jjolly
Added file: https://bugs.python.org/file47345/ziz.py

___
Python tracker 

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



[issue32407] lib2to3 doesn't work when zipped

2017-12-22 Thread R. David Murray

R. David Murray  added the comment:

Duplicate of issue 24960.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Can't use lib2to3 with embeddable zip file.

___
Python tracker 

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



[issue32407] lib2to3 doesn't work when zipped

2017-12-22 Thread R. David Murray

R. David Murray  added the comment:

Funny, you are already nosy on that issue.  Does this one have a different 
goal, or did you just forget about that one?

--

___
Python tracker 

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



[issue32407] lib2to3 doesn't work when zipped

2017-12-22 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I tend to get nosied on all 2to3 issues, but I only just started caring about 
this one. :)

Thanks for finding the prior art.

--

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-12-22 Thread Benjamin Peterson

Change by Benjamin Peterson :


--
keywords: +patch
pull_requests: +4867
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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-22 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

Hello Raymond,

I don't have anything ready to go.  PR 4682 has some major outstanding issues.  
Specifically, exits from finally bodies did not cleanup the fblock stack 
correctly.

I still think this patch is a good idea and that it can work.  My goal is to 
have something that performs better but, more importantly is more 
understandable from a code maintenance point of view.  I expect it will not be 
ready for 3.7 however.

--

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-12-22 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 8a5877165e993afb2633cd48da5222326d3f6e0e by Benjamin Peterson in 
branch 'master':
bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files (#4977)
https://github.com/python/cpython/commit/8a5877165e993afb2633cd48da5222326d3f6e0e


--

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-12-22 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4868

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-12-22 Thread Benjamin Peterson

Change by Benjamin Peterson :


--
pull_requests: +4869

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-12-22 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset c1b8eb8006ed79bbf91dc7d89918f39cc10b4fe6 by Benjamin Peterson 
(Miss Islington (bot)) in branch '3.6':
bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files 
(GH-4977) (#4979)
https://github.com/python/cpython/commit/c1b8eb8006ed79bbf91dc7d89918f39cc10b4fe6


--

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-12-22 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 770a802df7057bcf0d72bbc01026fac8d396e1b3 by Benjamin Peterson in 
branch '2.7':
[2.7] bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files 
(GH-4977) (#4980)
https://github.com/python/cpython/commit/770a802df7057bcf0d72bbc01026fac8d396e1b3


--

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-12-22 Thread Benjamin Peterson

Change by Benjamin Peterson :


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



[issue32391] Add StreamWriter.wait_closed()

2017-12-22 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue27639] UserList.__getitem__ doesn't account for slices

2017-12-22 Thread Dmitry Kazakov

Change by Dmitry Kazakov :


--
pull_requests: +4870
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



[issue17972] inspect module docs omits many functions

2017-12-22 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
dependencies:  -Online doc does not include inspect.classify_class_attrs
keywords: +easy

___
Python tracker 

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



[issue32261] Online doc does not include inspect.classify_class_attrs

2017-12-22 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> inspect module docs omits many functions

___
Python tracker 

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



[issue27639] UserList.__getitem__ doesn't account for slices

2017-12-22 Thread Dmitry Kazakov

Change by Dmitry Kazakov :


--
nosy: +vaultah

___
Python tracker 

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



[issue32278] Allow dataclasses.make_dataclass() to omit type information

2017-12-22 Thread Gregory P. Smith

Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue32278] Allow dataclasses.make_dataclass() to omit type information

2017-12-22 Thread Gregory P. Smith

Change by Gregory P. Smith :


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



[issue32394] socket lib beahavior change in 3.6.4

2017-12-22 Thread Kamil

Kamil  added the comment:

I suggest inserting the following code into socket.py:

if hasattr(sys, 'getwindowsversion') and sys.getwindowsversion()[0] < 10:
del socket.TCP_KEEPCNT
del socket.TCP_FASTOPEN

--

___
Python tracker 

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



[issue32380] functools.singledispatch interacts poorly with methods

2017-12-22 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

I have also noticed this problem and I like the idea. It appeared some time ago 
on python-ideas, but no one has written a patch.

--
nosy: +levkivskyi

___
Python tracker 

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



[issue32411] Idlelib.browser: stop sorting dicts created by pyclbr

2017-12-22 Thread Terry J. Reedy

New submission from Terry J. Reedy :

pyclbr does a linear scan of a file and returns a dict, and Class objects have 
a dict of children. For objects in the file being scanned, insertion order is 
the same as line number order.  idlelib.browser.transform children filters out 
objects not in the file, changes the .name of some objects in the file, appends 
to a list, and sorts by line number.  (I should have done the sort in place.)  
For insertion order dicts, the sort does nothing. In 3.7, insertion order is a 
language guarantee, not just a (current) CPython implementation detail.  The 
sort does not change the order and is therefore no longer needed. We can reduce
return sorted(obs, key=lambda o: o.lineno)
to
return obs

However, I do want to make sure that there is at least one test that will break 
if there is a bug somewhere.

--
assignee: terry.reedy
components: IDLE
messages: 308945
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: Idlelib.browser: stop sorting dicts created by pyclbr
type: performance
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



[issue20291] Argument Clinic should understand *args and **kwargs parameters

2017-12-22 Thread Gordon P. Hemsley

Change by Gordon P. Hemsley :


--
nosy: +gphemsley

___
Python tracker 

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



[issue32412] help() of bitwise operators should mention sets as well

2017-12-22 Thread Steven D'Aprano

New submission from Steven D'Aprano :

If you ask for help on the set operators ^ & and | then help docs only talk 
about them as bitwise operators.

Since sets and frozensets are important, built-in types, the help should 
mention them as well.

--
assignee: docs@python
components: Documentation
messages: 308946
nosy: docs@python, steven.daprano
priority: normal
severity: normal
status: open
title: help() of bitwise operators should mention sets as well
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



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

2017-12-22 Thread Mariatta Wijaya

Change by Mariatta Wijaya :


--
pull_requests: +4872

___
Python tracker 

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



[issue32413] Document that locals() may return globals()

2017-12-22 Thread Steven D'Aprano

New submission from Steven D'Aprano :

The obvious documentation for locals() fails to mention that when called from 
the top level of a module (outside of a function or class body) it returns the 
same dict as globals().

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

--
assignee: docs@python
components: Documentation
messages: 308947
nosy: docs@python, steven.daprano
priority: normal
severity: normal
status: open
title: Document that locals() may return globals()
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32380] functools.singledispatch interacts poorly with methods

2017-12-22 Thread Ethan Smith

Change by Ethan Smith :


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

___
Python tracker 

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



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

2017-12-22 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset c0919c27c6442aa147ae559a936b1b8deb4ee783 by Mariatta in branch 
'master':
bpo-26439: Convert %s in Lib/ctypes/_aix.py to f-strings. (GH-4986)
https://github.com/python/cpython/commit/c0919c27c6442aa147ae559a936b1b8deb4ee783


--
nosy: +Mariatta

___
Python tracker 

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