[issue32276] there is no way to make tempfile reproducible (i.e. seed the used RNG)

2017-12-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

This seems ill-advised:

* If a deterministic filename is needed, tempfile probably shouldn't be used.

* Mock objects are typically used when alternative behavior is needed for 
testing.

* The proposed feature would preclude a possible future development path to use 
SystemRandom which wouldn't be able to accept a seed.

* Having the same filename used on successive runs will likely cause other 
problems. Generally, a user of tempname can assume that filename doesn't 
already exist and the proposed option would undermine that assumption.

* I suspect if there were a real need here, we would have heard about it a long 
time ago.  This module is over two decades old.

--
components: +Library (Lib)
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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-12-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> Raymond: Would you mind to explain why you close the issue?

On python-dev, Inada suggested he would drop this issue if Guido approved 
regular dicts having guaranteed order.  That occurred and I closed this issue.

The other reasons were listed earlier in this thread and on my python-dev post. 
  Roughly, the OP is making the wrong trade-offs, trying to optimize what 
regular dicts are already good at.  The OrderedDict aspires to be good at other 
things and to serve as an alternative to regular dicts in situations that 
aren't favorable to regular dicts.

The OP seems to be infinitely persistent on this subject eventhough I've 
clearly stated that I do not approve of this going forward.  No amount of 
talking seems to convince him of the merits of doubly linked list.  In the LRU 
case, when the cache is large enough, there will be a high hit rate.  With a 
doubly-linked list, all that is entailed is a single dict lookup for the link 
and a fast link update (all currently done in C with beautifully clean and 
efficient code).  Without a doubly-linked list, we have to remove an element 
from the dictionary (leaving a hole), then re-add the element at the end and 
then periodically run and an O(n) compaction.  The current design doesn't have 
any of that cost.

The current ordered dict could run move_to_end() a billion times in succession 
and never trigger an O(n) resize or compaction.  The OP either doesn't get this 
or doesn't care about what ordered dicts were actually designed to be good at.

The current design was done on purpose.  There were explicitly rejected 
alternatives.  For example, we could have keep a regular dictionary augmented 
by a list, just appending and periodically compacting.  This would have given 
faster iteration, less memory usage, and a simpler implementation; however, it 
was explicitly rejected because doubly-linked lists could gracefully handle 
frequent semi-random deletions, insertions, and moves-to-end points.  For 
example, the compact dict would perform terribly for repeated move to front 
operations.

When I get time over the holidays, I will build some examples where the 
proposed patch causes performance to crater.  In the mean time, I have other 
important things to work on (documenting and testing the new dict guarantees, 
features for 3.7 before the freeze, etc).

--

___
Python tracker 

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



[issue32328] ttk.Treeview: _tkinter.TclError: list element in quotes followed by "; " instead of space

2017-12-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

With imports modified, same exceptions in 3.7.0a2 on Win10

--
nosy: +terry.reedy
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



[issue32331] Fix socket.type on Linux

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

Nathaniel, thanks a lot for the comprehensive analysis.

It's now obvious that this weird Linux-specific socket.type quirk is of our own 
making and specific only to Python.

I've updated the PR:

1. *type* argument of 'socket.socket()' is passed as is to OS functions.  It is 
now cleared of SOCK_NONBLOCK and SOCK_CLOEXEC on Linux.

2. socket.setblocking() no longer applies SOCK_NONBLOCK to socket.type.

That's it.  I'm now certain that this is the correct way of handling this 
situation.  socket.type must be fixed.

Please review the updated PR.

--

___
Python tracker 

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



[issue32315] can't run any scripts with 2.7.x, 32 and 64-bit

2017-12-15 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg308454

___
Python tracker 

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



[issue32315] can't run any scripts with 2.7.x, 32 and 64-bit

2017-12-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Your posted code and much else runs fine for me with 2.7.14 on Win 10. Millions 
of lines of legal Python code run on perhaps a million machines aroung the 
world.  Except possibly for your particular machine, your conclusion is wrong.

>From the traceback, you are running code via IDLE, most likely from the 
>editor.  Please specify exactly what you do to get the error, starting with 
>which 2.7.z patch release you are using.

When current Python and IDLE are correctly installed, PyShell.use_subprocess is 
set to True nearly first thing on startup.  If one starts IDLE with the '-n' 
option, use_subprocess is set to False.  The variable is never deleted.

This is the first report I know of where Python sees use_subprocess as missing. 
 Why?  I can think of the following possibilities of what might be wrong on 
your machine:
* Your python installation has a severe bug. If you need help with 
re-installing, try the python-list mailing list.
* Hardware bug.  See a tech.
* You are using an obsolete version of 2.7 and ran into a bug since fixed.  
Upgrade to 2.7.14.
* You have MacOS and ignored https://www.python.org/download/mac/tcltk/.  Click 
Help and About IDLE and the box will include the tcl/tk version being run.  
Follow the instruction very carefully.

None of the above are in scope for this tracker.

* You somehow triggered a severe super-obscure bug. If you convince me that 
there might plausibly be a bug in IDLE, and agree to help investigate, I will 
try to find and fix it.

For a start, run "python -m test" on a terminal or command line, where 'python' 
is the specific command to run 2.7 on your OS.

--
status:  -> open

___
Python tracker 

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



[issue32331] Fix socket.type on Linux

2017-12-15 Thread Yury Selivanov

Change by Yury Selivanov :


--
title: Add socket.truetype property -> Fix socket.type on Linux

___
Python tracker 

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



[issue32343] Leak Sanitizer reports memory leaks while building using ASAN

2017-12-15 Thread Kirit Sankar Gupta

New submission from Kirit Sankar Gupta :

./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi

=
==12061==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 287665 byte(s) in 116 object(s) allocated from:
#0 0x4ef9b0 in malloc (/home/ksg/cpython/python+0x4ef9b0)
#1 0x6411a9 in PyMem_RawMalloc /home/ksg/cpython/Objects/obmalloc.c:503:12
#2 0x6411a9 in _PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:1560
#3 0x6462c7 in PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:616:12

