[issue28424] pkgutil.get_data() doesn't work with namespace packages

2016-10-14 Thread Nick Coghlan

Nick Coghlan added the comment:

For 3.4/5/6, I agree this is a documentation issue, where the data files need 
to be given a *non*-namespaced directory to live in. However, it's worth 
explicitly noting that subpackages of namespace packages can themselves be 
regular packages, so one possible solution is to do:

pkg_util.get_data('my_namespace.my_package_data', 'resourcename')

rather than storing the data directly at the namespace level.

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



[issue28428] Rename _futures module to _asyncio

2016-10-14 Thread INADA Naoki

Changes by INADA Naoki :


--
status: open -> closed

___
Python tracker 

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



[issue28428] Rename _futures module to _asyncio

2016-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9d06fdedae2b by INADA Naoki in branch '3.6':
Issue #28428: Rename _futures module to _asyncio.
https://hg.python.org/cpython/rev/9d06fdedae2b

New changeset c2f3b7c56dff by INADA Naoki in branch 'default':
Issue #28428: Rename _futures module to _asyncio. (merge from 3.6)
https://hg.python.org/cpython/rev/c2f3b7c56dff

--
nosy: +python-dev

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-14 Thread Benny K J

Benny K J added the comment:

Could you please tell me if the decision to make the extension modules like 
math, socket, select etc taken in the configure step or is it left to the 
Makefile.

Also could you please give me some hints on where to look for on how this 
decision is made (e.g file name / function name.)

--

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-14 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Any different results with CFLAGS="-fno-gnu89-inline"?

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-14 Thread Benny K J

Benny K J added the comment:

Thank you for the response.

I'm not too sure how to set the root directory for arm headers and libraries in 
the configure command line.

So I've tried the below, but still not all of the extensions modules was not 
build (e.g math, socket, select)

export 
CROSS_PATH=/home/benny/workspace/projects/webshield/src/dntl_ws/sw/toolchain/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc


CONFIG_SITE=config.site CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ 
AR=arm-linux-gnueabihf-ar RANLIB=arm-linux-gnueabihf-ranlib 
READELF=arm-linux-gnueabihf-readelf CFLAGS="-I${CROSS_PATH}/usr/include" 
LDFLAGS="-L${CROSS_PATH}/usr/lib" CPPFLAGS="-I${CROSS_PATH}/usr/include" 
./configure --enable-shared --host=arm-linux --build=x86_64-linux-gnu 
--disable-ipv6 --prefix=/opt/python3

Attached please find the build log

--
Added file: http://bugs.python.org/file45098/python3.5.2_x86_host_arm_target.log

___
Python tracker 

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



[issue27825] Make the documentation for statistics' data argument clearer.

2016-10-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Updated patch based on feedback.

Steven, I removed the example of median_grouped using Fractions.
Would you be able to suggest better examples to be added in the docs?

I also noticed that there are more examples of median_grouped in the paragraph 
below. 

Thanks.

--
Added file: http://bugs.python.org/file45097/issue27825v2.patch

___
Python tracker 

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



[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-14 Thread Georgey

Georgey added the comment:

"Without code or something demonstrating the bug, I’m pretty sure it is a bug 
in your program"

Here is the main Thread
---

mailbox = queue.Queue()


while True:
#print(addr_groups)


unknown_clients=[]
for key in yellow_page.keys():
if yellow_page[key][0] ==None:
unknown_clients.append(key)

print("\n", name_groups)
if len(unknown_clients) >0:
print("unknown from:"+str(unknown_clients))
print(time.strftime(ISOTIMEFORMAT, time.localtime(time.time())) + '\n')

# Get the list sockets which are ready to be read through select
read_sockets, write_sockets, error_sockets = 
select.select(active_socks,[],[],TIMEOUT)

for sock in read_sockets:
#New connection
if sock ==server_sock:
# New Client coming in
clisock, addr = server_sock.accept()  
ip = addr[0]
if ip in IPALLOWED:
active_socks.append(clisock)
yellow_page[addr] = [None,None,clisock] 
else:
clisock.close()
 
#Some incoming message from a client
else:
# Data recieved from client, process it
try:
data = sock.recv(BUFSIZ)
if data:
fromwhere = sock.getpeername()
mail_s = data.split(SEG_) 
del mail_s[0]
for mail_ in mail_s:

mail = mail_.decode()
   
except:
mailbox.put( (("sock_err",sock), 'localhost') )
continue
=

so the sub thread's job is to analyze the exception put into "mailbox"

Here is the run function of sub thread
---
def run(self):

while True:
msg, addr = mailbox.get()  
if msg[0] =="sock_err":
print("sock_err @ ", msg[1])  #<< remind
status: closed -> open

___
Python tracker 

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



[issue28428] Rename _futures module to _asyncio

2016-10-14 Thread Yury Selivanov

Yury Selivanov added the comment:

No news entry is necessary for this.

--

___
Python tracker 

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



[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

This indicated to me that the socket object has indeed been closed _before_ you 
call getpeername():

-
print(sock)>>>

sock.getpeername()>>>
OS.Error[WinError10038]an operation was attempted on something that is not a 
socket
===

In this case, I think “[closed] fd=-1” means that both the Python-level socket 
object, and all objects returned by socket.makefile(), have been closed, so the 
OS-level socket has probably been closed. In any case, getpeername() is 
probably trying the invalid file descriptor -1. If there are no copies of the 
OS-level socket open (e.g. in other processes), then the TCP connection is 
probably also shut down, but I suspect the problem is the socket object, not 
the TCP connection.

Without code or something demonstrating the bug, I’m pretty sure it is a bug in 
your program, not in Python.

--
resolution: remind -> not a bug
stage:  -> test needed
status: open -> closed

___
Python tracker 

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



[issue27800] Regular expressions with multiple repeat codes

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

I committed my patch as it was. I understand Silent Ghost’s objection was 
mainly that they thought the new paragraph or its positioning wouldn’t be very 
useful, but hopefully it is better than nothing. Perhaps in the future, the 
documentation could be restructured with subsections for repetition qualifiers 
and other kinds of special codes, which may help.

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



[issue28290] BETA report: Python-3.6 build messages to stderr: AIX and "not GCC"

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

For the blake problem, I guess the structures may either get laid out 
incorrectly, or you might be lucky and they will get the desired packing by 
default. You might have to find if XLC has another way to enable struct 
packing. Or in the worst case, rewrite the code to pack data in a portable 
manner without using a struct.

The feature test macros like _POSIX_C_SOURCE are also discussed in various bug 
reports, including Issue 17120. How are you invoking /usr/include/standards.h? 
Perhaps there is a compiler mode or buggy header file that is getting in the 
way?

Regarding the data and function pointer confusion, this is a tricky case. I 
understand standard C (C99 etc) does not require function pointers to be 
compatible with void pointers. However, POSIX might require partial 
compatibility, at least for casting the void pointer from dlsym() to a function 
pointer: 
.

Does AIX actually have incompatible (e.g. different size) function and void 
pointers, or can we safely ignore those warnings? I think it may be annoying to 
change Python’s PyType_Slot and PyModuleDef_Slot structures to be compatible 
with function pointers, though perhaps it could be done with anonymous unions 
or something.

--
nosy: +martin.panter

___
Python tracker 

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



[issue28428] Rename _futures module to _asyncio

2016-10-14 Thread INADA Naoki

INADA Naoki added the comment:

Can I commit this patch without NEWS entry?
Only notable change is module name, but I don't expect no one import
it directly.

If it is required, it would be like:

- Issue #28428: Rename _futures module to _asyncio. It will have more
  speedup functions or classes other than asyncio.Future.

--

___
Python tracker 

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



[issue27844] Python-3.6a4 build messages to stderr (on AIX and xlc compiler)

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

The warnings about platform-dependent libraries should be suppressed now thanks 
to Issue 27713.

The warnings from Modules/_ctypes/_ctypes_test.c about bitfields are covered by 
Issue 27643. Can you help with developing the patch?

The remaning warnings all seem to be duplicates of Issue 28290.

--
nosy: +martin.panter
resolution:  -> duplicate
status: open -> closed
superseder:  -> BETA report: Python-3.6 build messages to stderr: AIX and "not 
GCC"

___
Python tracker 

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



[issue28430] asyncio: C implemeted Future cause Tornado test fail

2016-10-14 Thread INADA Naoki

INADA Naoki added the comment:

Another test failure is reported.

> I have setup a 3.6 build on Travis of our project GNS3 and it seem to fail.
> https://travis-ci.org/GNS3/gns3-server/builds/167703118

--

___
Python tracker 

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



[issue28448] C implemented Future doesn't work on Windows

2016-10-14 Thread INADA Naoki

New submission from INADA Naoki:

_WaitCancelFuture in windows_events.py overrides _schedule_callbacks.
C implemented Future should allow overriding _schedule_callbacks.

Since `{"_future", PyInit__future},` is not in PC/config.c, _future is not 
registered as builtin module. So Python 3.6b2 doesn't use it.
Instead of registering it, we should try make it split extension module (.pyd 
file).

--
assignee: inada.naoki
components: asyncio
messages: 278685
nosy: gvanrossum, inada.naoki, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: C implemented Future doesn't work on Windows
type: enhancement
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-14 Thread Georgey

Georgey added the comment:

I have changed my Username, thanks martin.

" But it sounds like you may be closing the socket in one thread, and trying to 
use it in another thread"
-- I do not attempt to "close" it in main thread. Main only detect the 
connection failure and report the socket object to the sub thread. sub thread 
tries to identify the socket object (retrieve the IP address) before closing it.

The question is - once the TCP connection is broken (e.g. client's program get 
a crash), how can I get to know the original address of that connection? 

It seems like once someone(socket) dies, I am not allowed to know the 
name(address)!

--
nosy: +GeorgeY
resolution: not a bug -> remind

___
Python tracker 

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



[issue28428] Rename _futures module to _asyncio

2016-10-14 Thread INADA Naoki

INADA Naoki added the comment:

> There is also an argument that this should not be a built-in module but 
> should be separate (like _ctypes). I don't know if that is just a Windows 
> decision or not, but I'm guessing you weren't the one who made that decision 
> originally. Issue for another time

Since _overlapped is separated extension, I think _future should be too.
I'll try it after fixing issue on windows.

--

___
Python tracker 

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



[issue27800] Regular expressions with multiple repeat codes

2016-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5f7d7e079e39 by Martin Panter in branch '3.5':
Issue #27800: Document limitation and workaround for multiple RE repetitions
https://hg.python.org/cpython/rev/5f7d7e079e39

New changeset 1f2ca7e4b64e by Martin Panter in branch '3.6':
Issue #27800: Merge RE repetition doc from 3.5 into 3.6
https://hg.python.org/cpython/rev/1f2ca7e4b64e

New changeset 98456ab88ab0 by Martin Panter in branch 'default':
Issue #27800: Merge RE repetition doc from 3.6
https://hg.python.org/cpython/rev/98456ab88ab0

New changeset 94f02193f00f by Martin Panter in branch '2.7':
Issue #27800: Document limitation and workaround for multiple RE repetitions
https://hg.python.org/cpython/rev/94f02193f00f

--
nosy: +python-dev

___
Python tracker 

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



[issue28442] tuple(a list subclass) does not iterate through the list

2016-10-14 Thread Siming Yuan

Siming Yuan added the comment:

my apologies, was in a rush to get it posted. attached a better version of the 
file.

i can reproduce this in python 3.4.1 and python 2.7.8 (both 32 and 64 bit) on 
RHEL 6.6

however after verifying again - this doesn't seem to be an issue in 3.4.5 (did 
not verify earlier versions), so it is indeed already fixed. closing.

time to upgrade!

--
resolution:  -> fixed
status: open -> closed
versions: +Python 3.4 -Python 3.5
Added file: http://bugs.python.org/file45096/weak_list.py

___
Python tracker 

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



[issue23231] Fix codecs.iterencode/decode() by allowing data parameter to be omitted

2016-10-14 Thread Martin Panter

Changes by Martin Panter :


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



[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

The getpeername() method is just a wrapper around the OS function, so it is not 
going to work if the socket file descriptor is closed or invalid (-1).

You haven’t provided enough code or information for someone else to reproduce 
the problem. But it sounds like you may be closing the socket in one thread, 
and trying to use it in another thread. This is going to be unreliable and 
racy, depending on which thread acts on the socket first. Perhaps you should 
save the peer address in the same thread that closes it, so you can guarantee 
when it is open and when it is closed. Or use something else to synchronize the 
two threads and ensure the socket is always closed after getpeername() is 
called.

BTW it looks like I have to remove George’s username from the nosy list because 
it contains a comma!

--
nosy: +martin.panter -George,Y
resolution:  -> not a bug

___
Python tracker 

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



[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-14 Thread George,Y

New submission from George,Y:

I need to know the IP address on the other side of a broken TCP/IP connection. 

"socket.getpeername()" fails to do the job sometimes because the connection has 
been closed, and Windows Error 10038 tells the connection is no longer a socket 
so that the method getpeername is wrongly used.

Here goes the code in main thread:
---
mailbox = queue.Queue()

read_sockets, write_sockets, error_sockets = 
select.select(active_socks,[],[],TIMEOUT)
for sock in read_sockets:
..
except:
mailbox.put( (("sock_err",sock), 'localhost') )
=

The sub thread get this message from mailbox and try to analyze the broken 
socket, to simplify I put the code and output together:

-
print(sock)>>>

sock.getpeername()>>>
OS.Error[WinError10038]an operation was attempted on something that is not a 
socket
===

Surprisingly,  this kind of error happen occasionally - sometimes the socket 
object is normal and getpeername() works fine.

So once a connection is broken, there is no way to tell the address to whom it 
connected?

--
components: Library (Lib)
files: socket错误不识别.png
messages: 278679
nosy: George,Y
priority: normal
severity: normal
status: open
title: socket.getpeername() failure on broken TCP/IP connection
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file45095/socket错误不识别.png

___
Python tracker 

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



[issue23231] Fix codecs.iterencode/decode() by allowing data parameter to be omitted

2016-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 402eba63650c by Martin Panter in branch '3.5':
Issue #23231: Document codecs.iterencode(), iterdecode() shortcomings
https://hg.python.org/cpython/rev/402eba63650c

New changeset 0837940bcb9f by Martin Panter in branch '3.6':
Issue #23231: Merge codecs doc from 3.5 into 3.6
https://hg.python.org/cpython/rev/0837940bcb9f

New changeset 1955dcc27332 by Martin Panter in branch 'default':
Issue #23231: Merge codecs doc from 3.6
https://hg.python.org/cpython/rev/1955dcc27332

--
nosy: +python-dev

___
Python tracker 

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



[issue28435] test_urllib2_localnet.ProxyAuthTests fails with no_proxy and NO_PROXY env

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

The test tries using ProxyHandler directly. It looks like that handler 
intentionally ignores the request if it matches no_proxies (Issue 6894), so I 
think Piotr’s approach of adjusting the tests is correct. The patch looks good 
to me, though I would drop that blank line in test_proxy_qop_auth_works().

It looks like setting a temporary environment variable should disable any 
settings from Windows registry or OS X config, so this patch should even help 
in those cases.

--
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue28446] pyvenv generates malformed hashbangs for scripts

2016-10-14 Thread Alex Regueiro

New submission from Alex Regueiro:

Quotes around hashbangs are not recognised and are considered invalid syntax, 
at least on Bash on OS X 10.12. There's really no workaround (that I'm aware 
of) for paths containing spaces, except maybe symlinking the directory in the 
path the contains the space. Maybe a warning message about this would be best.

To reproduce this issue, simply run the following from an empty directory that 
has a space in its path:

```
pyenv venv/
source ./venv/bin/activate
pip
```

The result should be something like:
```
-bash: /Users/me/dir with space/foo/venv/bin/pip: "/Users/me/dir: bad 
interpreter: No such file or directory
```

--
messages: 278676
nosy: alexreg
priority: normal
severity: normal
status: open
title: pyvenv generates malformed hashbangs for scripts
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



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

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

Just some minor comments on aix-library.161004.patch:

Instead of _util.py, I wonder if the new file should have a different name, 
like _util_common.py, to avoid being too similar to util.py.

+def get_shared(input):
+"""Internal support function: examine the get_dumpH() output and
+return a list of all shareable objects indicated in the output the
+character "[" is used to strip off the path information.

Needs a newline or new sentance to separate “output” and “the character”.

+def get_legacy(members):
+[. . .]
+# shr.o is the preffered name so we look for shr.o first

Spelling: preferred [single F, double R]

+def get_version(name, members):
+"""[. . .]
+Before the GNU convention became the standard scheme regardless of
+binary size AIX packagers used GNU convention "as-is" for 32-bit
+archive members but used an "distinguishing" name for 64-bit members.

Should be: a "distinguishing" [not “an”]

--

___
Python tracker 

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



[issue18235] _sysconfigdata.py wrong on AIX installations

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

This is my understanding:

We are talking about the code at 
 that 
switches the values of LDSHARED and/or BLDSHARED.

Yes, Michael H. was suggesting to both move and change (revert) back to 
overwriting LDSHARED with the value of BLDSHARED. Since he is moving the code 
into _init_posix(), which I think only gets called at run time, the state of 
_PYTHON_BUILD won’t affect the value of LDSHARED saved in the installed config 
file.

--

___
Python tracker 

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



[issue28442] tuple(a list subclass) does not iterate through the list

2016-10-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

(Siming, when you post a mixture of code and output, please comment out output 
with # so the example can be run as is.)

I cannot reproduce the difference reported.  I added #s and ran the cut and 
pasted code (uploaded) on 2.7, 3.5, and 3.6 installed on Win 10.  For 3.6, 

Python 3.6.0b2 (default, Oct 10 2016, 21:15:32) [MSC v.1900 64 bit (AMD64)] on 
win32

For me, the tuple output is exactly the same as the list output, except for 
'()' versus '[]'.  In 3.5+, 'instance' is changed to 'object' for both list and 
tuple.  

(<__main__.Dummy object at 0x01839C1F32E8>, <__main__.Dummy object at 
0x01839C384DA0>)

Siming, please cut and paste the interactive splash line, like the above, that 
tells us the binary and OS you used.

--
nosy: +terry.reedy
Added file: http://bugs.python.org/file45094/tem.py

___
Python tracker 

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



[issue28442] tuple(a list subclass) does not iterate through the list

2016-10-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2016-10-14 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

ping

--

___
Python tracker 

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



[issue28445] Wrong documentation for GzipFile.peek

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

The peek() method was originally added by Issue 9962, where Antoine was trying 
to imitate the BufferedReader.peek() API. However because “the number of bytes 
returned may be more or less than requested”, I never understood what this 
methods were good for; see also Issue 5811.

I think we could at least remove the claim about “at most one single read”. 
That is just describing an internal detail.

The documentation for bzip and LZMA is slightly more useful IMO because it says 
“at least one byte of data will be returned, unless EOF has been reached”. This 
guarantee is actually missing from the underlying BufferedReader.peek() 
documentation, though I think both io and _pyio implement it.

--

___
Python tracker 

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



[issue28443] Logger methods never use kwargs

2016-10-14 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

In your patch, there is an assignation to self.kwargs = kwargs  but you don't 
use it into your code. Maybe with inheritance ?

--
nosy: +matrixise

___
Python tracker 

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



[issue28396] Remove *.pyo references from man page

2016-10-14 Thread Brett Cannon

New submission from Brett Cannon:

The patch LGTM.

--
assignee: docs@python -> brett.cannon
nosy: +brett.cannon
versions: +Python 3.5, 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



[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-14 Thread Brett Cannon

Brett Cannon added the comment:

Since /dev/null is not a file according to os.path.isfile(), I'm going to close 
this as not a bug.

And to answer Antti's question, it's because the semantics come from the 
original C code where EAFP is not pleasant.

--
nosy: +brett.cannon
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



[issue28436] GzipFile doesn't properly handle short reads and writes on the underlying stream

2016-10-14 Thread Martin Panter

Martin Panter added the comment:

I would fix the documentation to say the underlying stream should do “exact” 
reads and writes, e.g. one that implements io.BufferedIOBase.read(size) or 
write(). In my experience, most APIs in Python’s library assume or require 
this, rather than the “raw” behaviour.

Is it likely that people are passing raw FileIO or similar objects to GzipFile, 
or is this just a theoretical problem?

Also related: In Issue 24291 and Issue 26721, we realized that all the servers 
based on socketserver could unexpectedly do short writes, which was a practical 
bug (not just theoretical). I changed socketserver over to doing exact writes, 
and added a workaround in the wsgiref module to handle partial writes. See 

 for the altered documentation.

Other APIs that come to mind are shutil.copyfileobj() (documentation proposed 
in Issue 24291), and io.TextIOWrapper (documented as requiring BufferedIOBase). 
Also, the bzip and LZMA modules seem equally affected as gzip.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
stage:  -> needs patch
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



[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage:  -> test needed
versions: +Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue28415] PyUnicode_FromFromat interger format handling different from printf about zeropad

2016-10-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I presume that PyUnicode_FromFormat is responsible for the first of the 
following:
>>> '%010.5d' % 100
'000100'
>>> b'%010.5d' % 100
b'000100'

I am strongly of the opinion that the behavior should be left alone and the 
C-API doc changed by either 1) replacing 'exactly' with 'nearly' or 2) adding 
the following: "except that a 0 conversion flag is not ignored when a precision 
is given for d, i, o, u, x and X conversion types" (and other exceptions as 
discovered).