Direct leak of 5096 byte(s) in 9 object(s) allocated from:
#0 0x4ef9b0 in malloc (/home/ksg/cpython/python+0x4ef9b0)
#1 0x6411a9 in PyMem_RawMalloc /home/ksg/cpython/Objects/obmalloc.c:503:12
#2 0x6411a9 in _PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:1560
#3 0x6462c7 in PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:616:12
#4 0x9786dd in _PyObject_GC_Malloc 
/home/ksg/cpython/Modules/gcmodule.c:1713:12
#5 0x9786dd in _PyObject_GC_NewVar /home/ksg/cpython/Modules/gcmodule.c:1742

Direct leak of 2746 byte(s) in 3 object(s) allocated from:
#0 0x4efdd5 in realloc (/home/ksg/cpython/python+0x4efdd5)
#1 0x641828 in PyMem_RawRealloc /home/ksg/cpython/Objects/obmalloc.c:521:12
#2 0x641828 in _PyObject_Realloc /home/ksg/cpython/Objects/obmalloc.c:1905
#3 0x6463fd in PyObject_Realloc /home/ksg/cpython/Objects/obmalloc.c:634:12

Direct leak of 591 byte(s) in 1 object(s) allocated from:
#0 0x4ef9b0 in malloc (/home/ksg/cpython/python+0x4ef9b0)
#1 0x6411a9 in PyMem_RawMalloc /home/ksg/cpython/Objects/obmalloc.c:503:12
#2 0x6411a9 in _PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:1560
#3 0x6462c7 in PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:616:12
#4 0x8dace5 in r_object /home/ksg/cpython/Python/marshal.c:1392:20
#5 0x8d8780 in r_object /home/ksg/cpython/Python/marshal.c:1224:18
#6 0x8dad1c in r_object /home/ksg/cpython/Python/marshal.c:1395:22
#7 0x8d8780 in r_object /home/ksg/cpython/Python/marshal.c:1224:18
#8 0x8dad1c in r_object /home/ksg/cpython/Python/marshal.c:1395:22
#9 0x8d3e1d in PyMarshal_ReadObjectFromString 
/home/ksg/cpython/Python/marshal.c:1598:14
#10 0x8bffa6 in get_frozen_object /home/ksg/cpython/Python/import.c:1258:12
#11 0x8bffa6 in _imp_get_frozen_object_impl 
/home/ksg/cpython/Python/import.c:2018
#12 0x8bffa6 in _imp_get_frozen_object 
/home/ksg/cpython/Python/clinic/import.c.h:176
#13 0x568e15 in _PyMethodDef_RawFastCallDict 
/home/ksg/cpython/Objects/call.c:497:18
#14 0x56772b in _PyCFunction_FastCallDict 
/home/ksg/cpython/Objects/call.c:582:14
#15 0x56772b in PyCFunction_Call /home/ksg/cpython/Objects/call.c:787

Direct leak of 560 byte(s) in 1 object(s) allocated from:
#0 0x4ef9b0 in malloc (/home/ksg/cpython/python+0x4ef9b0)
#1 0x641900 in PyMem_RawMalloc /home/ksg/cpython/Objects/obmalloc.c:503:12
#2 0x641900 in _PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:1560
#3 0x641900 in pymalloc_realloc /home/ksg/cpython/Objects/obmalloc.c:1882
#4 0x641900 in _PyObject_Realloc /home/ksg/cpython/Objects/obmalloc.c:1901
#5 0x6463fd in PyObject_Realloc /home/ksg/cpython/Objects/obmalloc.c:634:12

Direct leak of 2 byte(s) in 2 object(s) allocated from:
#0 0x4ef9b0 in malloc (/home/ksg/cpython/python+0x4ef9b0)
#1 0x6411a9 in PyMem_RawMalloc /home/ksg/cpython/Objects/obmalloc.c:503:12
#2 0x6411a9 in _PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:1560
#3 0x645e07 in PyMem_Malloc /home/ksg/cpython/Objects/obmalloc.c:536:12

Indirect leak of 28768 byte(s) in 31 object(s) allocated from:
#0 0x4ef9b0 in malloc (/home/ksg/cpython/python+0x4ef9b0)
#1 0x6411a9 in PyMem_RawMalloc /home/ksg/cpython/Objects/obmalloc.c:503:12
#2 0x6411a9 in _PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:1560
#3 0x6462c7 in PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:616:12
#4 0x67ab2a in PyType_GenericAlloc 
/home/ksg/cpython/Objects/typeobject.c:969:15

Indirect leak of 8028 byte(s) in 8 object(s) allocated from:
#0 0x4ef9b0 in malloc (/home/ksg/cpython/python+0x4ef9b0)
#1 0x6411a9 in PyMem_RawMalloc /home/ksg/cpython/Objects/obmalloc.c:503:12
#2 0x6411a9 in _PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:1560
#3 0x6462c7 in PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:616:12

Indirect leak of 2571 byte(s) in 2 object(s) allocated from:
#0 0x4ef9b0 in malloc (/home/ksg/cpython/python+0x4ef9b0)
#1 0x6411a9 in PyMem_RawMalloc /home/ksg/cpython/Objects/obmalloc.c:503:12
#2 0x6411a9 in _PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:1560
#3 0x6462c7 in PyObject_Malloc /home/ksg/cpython/Objects/obmalloc.c:616:12
#4 0x68d0b6 in type_call 

[issue32331] Add socket.truetype property

2017-12-15 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Re-reading my above post, I realized I want to emphasize a little more how odd 
the current relationship is between socket.type and SOCK_CLOEXEC. Right now, 
the way it works is:

Python *always* adds SOCK_CLOEXEC to the type that it passes to the operating 
system when creating a socket. You can later toggle this with 
socket.set_inheritable, and check it with socket.get_inheritable.

You might expect that you could also check it with (socket.type | 
SOCK_CLOEXEC), and this does tell you *something*... but it has *no 
relationship at all* to whether the socket has close-on-exec enabled. Instead, 
what it tells you whether you passed SOCK_CLOEXEC to the socket constructor. 
Given that passing SOCK_CLOEXEC to the socket constructor is otherwise 
*completely ignored*, this seems like a weird piece of information to make 
available.

--

___
Python tracker 

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



[issue32331] Add socket.truetype property

2017-12-15 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

I did a little digging. It's more complicated than just "on Linux, these show 
up in the socket type".

Background: SOCK_NONBLOCK and SOCK_CLOEXEC are Linux-isms. The standard way to 
control blocking-ness and cloexec-ness is via ioctl/fcntl, and Linux supports 
that too. But as an extension, it also has these flags that can be passed as 
part of the socket type, which is nice because it lets you set the flag 
atomically at the time the socket is created, which is very important for 
CLOEXEC, and ... kinda pointless for NONBLOCK, but whatever, Linux supports it.

Note that as far as Linux is concerned, this is just a sneaky way to smuggle an 
extra argument through the socket() call. The flags *do not become part of the 
socket type*. If you create a socket with type=SOCK_STREAM | SOCK_NONBLOCK, and 
then do getsockopt(SOL_SOCKET, SOCK_TYPE) on it, Linux reports that the 
socket's type is just SOCK_STREAM, *without* mentioning SOCK_NONBLOCK.

One more important piece of background: Python's socket.type attribute doesn't 
really have any connection to the OS-level socket type. (This is part of what 
bpo-28134 is about.) Python just takes whatever value the user passed as the 
type= argument when calling socket(), and stashes it in an instance variable so 
it can be retrieved later.

Okay, so what's going on with socket.type? Python gained support for 
SOCK_NONBLOCK and SOCK_CLOEXEC in commit 
b1c54967381062bccef7db574b8e84f48a0eca76 (bpo-7523), which mainly just exposed 
the constants, so that users could manually pass these in as part of the type= 
argument when creating the socket. However, it also made another change: it 
made it so that that whenever Python toggles the blocking state of the socket, 
it also toggles the SOCK_NONBLOCK bit in the Python-level variable that 
represents socket.type.

Logically, this doesn't make any sense. As noted above, SOCK_NONBLOCK is never 
considered part of the socket type, on any operating system. And the function 
that is doing this doesn't even have anything to do with SOCK_NONBLOCK; it's 
actually using ioctl/fcntl, which is a totally unrelated mechanism for toggling 
blocking-ness. And it only does this on Linux (because only Linux *has* a 
SOCK_NONBLOCK bit to toggle), so this is kind of just introducing gratuitous 
brokenness.

The one advantage of this is that it makes these two pieces of code consistent:

   # Version A
   s = socket.socket(type=socket.SOCK_STREAM | socket.SOCK_NONBLOCK)
   # Blindly returns what we passed to type=, even though it's
   # not the actual type:
   s.type

   # Version B
   s = socket.socket()
   s.setblocking(False)
   s.type

This is a weird choice. Basically version A here is revealing a bug in how 
Python's type tracking works (s.type disagrees with s.getsockopt(SOL_SOCKET, 
SOL_TYPE)), that is only triggered if the user takes advantage of a 
rarely-used, non-portable feature. Then version B was written to intentionally 
introduce the same bug in a much more common case, I guess for consistency. But 
the bug is still non-portable.

The only time SOCK_CLOEXEC shows up in socket.type is if the user explicitly 
passed it in their call to socket.socket(), which has been a no-op (except for 
its effect on socket.type) since PEP 446 made SOCK_CLOEXEC the default.

I think there's a pretty strong argument here that what we really ought to do 
is *never* show SOCK_NONBLOCK or SOCK_CLOEXEC in in socket.type. That's what 
Linux itself does, it's the only possibility on every other OS, and it fixes 
this very annoying issue. (To add to Yury's comments about bugs in asycnio, it 
took me ages to figure out wtf was going on here and work around it in trio. 
The current behavior really does cause bugs.) It also sets the stage for fixing 
bpo-28134 -- right now socket.type's semantics are "whatever you passed in, 
whether that's actually the socket's type or not", and that's something that's 
impossible to determine reliably for a bare fd; I'm suggesting they should 
become "the socket's type", which *is* possible to determine reliably for a 
bare fd, at least in some cases.

--

___
Python tracker 

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



[issue32263] Template string docs refer to "normal %-based substitutions"

2017-12-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

https://github.com/python/cpython/commit/9f74deba784fc8781d13ed564f69c02ed7c331bb