I took the terms 'conversion flag' and 'conversion type' from
https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
https://docs.python.org/3/library/stdtypes.html#printf-style-bytes-formatting

I consider the Python behavior to be superior.  The '0' conversion flag, the 
'.' precision indicator, and the int conversion types are literal characters.  
If one does not want the '0' conversion, one should omit it and not write it to 
be ignored.
>>> '%10.5d' % 100
' 00100'

And I consider the abolition of int 'precision', inr {} formatting even better. 
 
>>> '{:010.5d}'.format(100)
Traceback (most recent call last):
  File "", line 1, in 
'{:010.5d}'.format(100)
ValueError: Precision not allowed in integer format specifier

It has always been a source of confusion, and there is hardly any real-world 
use case for a partial 0 fill.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, eric.smith, terry.reedy

___
Python tracker 

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



[issue28403] Porting guide: disabling & warning on implicit unicode conversions

2016-10-14 Thread Brett Cannon

Brett Cannon added the comment:

If a new codec gets added to 2.7 then I'm fine with the proposed change.

--

___
Python tracker 

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



[issue28411] Eliminate PyInterpreterState.modules.

2016-10-14 Thread Brett Cannon

Brett Cannon added the comment:

As Nick pointed out, PyInterpreterState's fields are private so do what you 
want. :)