merged by Warsaw (last March).  It removed the whole phrase, "Instead of the 
normal %-based substitutions,"  I think the other changes would be more worth 
backporting, (assuming correct for 3.6, which I believe they are) if anything 
is.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 9454060e84a669dde63824d9e2fcaf295e34f687 by Victor Stinner in 
branch 'master':
bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes (#4899)
https://github.com/python/cpython/commit/9454060e84a669dde63824d9e2fcaf295e34f687


--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 9454060e84a669dde63824d9e2fcaf295e34f687 by Victor Stinner in 
branch 'master':
bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes (#4899)
https://github.com/python/cpython/commit/9454060e84a669dde63824d9e2fcaf295e34f687


--

___
Python tracker 

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



[issue32331] Add socket.truetype property

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

There's also a precedent of us breaking socket API.  In Python < 3.6:

  sock = socket.socket()
  fd = sock.fileno()
  os.close(fd)
  sock.close()

Everything works fine.  In 3.6+:

  sock.close()  # Will raise OSError

uvloop broke on this during the beta period and I fixed the issue quickly.  I 
don't remember seeing any complaints about this, so I suspect that this issue 
wasn't a big deal, people just fixed their code.

--

___
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-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Perhaps this should be closed as a 1/10 duplicate of #17972.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue32331] Add socket.truetype property

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

I've been thinking a lot about this problem, and I'm really tempted to fix 
sock.type property:

1. The problem first appeared in Python 3.2.

2. Python 2.7 doesn't have this problem at all, and doesn't even export 
socket.SOCK_NONBLOCK.  If we fix this in 3.7 it *will* actually help some poor 
souls with porting their network applications.

3. People use Python when they want a high-level portable language.  This 
annoying Linux quirk makes it super hard to write correct socket code.

4. I can't actually come up with any decent Linux-only example of using this 
quirk of socket.type.  Why would one check if sock.type has SOCK_NONBLOCK?  And 
even if they check it, one call to sock.settimeout() will make sock.type 
information outdated and simply wrong.

Let's just fix sock.type?

--

___
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-15 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
type: enhancement -> behavior
versions: +Python 3.7 -Python 3.3

___
Python tracker 

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



[issue32259] Misleading "not iterable" Error Message when generator return a "simple" type, and a tuple is expected

2017-12-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I think generically changing 'iterable' to 'iterable/unpackable' is wrong and 
would engender more confusion than at present.  Most uses of iteration have 
nothing to do with multiple assignment target unpacking.  Some minimal examples 
resulting in "TypeError: 'int' object is not iterable", where this change would 
be wrong, include

iter(1)
sorted(1)
for _ in 1: pass

What might be reasonable is to wrap iter(source) in multiple assignment target 
code with (the C equivalent, if it exists, of) try-except and augment the 
message before re-raising.  The addition could be something explicit like "and 
cannot be the source for multiple target assignment".

---
Camion, Steven gave you excellent advice about playing around with simplified 
code.  If you had split the multiple-operation error raising line,

for term, dgts in terms_generator(expected_precision):

into two simpler lines that each do less,

for value in terms_generator(expected_precision):
term, dgts = value

you would have likely have spent much less time looking in the wrong place.  
Isolating possible exception sources is a very useful debugging tool.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue32331] Add socket.truetype property

2017-12-15 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

I think the earliest open bug about this is bpo-21327.

--
nosy: +njs

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4794

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4793

___
Python tracker 

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



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 572636d42566da8eb6e85d5b8164e9ed8860a255 by Yury Selivanov in 
branch '3.6':
bpo-27456: Ensure TCP_NODELAY is set on linux (#4231) (#4898)
https://github.com/python/cpython/commit/572636d42566da8eb6e85d5b8164e9ed8860a255


--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Writing code compatible with Python older than 3.5 (like Python 2.7) requires 
to use OrderedDict. I expect that very few users will use "dict if 
sys.version_info >= (3, 6) else OrderedDict" to get an ordered dict.

OrderedDict remains useful when you need the methods added by the OrderedDict 
type.

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-12-15 Thread INADA Naoki

INADA Naoki  added the comment:

Since normal dict preserves insertion order, OrderedDict usage
will be decreased.  So I don't think 2x memory consumption is
big issue.

BTW, functools.lru_cache uses custom doubly-linked list which
is much memory inefficient.
Rewriting it to use OrderedDict will reduce memory usage significantly.

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Dividing the memory consumption by two is quite impressive.

Raymond: Would you mind to explain why you close the issue?

--

___
Python tracker 

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



[issue32331] Add socket.truetype property

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

Another name option: socket.realtype

--

___
Python tracker 

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



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +4792

___
Python tracker 

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



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +4791

___
Python tracker 

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



[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset e796b2fe26f220107ac50667de6cc86c82b465e3 by Yury Selivanov in 
branch 'master':
bpo-27456: Ensure TCP_NODELAY is set on linux (#4231)
https://github.com/python/cpython/commit/e796b2fe26f220107ac50667de6cc86c82b465e3


--

___
Python tracker 

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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2017-12-15 Thread Brett Cannon

Brett Cannon  added the comment:


New changeset 4ac5150e068a3a795ef00465f6dff51747b62b91 by Brett Cannon in 
branch 'master':
bpo-32248: Implement importlib.abc.ResourceReader (GH-4892)
https://github.com/python/cpython/commit/4ac5150e068a3a795ef00465f6dff51747b62b91


--

___
Python tracker 

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



[issue32339] Make the dict type used in csv.DictReader configurable

2017-12-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

For csv.DictReader and collections.namedtuple._asdict, it might be cleaner to 
just deprecate the OrderedDict in favor of returning regular dict.  I suspect 
that in these contexts, no one really wants an actual OrderedDict.

--
nosy: +rhettinger

___
Python tracker 

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



[issue28134] socket.socket(fileno=fd) does not work as documented

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

Let's quickly iterate over what's possible first:

* It's possible to check the type of the FD using "getsockopt(SOL_SOCKET, 
SO_TYPE)" on all platforms.

* It's possible to check family/proto of the FD using "getsockopt(SOL_SOCKET, 
SO_DOMAIN/SO_PROTOCOL)" on Linux.

Given the above I propose the following:

1. Passing a wrong type can be considered as a serious error.  SOCK_STREAM is 
fundamentally different from SOCK_DGRAM.  Because we have a way to validate 
socket type on all platforms, I propose to do this validation when we create a 
socket from an FD, and raise an error if the passed socket type isn't correct.

2. When Python is running with '-X dev' (new dev mode added by Victor), I 
propose to also validate socket.family and socket.proto on Linux, and raise a 
RuntimeWarning when they don't match.

--
nosy: +pitrou, vstinner, yselivanov

___
Python tracker 

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



[issue32331] Add socket.truetype property

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

Update:

I've rewritten the PR from scratch.

1. SOCK_TYPE_MASK isn't exported on Linux.  Therefore we will not export 
socket.SOCK_TYPE_MASK too.

2. I've added the new socket.truetype property.

3. When a socket is created without an FD, e.g. "socket.socket(family, type, 
proto)", we trust that the type of the socket is correct.  It might contain 
extra flags on Linux, so we filter them out.

4. When a socket is created from an FD, e.g. with "socket.fromfd" or with 
"socket.socket(family, type, proto, FD)" we don't trust the type.  So 
socket.truetype will call getsockopt(SOL_SOCKET, SO_TYPE) on the FD to ensure 
we have the correct socket type at hand.

5. Since Linux doesn't export SOCK_TYPE_MASK I decided to hardcode it in 
socketmodule.c.  My reasoning:

a/ It's highly unlikely that Linux will implement 5 more new socket types 
anytime soon, so 0xF should last for a *very* long time.

b/ It's more likely than "a/" that they add a new flag like SOCK_CLOEXEC, in 
which case the "type & ~(SOCK_NONBLOCK | SOCK_CLOEXEC)" approach will fail.

So given a/ and b/ I think it's safe to just use 0xF mask on Linux.

--

___
Python tracker 

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



[issue32331] Add socket.truetype property

2017-12-15 Thread Yury Selivanov

Change by Yury Selivanov :


--
title: apply SOCK_TYPE_MASK to socket.type on Linux -> Add socket.truetype 
property

___
Python tracker 

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



[issue32324] [Security] "python3 directory" inserts "directory" at sys.path[0] even in isolated mode

2017-12-15 Thread Brett Cannon

Brett Cannon  added the comment:

I vote that it has to work and it should be prepended.

--

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset d2b02310acbfe6c978a8ad3cd3ac8b3f12927442 by Victor Stinner in 
branch 'master':
bpo-29240: Don't define decode_locale() on macOS (#4895)
https://github.com/python/cpython/commit/d2b02310acbfe6c978a8ad3cd3ac8b3f12927442


--

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-12-15 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue32342] safe_power(): CID 1426161: Integer handling issues (DIVIDE_BY_ZERO)

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