--

___
Python tracker 

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



[issue28424] pkgutil.get_data() doesn't work with namespace packages

2016-10-14 Thread Brett Cannon

Brett Cannon added the comment:

Xiang is right about why this doesn't work. If you would like to propose a 
patch to update the wording of the docs, Douglas, we could then consider 
applying it. It could be as simple as just adding "(e.g. the load for namespace 
packages does not implement get_data())".

And there is no equivalent feature in importlib (yet; it's on my todo list).

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python

___
Python tracker 

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



[issue25152] venv documentation doesn't tell you how to specify a particular version of python

2016-10-14 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: docs@python -> brett.cannon

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Please upload the output of make, this is where the error messages are printed 
when extension modules fail to build.
Where is set the root directory for arm headers and libraries in the configure 
command line ?

--
nosy: +xdegaye

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-14 Thread Nathaniel Smith

Nathaniel Smith added the comment:

> 3.6 currently compiles correctly with gcc4.2, the default on Mac OS X 10.5 
> (Leopard).

So to summarize our current understanding: gcc 4.3 added support for C99 
inline, which explains why gcc 4.2 works and gcc 4.8 doesn't.

WTF is going on.

--

___
Python tracker 

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



[issue28442] tuple(a list subclass) does not iterate through the list

2016-10-14 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue28445] Wrong documentation for GzipFile.peek

2016-10-14 Thread Xiang Zhang

Xiang Zhang added the comment:

The "compressed stream" is not the underlying file object but _GzipReader. And 
actually the "at most one single reader" is the characteristic of 
io.BufferedReader.peek, you can see it in the doc. Maybe it needs multiple 
reads on the file object in a single peek, but they are all encapsulated in the 
_GzipReader.read. So at the point of GzipFile.peek, it's still a single read.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue28445] Wrong documentation for GzipFile.peek

2016-10-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +martin.panter

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-14 Thread Ned Deily

Ned Deily added the comment:

"while non-static inline has problems with the default compilers on both CentOS 
5 and OS X."

The changes introduced in 3.6 prevent compilation with gcc4.0 which was the 
default Apple-supplied compiler on Mac OS X 10.4 (Tiger).  3.6 currently 
compiles correctly with gcc4.2, the default on Mac OS X 10.5 (Leopard).

--

___
Python tracker 

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



[issue28443] Logger methods never use kwargs

2016-10-14 Thread Vinay Sajip

Vinay Sajip added the comment:

Those signatures have **kwargs for potential extension of the logging API 
itself (without extending the existing argument list), not for passing 
arguments to filters.

You can already filter completely flexibly by passing additional values  in the 
"extra" parameter, which writes those to the LogRecord. This can  be inspected 
by filters in the same way as you propose, so there seems no reason to provide 
another way of doing this.

N.B. Removed larry from the nosy list, as he was apparently added by accident 
when the "Argument Clinic" component was selected in error.

--
nosy:  -larry

___
Python tracker 

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



[issue28440] ensurepip and pip install failures on macOS Sierra with non-system Python 2.7.x

2016-10-14 Thread Ned Deily

Ned Deily added the comment:

This also affects the -m ensurepip installation of pip itself: the pip install 
fails trying to upgrade the Apple-supplied version of setuptools.  The behavior 
of adding the system Python's site-packages directory to the search path of all 
framework-build Pythons was deliberately added as a result of Issue4865.  I 
think experience has shown this was not a good idea because of the coupling it 
introduced between separate Python installations and some third-party 
distributors of Python on OS X already patch this code out.  It's currently 
only an issue for 2.7.x since Apple has not yet shipped versions of Python 3.x 
but the code should be removed there, too.

--
assignee:  -> ned.deily
nosy: +benjamin.peterson
priority: normal -> release blocker
stage:  -> patch review
title: pip failures on macOS Sierra -> ensurepip and pip install failures on 
macOS Sierra with non-system Python 2.7.x
type: compile error -> 
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



[issue28445] Wrong documentation for GzipFile.peek

2016-10-14 Thread Evgeny Kapun

New submission from Evgeny Kapun:

>From the documentation for GzipFile.peek():

At most one single read on the compressed stream is done to satisfy the 
call.

If "compressed stream" means the underlying file object, then this is not true. 
The method tries to return at least one byte, unless the stream is at EOF. It 
is possible to create arbitrarily long compressed stream that would decompress 
to nothing, and the implementation would read the entire stream in this case. 
Because the length of the stream is not known in advance, several reads may be 
required for this.

Perhaps the documentation for GzipFile.peek() should be made the same as that 
for BZ2File.peek() and LZMAFile.peek().

--
assignee: docs@python
components: Documentation
messages: 278656
nosy: abacabadabacaba, docs@python
priority: normal
severity: normal
status: open
title: Wrong documentation for GzipFile.peek
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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-14 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Yeah, the config.log there clearly shows that configure is using gcc 4.8.2 on 
the failed builds. Very odd.

Stepping back for a moment, is there any point in continuing to debug this? 
Given Benjamin's comment up-thread:

> I mainly converted them to see if it would cause problems

My impression is that restricting inline functions to 'static inline' only is 
the best plan for 3.6 anyway, since AFAIK that really does work on all the 
compilers that people are likely to run into, while non-static inline has 
problems with the default compilers on both CentOS 5 and OS X.

--

___
Python tracker 

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



[issue15100] Race conditions in shutil.copy, shutil.copy2 and shutil.copyfile

2016-10-14 Thread Julien Muchembled

Changes by Julien Muchembled :


--
nosy: +jm

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2016-10-14 Thread Evgeny Kapun

Changes by Evgeny Kapun :