PyLong_AsSize_t(w) cannot be zero thanks to Py_SIZE(w) > 0. I classified the 
issue as a false positive. Sorry for the noise.

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

___
Python tracker 

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



[issue32342] safe_power(): CID 1426161: Integer handling issues (DIVIDE_BY_ZERO)

2017-12-15 Thread STINNER Victor

New submission from STINNER Victor :

Coverity found an issue in the commit 2e3f5701858d1fc04caedefdd9a8ea43810270d2 
(bpo-30416).

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)

** CID 1426161:  Integer handling issues  (DIVIDE_BY_ZERO)
/Python/ast_opt.c: 219 in safe_power()


*** CID 1426161:  Integer handling issues  (DIVIDE_BY_ZERO)
/Python/ast_opt.c: 219 in safe_power()
213 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w) 
> 0) {
214 size_t vbits = _PyLong_NumBits(v);
215 size_t wbits = PyLong_AsSize_t(w);
216 if (vbits == (size_t)-1 || wbits == (size_t)-1) {
217 return NULL;
218 }
>>> CID 1426161:  Integer handling issues  (DIVIDE_BY_ZERO)
>>> In expression "128UL / wbits", division by expression "wbits" which may 
>>> be zero has undefined behavior.
219 if (vbits > MAX_INT_SIZE / wbits) {
220 return NULL;
221 }
222 }
223
224 return PyNumber_Power(v, w, Py_None);

--
components: Interpreter Core
messages: 308428
nosy: serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: safe_power(): CID 1426161:  Integer handling issues  (DIVIDE_BY_ZERO)
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



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

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
title: Dict order is now guaranteed, so add tests for it -> Dict order is now 
guaranteed, so add tests and doc for it

___
Python tracker 

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



[issue32340] ValueError: time data 'N/A' does not match format '%Y%m%d'

2017-12-15 Thread R. David Murray

R. David Murray  added the comment:

This is not a bug in python.  If it is your code contact the pyhon-list mailing 
for help.  If you got whatsapp_xtract from somewhere else, contact that 
community with your questions.

--
nosy: +r.david.murray
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32341] itertools "generators"?

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue32341] itertools "generators"?

2017-12-15 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4790

___
Python tracker 

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



[issue21074] Too aggressive constant folding

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4789

___
Python tracker 

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



[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4788

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4787

___
Python tracker 

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



[issue32341] itertools "generators"?

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue32341] itertools "generators"?

2017-12-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The term is used in the generic sense rather than the sense of an actual type.  
That said, I don't mind changing "Combinatoric generators" to "Combinatoric 
iterators" for 3.6 and 3.7.   Otherwise, this isn't worth the backport effort.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger
priority: normal -> low
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



[issue32341] itertools "generators"?

2017-12-15 Thread Stefan Pochmann

New submission from Stefan Pochmann :

The itertools page https://docs.python.org/3.6/library/itertools.html says 
"Combinatoric generators:" above the table with product(), permutations(), etc. 
But as far as I understand, they're not generators and they don't produce 
generator iterators. I think the table title should be "Combinatoric 
iterators:" instead, in line with "Infinite Iterators:" and "Iterators 
terminating on the shortest input sequence:" of the two tables above it.

Reference:
https://docs.python.org/3/glossary.html#term-generator

--
assignee: docs@python
components: Documentation
messages: 308425
nosy: Stefan Pochmann, docs@python
priority: normal
severity: normal
status: open
title: itertools "generators"?
versions: Python 2.7, 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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 Thread Nikolaus Rath

Nikolaus Rath  added the comment:

Given the apparent difficulties getting this right, how about not attempting to 
implicitly flush buffers in the finalizer at all? This means scripts relying on 
this will break, but in contrast to the current behavior they will break 
consistently so it's easy to find and fix the problem.

--

___
Python tracker 

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



[issue32340] ValueError: time data 'N/A' does not match format '%Y%m%d'

2017-12-15 Thread ikram

New submission from ikram :

Traceback (most recent call last):
  File "H:\Whatsapp_Xtract_V2.2_2012-11-17\whatsapp_xtract.py", line 2453, in 

main(sys.argv[1:])
  File "H:\Whatsapp_Xtract_V2.2_2012-11-17\whatsapp_xtract.py", line 1921, in 
main
linkimage = findfile ("IMG", y.media_size, y.local_url, date, 2)
  File "H:\Whatsapp_Xtract_V2.2_2012-11-17\whatsapp_xtract.py", line 1266, in 
findfile
timestamptoday = int(str(time.mktime(datetime.datetime.strptime(date, 
"%Y%m%d").timetuple()))[:-2])
  File "C:\Python27\lib\_strptime.py", line 332, in _strptime
(data_string, format))
ValueError: time data 'N/A' does not match format '%Y%m%d'
Press any key to continue . . .

--
components: Windows
messages: 308423
nosy: marki94, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: ValueError: time data 'N/A' does not match format '%Y%m%d'
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



[issue31971] idle_test: failures on x86 Windows7 3.x

2017-12-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I want to add the try-except here and in the few other places where a method is 
temporarily masked.  One failure causing another strikes me a  test code bug.  
I would like to hold off on adding 'hover', as it now seems to have been an 
idiosyncratic and temporary glitch on one buildbot.  I cannot see anything 
different about this particular button state check.  If 'hover' were needed 
here, so it would seem equally needed in several other places.

--

___
Python tracker 

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



[issue32330] Email parser creates a message object that can't be flattened

2017-12-15 Thread Mark Sapiro

Mark Sapiro  added the comment:

> I do wonder where you are using the string version of messages :)

Probably some places where we could use bytes, but one of the problem areas is 
where we save the content of a message held for moderation.

--

___
Python tracker 

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



[issue32339] Make the dict type used in csv.DictReader configurable

2017-12-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Since 3.6 csv.DictReader emits OrderedDicts instead of regular dicts. Since 
regular dicts are ordered in 3.7, this is an overkill. It would be nice to add 
a configuration option for a return type.

This is an easy issue.

--
components: Library (Lib)
keywords: easy
messages: 308420
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Make the dict type used in csv.DictReader configurable
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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2017-12-15 Thread Brett Cannon

Change by Brett Cannon :


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

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

Using reversed chronological order would work in 99% of the cases probably but 
then you would have that rare case where it didn't work.  So, I'm not too keen 
on that approach.