--
nosy: +abacabadabacaba

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-14 Thread Benny K J

Changes by Benny K J :


--
type:  -> compile error

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-14 Thread Benny K J

New submission from Benny K J:

When cross compiling Python for ARM many of the extension modules are not build

However when compiling for the native platform the extension modules are 
properly build.

Cross Compilation Steps
===

CONFIG_SITE=config.site CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ 
AR=arm-linux-gnueabihf-ar RANLIB=arm-linux-gnueabihf-ranlib 
READELF=arm-linux-gnueabihf-readelf ./configure --enable-shared 
--host=arm-linux --build=x86_64-linux-gnu --disable-ipv6 --prefix=/opt/python3


make

sudo 
PATH=/home/benny/workspace/projects/webshield/src/dntl_ws/sw/toolchain/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin:$PATH
 make install


Extension Modules Built when cross compiled
===

building '_ctypes_test' extension
building 'cmath' extension
building '_json' extension
building '_testcapi' extension
building '_testbuffer' extension
building '_testimportmultiple' extension
building '_testmultiphase' extension
building '_lsprof' extension
building '_opcode' extension
building 'parser' extension
building 'mmap' extension
building 'audioop' extension
building '_crypt' extension
building '_csv' extension
building 'termios' extension
building 'resource' extension
building 'nis' extension
building '_multibytecodec' extension
building '_codecs_kr' extension
building '_codecs_jp' extension
building '_codecs_cn' extension
building '_codecs_tw' extension
building '_codecs_hk' extension
building '_codecs_iso2022' extension
building '_decimal' extension
building '_multiprocessing' extension
building 'ossaudiodev' extension
building 'xxlimited' extension
building '_ctypes' extension


Compilation Steps on x86 Machine


CONFIG_SITE=config.site ./configure --enable-shared --disable-ipv6 
--prefix=/opt/python3

make

sudo make install

Extension Modules Built when natively compiled
===
building '_struct' extension
building '_ctypes_test' extension
building 'array' extension
building 'cmath' extension
building 'math' extension
building '_datetime' extension
building '_random' extension
building '_bisect' extension
building '_heapq' extension
building '_pickle' extension
building '_json' extension
building '_testcapi' extension
building '_testbuffer' extension
building '_testimportmultiple' extension
building '_testmultiphase' extension
building '_lsprof' extension
building 'unicodedata' extension
building '_opcode' extension
building 'fcntl' extension
building 'grp' extension
building 'spwd' extension
building 'select' extension
building 'parser' extension
building 'mmap' extension
building 'syslog' extension
building 'audioop' extension
building 'readline' extension
building '_crypt' extension
building '_csv' extension
building '_posixsubprocess' extension
building '_socket' extension
building '_sha256' extension
building '_sha512' extension
building '_md5' extension
building '_sha1' extension
building 'termios' extension
building 'resource' extension
building 'nis' extension
building 'binascii' extension
building 'pyexpat' extension
building '_elementtree' extension
building '_multibytecodec' extension
building '_codecs_kr' extension
building '_codecs_jp' extension
building '_codecs_cn' extension
building '_codecs_tw' extension
building '_codecs_hk' extension
building '_codecs_iso2022' extension
building '_decimal' extension
building '_multiprocessing' extension
building 'ossaudiodev' extension
building 'xxlimited' extension
building '_ctypes' extension

I've further tried building for ARM natively on ARM machine and the extensions 
was build successfully.

Tool chain used for cross compilation
===

Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/home/benny/workspace/projects/webshield/src/dntl_ws/sw/toolchain/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.4/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: 
/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/snapshots/gcc-linaro-4.9-2016.02/configure
 SHELL=/bin/bash --with-bugurl=https://bugs.linaro.org 
--with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu
 
--with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu
 
--with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu
 --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap 
--with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 
--with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 
--with-float=hard --with-mode=thumb --disable-multilib --en

[issue28443] Logger methods never use kwargs

2016-10-14 Thread Jordan Brennan

Changes by Jordan Brennan :


--
components: +Library (Lib)

___
Python tracker 

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



[issue28443] Logger methods never use kwargs

2016-10-14 Thread Jordan Brennan

Changes by Jordan Brennan :


--
components:  -Argument Clinic

___
Python tracker 

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



[issue28443] Logger methods never use kwargs

2016-10-14 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue28442] tuple(a list subclass) does not iterate through the list

2016-10-14 Thread Siming Yuan

Changes by Siming Yuan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue28443] Logger methods never use kwargs

2016-10-14 Thread Jordan Brennan

New submission from Jordan Brennan:

The methods on the Logger class e.g. logger.debug all accept **kwargs, these 
are passed to the _log method but they are never used.

If _log attached them as an attribute to the LogRecord object, it would allow 
for creation of more powerful Filter objects to be created.

You would then be able to filter log lines based on arbitrary keyword arguments.

I've attached a patch along with tests that I think would be a sensible 
addition and I think that this shouldn't impact existing users of the module.

--
components: Argument Clinic
files: loggingkwargs.patch
keywords: patch
messages: 278653
nosy: jb098, larry
priority: normal
severity: normal
status: open
title: Logger methods never use kwargs
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45092/loggingkwargs.patch

___
Python tracker 

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



[issue28442] tuple(a list subclass) does not iterate through the list

2016-10-14 Thread Siming Yuan

New submission from Siming Yuan:

if you subclass a list, and cast it to tuple, the casting does not iterate 
through the list.
(casing to list does)

for example, i needed a WeakList where the list only internally contains 
WeakReferences that gets deleted as soon as the object ref count goes to zero.. 
so:

import weakref

class WeakList(list):

def __init__(self, items = ()):
super(WeakList, self).__init__([weakref.ref(i, self.remove) for i in 
items])

def __contains__(self, item):
return super(WeakList, self).__contains__(weakref.ref(item))

def __getitem__(self, index):
if isinstance(index, slice):
return [i() for i in super(WeakList, self).__getitem__(index)]
else:
return super(WeakList, self).__getitem__(index)()

def __setitem__(self, index, item):
if isinstance(index, slice):
item = [weakref.ref(i, self.remove) for i in item]
else:
item = weakref.ref(item, self.remove)

return super(WeakList, self).__setitem__(index, item)

def __iter__(self):
for i in list(super(WeakList, self).__iter__()):
yield i()

def remove(self, item):
if isinstance(item, weakref.ReferenceType):
super(WeakList, self).remove(item)
else:
super(WeakList, self).remove(weakref.ref(item))

def append(self, item):
return super(WeakList, self).append(weakref.ref(item, self.remove))


# write some test code:
class Dummy():
pass

a = Dummy()
b = Dummy()

l = WeakList()
l.append(a)
l.append(b)

print(a)
<__main__.Dummy instance at 0x7f29993f4ab8>

print(b)
<__main__.Dummy instance at 0x7f29993f4b00>

print(l)
[, ]

print([i for i in l])
[<__main__.Dummy instance at 0x7f29993f4ab8>, <__main__.Dummy instance at 
0x7f29993f4b00>]

print(list(l))
[<__main__.Dummy instance at 0x7f29993f4ab8>, <__main__.Dummy instance at 
0x7f29993f4b00>]

print(tuple(l))
(, )

^ notice how you are getting weak references back instead of tuples.

--
messages: 278652
nosy: siming85
priority: normal
severity: normal
status: open
title: tuple(a list subclass) does not iterate through the list
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker 

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



[issue28440] pip failures on macOS Sierra

2016-10-14 Thread R. David Murray

Changes by R. David Murray :


--
components: +Macintosh
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue28442] tuple(a list subclass) does not iterate through the list

2016-10-14 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue28430] asyncio: C implemeted Future cause Tornado test fail

2016-10-14 Thread Марк Коренберг

Changes by Марк Коренберг :


--
nosy: +mmarkk

___
Python tracker 

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



[issue28437] Class definition is not consistent with types.new_class

2016-10-14 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue28441] sys.executable is ambiguous on Cygwin without .exe suffix

2016-10-14 Thread Erik Bray

New submission from Erik Bray:

This actually came up previously in #1543469 in the context of test_subprocess, 
but it's a more general issue that I thought was worth addressing somehow.

The issue here is that as Cygwin tries to provide a "UNIX-like" experience, any 
system interfaces that take the path to an executable as an argument allow the 
.exe extension to be left off.  This is particularly convenient for the shell 
experience, so that one can run, for example "python" or "ls" without typing 
"python.exe"  or "ls.exe" (this is of course true of the Windows cmd shell as 
well).

In the case of ambiguity however--such as when there is both a "python" and a 
"python.exe" in the same path, one must explicitly add the ".exe", otherwise 
the path without the exe is assumed.  This is made even worse when you factor 
in case-insensitivity.

Thus, this becomes a real annoyance when developing Python on Cygwin because 
you get both a "python.exe" and the "Python" directory in your source tree.  
This isn't so much of a problem, except that sys.executable leaves off the 
".exe" (in UNIX-y fashion), so any test that calls Popen([sys.executable]) 
errors out because it thinks you're trying to execute a directory (Python/).

I think the only reasonable fix is to take the patch suggested at #1543469, and 
ensure that the ".exe" suffix is appended to sys.executable on Cygwin.  I think 
that sys.executable should be as unambiguous as possible, and that's the only 
way to make it reasonably unambiguous on Cygwin.

I've attached a patch adapted from the one in #1543469 which solves the issue 
for me.

--
files: cygwin-sys-executable.patch
keywords: needs review, patch
messages: 278651
nosy: erik.bray, masamoto, zach.ware
priority: normal
severity: normal
status: open
title: sys.executable is ambiguous on Cygwin without .exe suffix
type: behavior
versions: Python 3.7
Added file: http://bugs.python.org/file45091/cygwin-sys-executable.patch

___
Python tracker 

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



[issue28428] Rename _futures module to _asyncio

2016-10-14 Thread Steve Dower

Steve Dower added the comment:

Sure. The build-specific changes for Windows look fine to me.

There is also an argument that this should not be a built-in module but should 
be separate (like _ctypes). I don't know if that is just a Windows decision or 
not, but I'm guessing you weren't the one who made that decision originally. 
Issue for another time

--

___
Python tracker 

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



[issue28440] pip failures on macOS Sierra

2016-10-14 Thread Marc Culler

New submission from Marc Culler:

Changes made to /Library/Python on macOSX Sierra cause the --with-ensurepip 
compiler flag to fail, and lead to failures of pip after installing Python.

The new file that causes the problem on Sierra is:
/Library/Python/2.7/site-packages/Extras.pth
The current version of site.py reads that .pth file, which results in sys.path 
containing the path:
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
The latter directory (which is protected by SIP) contains many Python 2.7 
packages, including easy_install, setuptools, six, py2app, numpy, pylab and 
pyOpenSSL.  The effect of including this SIP-protected path in sys.path is 
this:  installing or upgrade a package in /Library/Frameworks/Python.framework 
which is also installed as an "Extra" in the 
/System/Frameworks/Python.framework will cause pip to attempt to delete the 
"old" package from its SIP-protected directory, leading to a "Permission 
Denied" exception and a failed install.

Given that Apple has now tied /Library/Python to the system Python in this way, 
thereby making a separate Python framework in /Library/Frameworks unusable, the 
natural solution to this problem would be to stop including any /Library/Python 
paths in sys.path.

I am attaching a patch that removes the block of code in site.py which adds 
these paths.