I think this is a classic problem with finalization and GC, probably should do 
some actual reading of literature.  One idea that occurs to me is that the 
underlying file object could keep a weakref to the higher level (e.g. buffer) 
objects.  Then, if the underlying file gets closes, it could make sure to call 
flush on the higher level objects first.  The weakref would ensure that a ref 
cycle is not created.

--

___
Python tracker 

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



[issue32338] Save OrderedDict import in re

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32338] Save OrderedDict import in re

2017-12-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Since regular dicts are now ordered by default, the OrderedDict import is no 
longer necessary.

--
components: Library (Lib), Regular Expressions
messages: 308418
nosy: ezio.melotti, mrabarnett, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Save OrderedDict import in re
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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I'm not well known with GC, but if it be possible to call destructors in the 
reversed chronological order, this could help with this issue.

--

___
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 for it

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
assignee: rhettinger
components: Tests
nosy: rhettinger
priority: normal
severity: normal
stage: needs patch
status: open
title: Dict order is now guaranteed, so add tests for it
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



[issue32336] Save OrderedDict import in argparse

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue32336] Save OrderedDict import in argparse

2017-12-15 Thread Raymond Hettinger

New submission from Raymond Hettinger :

Since regular dicts are now ordered by default, the OrderedDict import is no 
longer necessary.  Removing it will give a small boost to start-up time.

--
assignee: bethard
components: Library (Lib)
messages: 308416
nosy: bethard, rhettinger
priority: normal
severity: normal
status: open
title: Save OrderedDict import in argparse
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



[issue32335] Failed Python build on Fedora 27

2017-12-15 Thread Amit Ghadge

Amit Ghadge  added the comment:

My current git log is,
Author: Victor Stinner 
Date:   Fri Dec 15 16:29:24 2017 +0100

bpo-32294: Fix multiprocessing test_semaphore_tracker() (#4885)

--

___
Python tracker 

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



[issue32335] Failed Python build on Fedora 27

2017-12-15 Thread Amit Ghadge

Amit Ghadge  added the comment:

After the some investigation,
1f06a680de465be0c24a78ea3b610053955daa99 PR was OK,
a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 build failed but ./python run
88c60c9668f0aa732693517a60b851cc1dfce0cb build failed and same error comes 
after click ./python

--

___
Python tracker 

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



[issue32335] Failed Python build on Fedora 27

2017-12-15 Thread Amit Ghadge

New submission from Amit Ghadge :

Hi, I'm try to build Python from source on Fedora 27 but it shows below message 
and build was failed,
gcc -pthread   -Xlinker -export-dynamic -o python Programs/python.o 
libpython3.7dm.a -lpthread -ldl  -lutil   -lm  
gcc -pthread   -Xlinker -export-dynamic -o Programs/_testembed 
Programs/_testembed.o libpython3.7dm.a -lpthread -ldl  -lutil   -lm  
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Traceback (most recent call last):
  File "", line 1141, in _install
  File "", line 1133, in _setup
  File "", line 1100, in _builtin_from_name
ImportError: no built-in module named _thread
Fatal Python error: initimport: importlib install failed

Current thread 0x7fefeacef600 (most recent call first):
/bin/sh: line 5: 12806 Aborted (core dumped) ./python -E -S -m 
sysconfig --generate-posix-vars
generate-posix-vars failed
make: *** [Makefile:590: pybuilddir.txt] Error 1

--
messages: 308413
nosy: amitg-b14
priority: normal
severity: normal
status: open
title: Failed Python build on Fedora 27
type: compile error
versions: Python 3.7

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

In the process of trying to write a test for this, I now realize that PR 4847 
is not really a fix.  If the underlying file gets closed during an earlier 
gc.collect() and not during shutdown, the extra flushing step is not going to 
help.  So, using atexit is not really a fix.  Maybe there is something else we 
can do, need to think about it more.

--

___
Python tracker 

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



[issue32320] Add default value support to collections.namedtuple()

2017-12-15 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue32331] apply SOCK_TYPE_MASK to socket.type on Linux

2017-12-15 Thread Christian Heimes

Christian Heimes  added the comment:

Should socket.true_type use getsockopt(fd, ...) to get the actual type?

While we are talking about socket types, please have a look at #28134 .

--

___
Python tracker 

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



[issue32331] apply SOCK_TYPE_MASK to socket.type on Linux

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

On GH (https://github.com/python/cpython/pull/4877), Antoine wrote:

> I agree with Victor:

> it can't go into 3.6
> making the change in 3.7 is contentious
> Can there be an other way to solve the issue? Can we for example keep 
> socket.type as it is and add a utility function or a property reporting the 
> "masked" type?

I agree.   Here's what I propose:

1. We don't touch `socket.type`.  We don't know what kind of code exists out 
there and in what ways it will break.  The ship has sailed to fix it.

2. We add `socket.SOCK_TYPE_MASK` (on Linux).

3. We fix `socket.__repr__` to correctly render type.  Currently:

>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM | 
socket.SOCK_NONBLOCK)
>>> s


What I want to see:



4. We add `socket.true_type` which will apply `SOCK_TYPE_MASK` and return a 
socket type that's safe to compare to `socket.SOCK_*` constants.

Thoughts?

--

___
Python tracker 

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



[issue32331] apply SOCK_TYPE_MASK to socket.type on Linux

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

> You can easily work around your problem by replacing "sock.type == 
> SOCK_STREAM" with "sock.type & SOCK_STREAM == SOCK_STREAM".

Heh :) No, that would be a buggy code.  Try this on your Linux box:

(socket.SOCK_SEQPACKET & socket.SOCK_STREAM) == socket.SOCK_STREAM

The _only_ way of checking socket type reliably is to explicitly reset 
SOCK_NONBLOCK and SOCK_CLOEXEC or to apply 0xF mask on Linux, and don't do that 
on other platforms.

That's why I think it's important to fix this one way or another.

--

___
Python tracker 

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



[issue32294] test_semaphore_tracker() of test_multiprocessing_spawn fails with -W error

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue32333] test_smtplib: dangling threads on x86 Gentoo Non-Debug with X 3.x

2017-12-15 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

> if I'm reading the manpage correctly: `readlink` tells the filename that the 
> symlink points to.  lchmod is concerned with setting the `stat` on the link 
> itself (which only some platforms actually support)

Oops, my bad. Ignore my comment :-)