--
files: pipfails.patch
keywords: patch
messages: 278649
nosy: Marc.Culler
priority: normal
severity: normal
status: open
title: pip failures on macOS Sierra
type: compile error
Added file: http://bugs.python.org/file45090/pipfails.patch

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-14 Thread Robin Becker

Robin Becker added the comment:

tds333, the config says that 4.8.2 is being used, 

configure:3902: gcc --version >&5
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

but perhaps the make is doing something else or the build goes wrong because 
shared is disabled.

--

___
Python tracker 

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



[issue28428] Rename _futures module to _asyncio

2016-10-14 Thread INADA Naoki

INADA Naoki added the comment:

I found _futures module is not used on Windows for now (without this patch).
Because `{"_future", PyInit__future},` is not in PC/config.c

But, when it added, test_windows_events cause infinite loop.
This should be another issue.

With this (asyncio-speedups2.patch), build on Windows succeeds,
and test succeeds (without speedup enabled).

I want to apply this patch before fixing the issue and adding _asyncio to 
PC/config.c
Is it OK?

--

___
Python tracker 

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



[issue26617] Assertion failed in gc with __del__ and weakref

2016-10-14 Thread STINNER Victor

STINNER Victor added the comment:

> You should ask for a downstream backport.

I created the issue: https://bugzilla.redhat.com/show_bug.cgi?id=1384957

--

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-14 Thread Wolfgang Langner

Wolfgang Langner added the comment:

Also verified on CentOS 6.8 with devtoolset2 installed, gcc 4.8.2
Python 3.6b2 builds fine, all unittest ok.
This is the same devtoolset as used on CentOS 5 manylinux1.
Have no CentOS 5 VM available to do more tests. But gcc 4.8 is able to build 
Python 3.6.

--

___
Python tracker 

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



[issue26617] Assertion failed in gc with __del__ and weakref

2016-10-14 Thread STINNER Victor

STINNER Victor added the comment:

> Would be nice if 3.4 could also be patched, not just 3.5 and 3.6, since 
> python in EPEL currently is python34-3.4.3-7.el7.x86_64. The patch can be 
> applied without conflict and resolves some serious cases of segfaults.

Sorry but Python 3.4 is not more supported upstream:
https://docs.python.org/devguide/#status-of-python-branches

You should ask for a downstream backport.

--

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-14 Thread Wolfgang Langner

Wolfgang Langner added the comment:

Please check if you have enabled the compiler as default by enabling the 
devtoolset on CentOS 5.

I have compiled Python 3.6b2 on Ubuntu 14.04 with gcc 4.8.4 without any 
problems.
Therefore gcc 4.8.2 should not be that different.

Also keep in mind the default gcc for CentOS 5 will fail because it is to old.

--

___
Python tracker 

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



[issue26617] Assertion failed in gc with __del__ and weakref

2016-10-14 Thread Frens Jan Rumph

Frens Jan Rumph added the comment:

Would be nice if 3.4 could also be patched, not just 3.5 and 3.6, since python 
in EPEL currently is python34-3.4.3-7.el7.x86_64. The patch can be applied 
without conflict and resolves some serious cases of segfaults.

--
nosy: +Frens Jan Rumph

___
Python tracker 

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



[issue28435] test_urllib2_localnet.ProxyAuthTests fails with no_proxy and NO_PROXY env

2016-10-14 Thread Łukasz Langa

Changes by Łukasz Langa :


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



[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2016-10-14 Thread loic rowe

loic rowe added the comment:

I don't disapprove the proposal on the need to have an explanation on the 
difference between a container and an iterator.

But I was unable to found in the documentation a proper definition of a 
container.

--

___
Python tracker 

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



[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2016-10-14 Thread Anders Kaseorg

Anders Kaseorg added the comment:

Usui, this is a tutorial intended for beginners.  Even if the change from 
“most” to “built-in” were a relevant one (and I don’t see how it is), beginners 
cannot possibly be expected to parse that level of meaning out of a single word.

The difference between iterators and containers deserves at least a couple of 
sentences and preferably an example that includes both, as I proposed in 
http://bugs.python.org/issue8376#msg102966.  Do you disapprove of that proposal?

--

___
Python tracker 

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



[issue28439] Remove redundant checks in PyUnicode_EncodeLocale

2016-10-14 Thread Xiang Zhang

Changes by Xiang Zhang :


--
components: Interpreter Core
files: PyUnicode_EncodeLocale.patch
keywords: patch
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Remove redundant checks in PyUnicode_EncodeLocale
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45089/PyUnicode_EncodeLocale.patch

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-14 Thread Robin Becker

Robin Becker added the comment:

Hi njs,

my manylinux diffs
https://www.reportlab.com/media/manylinux-diff.txt

full output of the docker command
docker build -f Dockerfile-x86_64 -t rl/manylinux-x86_64 . &> ~/tmp/ttt

https://www.reportlab.com/media/manylinux-docker-run-output.txt

the end showing the 3.6b2 config and the failure
https://www.reportlab.com/media/manylinux-docker-run-python-3.6b2.txt

--

___
Python tracker 

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



[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2016-10-14 Thread Usui

Usui added the comment:

My proposal for this documentation point is to get rid off the word "most" and 
to replace it with "built-in". Since it will remove the misleading idea that 
this paragraph can explain how you can write a containers.

--
keywords: +patch
nosy: +Usui
Added file: http://bugs.python.org/file45088/issue8376.patch

___
Python tracker 

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



[issue28427] WeakValueDictionary next bug (with multithreading)

2016-10-14 Thread Armin Rigo

Armin Rigo added the comment:

I'll admit I don't know how to properly fix this issue.  What I came up with so 
far would need an atomic compare_and_delete operation on the dictionary 
self.data, so that we can do atomically:

+elif self.data[wr.key] is wr:
 del self.data[wr.key]

--

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-10-14 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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