--

___
Python tracker 

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



[issue32329] PYTHONHASHSEED=0 python3 -R should enable hash randomization

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


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



[issue32290] bolen-dmg-3.6: compilation failed with OSError: [Errno 23] Too many open files in system

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Another different failure on "bolen-dmg-3.x". I don't understand the 
"RuntimeError: command failed: make" error :-(

http://buildbot.python.org/all/#/builders/69/builds/69

(...)
gcc-4.0 -c -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes -arch ppc -arch i386 -isysroot 
/Developer/SDKs/MacOSX10.4u.sdk -g 
-I/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/dmg/libraries/usr/local/include 
  -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers  
-IObjects -IInclude -IPython -I. 
-I/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Include -isysroot 
/Developer/SDKs/MacOSX10.4u.sdk-DPy_BUILD_CORE -o Python/frozen.o 
/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Python/frozen.c
rm -f libpython3.7m.a
ar rcs libpython3.7m.a Modules/getbuildinfo.o Parser/acceler.o 
Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o 
Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o 
Parser/pgen.o Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o 
Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o 
Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o 
Objects/cellobject.o Objects/classobject.o Objects/codeobject.o 
Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o 
Objects/exceptions.o Objects/genobject.o Objects/fileobject.o 
Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o 
Objects/iterobject.o Objects/listobject.o Objects/longobject.o 
Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o 
Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o 
Objects/object.o Objects/obmalloc.o Objects/capsule.o Objects/rangeobject.o 
Objects/setobject.o Objects/sliceobject.o Object
 s/structseq.o Objects/tupleobject.o Objects/typeobject.o 
Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o 
Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o 
Python/ast_opt.o Python/bltinmodule.o Python/ceval.o Python/compile.o 
Python/codecs.o Python/dynamic_annotations.o Python/errors.o 
Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o 
Python/getcopyright.o Python/getplatform.o Python/getversion.o 
Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o 
Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o 
Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o 
Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o 
Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o 
Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o 
Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o 
Python/pystrhex.o Python/dtoa.o Python/format
 ter_unicode.o Python/fileutils.o Python/dynload_shlib.oModules/config.o 
Modules/getpath.o Modules/main.o Modules/gcmodule.o Modules/posixmodule.o  
Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  
Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  
Modules/_operator.o  Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  
Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  
Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  
Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o 
Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/zipimport.o  
Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  
Modules/symtablemodule.o  Modules/xxsubtype.o Python/frozen.o
/usr/bin/install -c -d -m 755 Python.framework/Versions/3.7
gcc-4.0 -o Python.framework/Versions/3.7/Python -arch ppc -arch i386 -isysroot 
/Developer/SDKs/MacOSX10.4u.sdk -g 
-L/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/dmg/libraries/usr/local/lib  
-dynamiclib \
-all_load libpython3.7m.a -Wl,-single_module \
-install_name /Library/Frameworks/Python.framework/Versions/3.7/Python \
-compatibility_version 3.7 \
-current_version 3.7 \
-framework CoreFoundation -ldl  -framework CoreFoundation;
Traceback (most recent call last):
  File 
"/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py",
 line 1659, in 
main()
  File 
"/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py",
 line 1612, in main
buildPython()
  File 
"/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py",
 line 1162, in buildPython
runCommand(make_cmd)
  File 
"/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py",
 line 532, in runCommand
raise RuntimeError("command failed: %s"%(commandline,))
RuntimeError: command failed: make
program finished with exit code 1
elapsedTime=1601.300462

--

___
Python tracker 


[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-12-15 Thread Anthony Sottile

Anthony Sottile  added the comment:

if I'm reading the manpage correctly: `readlink` tells the filename that the 
symlink points to.  lchmod is concerned with setting the `stat` on the link 
itself (which only some platforms actually support)

--

___
Python tracker 

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



[issue32294] test_semaphore_tracker() of test_multiprocessing_spawn fails with -W error

2017-12-15 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4782

___
Python tracker 

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



[issue32294] test_semaphore_tracker() of test_multiprocessing_spawn fails with -W error

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 9402c8367bf6ada1b84f620ad957750c33adbaf9 by Victor Stinner in 
branch 'master':
bpo-32294: Fix multiprocessing test_semaphore_tracker() (#4885)
https://github.com/python/cpython/commit/9402c8367bf6ada1b84f620ad957750c33adbaf9


--

___
Python tracker 

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



[issue32329] PYTHONHASHSEED=0 python3 -R should enable hash randomization

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 642d67b4f25262889b43f91ad2a96ca0e37fd5a2 by Victor Stinner in 
branch 'master':
bpo-32329: Add versionchanged to -R option doc (#4884)
https://github.com/python/cpython/commit/642d67b4f25262889b43f91ad2a96ca0e37fd5a2


--

___
Python tracker 

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



[issue31964] [3.4][3.5] pyexpat: compilaton of libexpat fails with: ISO C90 forbids mixed declarations and code

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

The bug has been fixed by commit 8b11e8de7aedacfbbcc8c780f3c4097396f1d1a3 in 
Python 3.4

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

___
Python tracker 

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



[issue31967] [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe'

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

The AMD64 Windows10 3.x buildbot: is green again, I close the issue.

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

___
Python tracker 

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



[issue31971] idle_test: failures on x86 Windows7 3.x

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Terry: you proposed a fix, do you still want to write it? The buildbot didn't 
fail again since I reported the failure.

--

___
Python tracker 

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



[issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer"

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

I really have no clue on the root bug, and the bug only occurred once, so I 
choose to close it.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32124] Document functions safe to be called before Py_Initialize()

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


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



[issue32294] test_semaphore_tracker() of test_multiprocessing_spawn fails with -W error

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32329] PYTHONHASHSEED=0 python3 -R should enable hash randomization

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4780

___
Python tracker 

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



[issue32332] Implement slots support for magic methods added in PEP 560

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

Serhiy, I've tested METH_STATIC approach and it works just fine.  Thanks for 
pointing that out!

I agree that adding slots for something that's already possible is an overkill, 
so let's close this issue.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue32334] test_configparser left @test_2876_tmp temporary file on x86 Windows7 3.x

2017-12-15 Thread STINNER Victor

New submission from STINNER Victor :

http://buildbot.python.org/all/#/builders/58/builds/332

running: test_multiprocessing_spawn (901 sec), test_concurrent_futures (151 sec)
0:47:16 [250/413/1] test_multiprocessing_spawn crashed (Exit code 1) -- 
running: test_concurrent_futures (154 sec)
Timeout (0:15:00)!
Thread 0x0238 (most recent call first):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\popen_spawn_win32.py",
 line 80 in wait
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py",
 line 140 in join
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py",
 line 2128 in join_thread
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 83 in join_process
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 740 in test_sys_exit
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", 
line 615 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", 
line 663 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 122 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 84 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 122 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 84 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 122 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 84 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\runner.py",
 line 176 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py",
 line 1861 in _run_suite
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py",
 line 1951 in run_unittest
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py",
 line 175 in test_runner
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py",
 line 176 in runtest_inner
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py",
 line 130 in runtest
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest_mp.py",
 line 67 in run_tests_slave
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 517 in _main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 510 in main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 585 in main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\regrtest.py", 
line 46 in _main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\regrtest.py", 
line 50 in 
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", 
line 85 in _run_code
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", 
line 193 in _run_module_as_main
0:47:21 [251/413/1] test_timeit passed -- running: test_concurrent_futures (159 
sec)
(...)
0:54:34 [295/413/1] test_tempfile passed -- running: test_mmap (238 sec)
minkernel\crts\ucrt\src\appcrt\lowio\write.cpp(49) : Assertion failed: 
(_osfile(fh) & FOPEN)
0:54:39 [296/413/2] test_configparser failed (env changed) -- running: 
test_mmap (243 sec)
D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py:1000:
 RuntimeWarning: tests may fail, unable to create temporary directory 
'D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\build\\test_python_2876':
 [WinError 183] Cannot create a file when that file already exists: 
'D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\build\\test_python_2876'
  with temp_dir(path=name, quiet=quiet) as temp_path:
test_converters_at_init 
(test.test_configparser.BlatantOverrideConvertersTestCase) ... ok
(...)
test_write (test.test_configparser.StrictTestCase) ... ok

--
Ran 341 tests in 3.745s

OK (skipped=5)
Warning -- files was modified by test_configparser
  Before: ['@test_2876_tmp']
  After:  []

--
components: Tests
messages: 308398
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_configparser left @test_2876_tmp temporary file on x86 Windows7 3.x
versions: Python 3.7

___
Python tracker 

___

[issue32332] Implement slots support for magic methods added in PEP 560

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 4883 shows how magic methods for PEP 560 can be implemented without 
introducing new slots.

--

___
Python tracker 

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



[issue32333] test_smtplib: dangling threads on x86 Gentoo Non-Debug with X 3.x

2017-12-15 Thread STINNER Victor

New submission from STINNER Victor :

http://buildbot.python.org/all/#/builders/99/builds/363

0:00:16 load avg: 2.60 [ 12/412/1] test_smtplib failed (env changed)
testFailingHELO (test.test_smtplib.BadHELOServerTests) ... ok
(...)
testLineTooLong (test.test_smtplib.TooLongLineTests) ... ok

--
Ran 54 tests in 1.828s

OK (skipped=1)
Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 
3)
Dangling thread: <_MainThread(MainThread, started 3075602176)>
Dangling thread: 
Dangling thread: 

--
components: Tests
messages: 308396
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_smtplib: dangling threads on x86 Gentoo Non-Debug with X 3.x
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



[issue32330] Email parser creates a message object that can't be flattened

2017-12-15 Thread R. David Murray

R. David Murray  added the comment:

I do wonder where you are using the string version of messages :)

I actually thought I'd already done this (errors=replace), but obviously not.  
I don't have time now to work on a patch for this, and the patch in the other 
issue hasn't be updated to reflect the review I did :(

--

___
Python tracker 

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



[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Dummy question. If lchmod() is not supported by the libc, would it be possible 
to reimplement it using readlink()?

--

___
Python tracker 

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



[issue28393] Update encoding lookup docs wrt #27938

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Thank you Ville Skyttä for your contribution! I merged your PR and backported 
it to Python 3.6.

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



[issue28393] Update encoding lookup docs wrt #27938

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 77bf6da7258b4a312e224860ea50ac010aa17c1e by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-28393: Update encoding lookup docs wrt bpo-27938 (GH-4871) (#4881)
https://github.com/python/cpython/commit/77bf6da7258b4a312e224860ea50ac010aa17c1e


--

___
Python tracker 

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



[issue27938] PyUnicode_AsEncodedString, PyUnicode_Decode: add fast-path for "us-ascii" encoding

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 77bf6da7258b4a312e224860ea50ac010aa17c1e by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-28393: Update encoding lookup docs wrt bpo-27938 (GH-4871) (#4881)
https://github.com/python/cpython/commit/77bf6da7258b4a312e224860ea50ac010aa17c1e


--

___
Python tracker 

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



[issue32324] [Security] "python3 directory" inserts "directory" at sys.path[0] even in isolated mode

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

> Since the directory is where the code that is being executed exists don't you 
> have to implicitly trust that directory is secure? Otherwise how can you even 
> trust the code you're choosing to execute?

The question is if the following example must work with -I:

---
vstinner@apu$ mkdir directory
vstinner@apu$ echo "import submodule" > directory/__main__.py
vstinner@apu$ echo 'print("submodule", __file__)' > directory/submodule.py

vstinner@apu$ python3 directory
submodule directory/submodule.py

vstinner@apu$ python3 -I directory
submodule directory/submodule.py
---

Do you expect that "python3 directory" allows imports from directory/?

The second question is if directory must be prepended to sys.path (start), or 
if it must be appended to sys.path (end)?

Prepend allows to override stdlib imports, whereas append risks of conflicts 
with others paths in sys.path and so loading the "wrong" submodule.

For example, I still expect to run __main__ from directory in the following 
example:

---
vstinner@apu$ mkdir other
vstinner@apu$ echo "print('other main')" > other/__main__.py
vstinner@apu$ PYTHONPATH=other python3 directory
submodule directory/submodule.py
---

--

___
Python tracker 

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



[issue32265] Correctly classify builtin static and class methods

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 3327a2ddf1eaf8cc678f0219ba9edf7d632d1b20 by Serhiy Storchaka in 
branch 'master':
bpo-32265: Classify class and static methods of builtin types. (#4776)
https://github.com/python/cpython/commit/3327a2ddf1eaf8cc678f0219ba9edf7d632d1b20


--

___
Python tracker 

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



  1   2   >