[issue24329] __qualname__ and __slots__

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about other names set when creating a class? __module__, __class__, 
__classcell__?

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Xiang Zhang

Xiang Zhang added the comment:

I think of them but currently they don't pose a problem for practical codes 
like __qualname__. Maybe leaving them until there comes a real need?

--

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Guido, Yury, it looks like I solved the puzzle. All the remaining problems are 
because of forward references. In particular, _ForwardRef keeps a reference to 
the frame where it was defined:

typing_globals = globals()
frame = sys._getframe(1)
while frame is not None and frame.f_globals is typing_globals:
frame = frame.f_back
assert frame is not None
self.__forward_frame__ = frame

This is old code from 2015 introduced to support __isinstance__ for forward 
refs. The latter is no more supported anyway, so that I believe this code 
should be removed.

I will make a PR upstream soon.

--

___
Python tracker 

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



[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

2016-11-10 Thread Kuno Meyer

New submission from Kuno Meyer:

[Python 3.5.2 on Windows]

>py -c "import sys; print(sys.stdout.isatty(), file=sys.stderr)" > NUL
True

NUL is the Windows equivalent of /dev/nul, so the result should probably be 
False.

Under Cygwin, the result is as expected:

$ python3 -c "import sys; print(sys.stdout.isatty(), file=sys.stderr)" > 
/dev/nul
False

--
components: Windows
messages: 280494
nosy: kmeyer, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: sys.stdout.isatty() returns True even if redirected to NUL
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



[issue28016] test_fileio fails on AIX

2016-11-10 Thread Matthieu S

Matthieu S added the comment:

Sorry for the late reply.

I did some additional testing, and I can confirm that this assertion should 
also be skipped in Python 2.7 on AIX.

And the test does not fail when run without a tty, so we can assume that this 
is what happens on the builbots.

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Xiang Zhang

Changes by Xiang Zhang :


Added file: http://bugs.python.org/file45421/slots_qualname_v2.patch

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

> BTW, if I set maxsize=10 for typing lru_cache, test_generic_forward_ref 
> crashes in refleak-test mode. Maybe this is another bug...

This one is also related to the mentioned in my previous message. Namely, 
forward references are only evaluated once. However, in refleak hunting mode 
tests are repeated multiple times, and every time test_generic_forward_ref is 
called, this code:

class CC: ...

creates a new local class, while forward ref is still pointing to an old one.

There are two options:
* keep this behaviour and update the test to use a globally defined class;
* change this and re-evaluate forward refs every times.

However I would vote for a compromise solution: if the ``locals`` argument is 
not given, just use the evaluated value. But if a user gives non-None 
``locals`` argument then that user most probably wants to re-evaluate the 
forward ref locally.

--

___
Python tracker 

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



[issue28655] Tests altered the execution environment in isolated mode

2016-11-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Following tests altered the execution environment in isolated mode:

test_asyncio
test_ctypes
test_email
test_idle
test_import
test_importlib
test_json
test_lib2to3

$ ./python -I -S -m test.regrtest -vv test_asyncio test_ctypes test_email 
test_idle test_import test_importlib test_json test_lib2to3 >/dev/null
Warning -- sys.path was modified by test_asyncio
  Before: (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/usr/local/lib/python36.zip', '/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'])
  After:  (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/home/serhiy/py/cpython3.6-debug/Lib', '/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug']) 
Warning -- sys.path was modified by test_ctypes
  Before: (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/usr/local/lib/python36.zip', '/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'])
  After:  (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/home/serhiy/py/cpython3.6-debug/Lib', '/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug']) 
Warning -- sys.path was modified by test_email
  Before: (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/usr/local/lib/python36.zip', '/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'])
  After:  (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/home/serhiy/py/cpython3.6-debug/Lib', '/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug']) 
Warning -- sys.path was modified by test_idle
  Before: (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/usr/local/lib/python36.zip', '/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'])
  After:  (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/home/serhiy/py/cpython3.6-debug/Lib', '/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug']) 
Warning -- files was modified by test_import
  Before: []
  After:  ['@test_30748_tmp.pyc'] 
Warning -- sys.path was modified by test_importlib
  Before: (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/usr/local/lib/python36.zip', '/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'])
  After:  (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug'], 
['/home/serhiy/py/cpython3.6-debug/Lib', '/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/Lib/', 
'/home/serhiy/py/cpython3.6-debug/build/lib.linux-i686-3.6-pydebug']) 
Warning -- sys.path was modified by test_json
  Before: (3071075980, ['/usr/local/lib/python36.zip', 
'/home/serhiy/py/cpython3.6-deb

[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

2016-11-10 Thread Eryk Sun

Eryk Sun added the comment:

Windows doesn't have terminal devices, so the C runtime's isatty() function 
just checks for a character device, which includes NUL among others. 

This can lead to hanging the REPL, albeit with a contrived example such as 
redirecting stdin to COM3:

C:\>python < COM3
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) 
[MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^C

Ctrl+C doesn't work because the main thread is blocked (we'd have to call 
CancelSynchronousIo in the C signal handler). I killed the process using the 
default Ctrl+Break handler. "^C" was printed by the cmd shell's Ctrl+Break 
handler.

I don't think the CRT's check for a character device is generally useful. It 
could be replaced with a check that specifically looks for a console handle 
(e.g. by calling GetConsoleMode), which is what someone calling isatty() 
generally wants to know.

--
components: +IO
nosy: +eryksun
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



[issue28656] build error in cygwin64 ,because pthread_key_t

2016-11-10 Thread muzhong

New submission from muzhong:

ENV: 
CYGWIN_NT-6.1 2.6.0(0.304/5/3) 2016-08-31 14:32 x86_64 Cygwin
gcc (GCC) 5.4.0
g++ (GCC) 5.4.0
Error Msg:
Fatal Python error: Could not allocate TLS entry
Cause:
/usr/include/machine/types.h:typedef struct __pthread_key_t {char __dummy;} 
*pthread_key_t;
but convert pthread_key_t to int or compare with int in 
thread_pthread.h/thread.c/pythread.h/pystate.c/pylifecycle.c

--
components: Cross-Build
messages: 280499
nosy: Alex.Willmer, muzhong
priority: normal
severity: normal
status: open
title: build error in cygwin64 ,because pthread_key_t
type: compile error
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



[issue19398] test_trace fails with -S

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The separator is needed if the relative path is not empty and the prefix 
doesn't end with the separator.

This patch seems also fixes most problems of issue28655.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.4
Added file: 
http://bugs.python.org/file45422/remove_extra_slash_from_sys_path_v3.patch

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

OK, here are the PRs:

https://github.com/python/typing/pull/327
https://github.com/python/typing/pull/328

Those two seem to fix everything, I tried various cache sizes with both C and 
Python versions of lru_cache and found no refleaks.

--

___
Python tracker 

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



[issue28657] cmd.Cmd.get_help() implementation can't see do_*() methods added dynamically by setattr()

2016-11-10 Thread Błażej Michalik

New submission from Błażej Michalik:

The issue here seems to originate from the implementation of Cmd.get_names():

def get_names(self):   
# This method used to pull in base class attributes
# at a time dir() didn't do it yet.
return dir(self.__class__) 

Changing it to dir(self) would make dynamical adding helpstrings for commands 
possible.

--
components: Library (Lib)
messages: 280502
nosy: Błażej Michalik
priority: normal
severity: normal
status: open
title: cmd.Cmd.get_help() implementation can't see do_*() methods added 
dynamically by setattr()
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, 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



[issue28656] build error in cygwin64 ,because pthread_key_t

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue25658.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

2016-11-10 Thread Kuno Meyer

Kuno Meyer added the comment:

http://stackoverflow.com/questions/3648711/detect-nul-file-descriptor-isatty-is-bogus,
 although a bit convoluted, might also help. It mentions GetConsoleMode() for 
stdin and GetConsoleScreenBufferInfo() for stdout.

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Xiang Zhang

Xiang Zhang added the comment:

> What about other names set when creating a class? __module__, __class__, 
> __classcell__?

__module__ remains in the class dict so I think it's a class variable.
Will __class__ be set? It's inserted into the function scope.
__classcell__ I think has the same situation with __qualname__.

New patch also adds __classcell__.

--
Added file: http://bugs.python.org/file45423/slots_special.patch

___
Python tracker 

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



[issue28644] Document recen changes in typing.py

2016-11-10 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Guido, here is a new patch with your comments implemented.

--
Added file: http://bugs.python.org/file45424/recent-typing-docs-v4.diff

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Xiang Zhang

Xiang Zhang added the comment:

slots_special_v2 fixes a bug in the previous patch.

--
Added file: http://bugs.python.org/file45425/slots_special_v2.patch

___
Python tracker 

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



[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

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

Марк Коренберг added the comment:

1. I think, that is not a bug.
2. It seems, that for Cygwin, `> /dev/nul` is a bug, it should be `/dev/null` 
does not it ?

--
nosy: +mmarkk

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue28658] MacOsX idle don't run

2016-11-10 Thread Andrew Kontokanis

New submission from Andrew Kontokanis:

When I try and launch IDLE, the icon appears on the dock for a second and then 
disappears and the application doesn't run.
I was trying to install new themes but when I managed to do find .idlerc folder 
I had messed up with some idle folder. I tried to uninstall and install but it 
didn't work.
Trying to find solution I read some hints to check through terminal and I took 
these messages in attachment. I didn't find the same solution with the previous 
problems so I opened an question

--
files: error.log.pdf
messages: 280509
nosy: Andrew Kontokanis
priority: normal
severity: normal
status: open
title: MacOsX idle don't run
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file45426/error.log.pdf

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

__qualname__ doesn't makes much sense if it doesn't match __module__. If 
_GeneratorWrapper patches __qualname__, I think it should patch __module__ too.

--

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-11-10 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

Hi, I came from #28656.
I have read past discussions, And I've understood the pthread_key_t has 
possible of either integer or pointer.  So I think there is a simple solution 
that replaces key type to intptr_t.
Thus I wrote a patch, but it maybe need configure check for intptr_t if 
CPytyhon still be supporting for before C99 compilers.
I confirmed patch on Cygwin x86. Would you be able to confirm for other 
platforms?

--
nosy: +masamoto
type:  -> compile error
versions: +Python 3.7
Added file: http://bugs.python.org/file45427/pythread-key-intptr_t.patch

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Yury Selivanov

Yury Selivanov added the comment:

Good work, Ivan!

> Those two seem to fix everything, I tried various cache sizes with both C and 
> Python versions of lru_cache and found no refleaks.

Speaking of lru_cache: typing currently doesn't configure maxsize, which means 
that the cache is limited to 128 items.  Is that OK?  Should maxsize be set to 
None to make the cache unlimited, or, maybe, a higher number like 1024 is more 
appropriate?

--

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Guido van Rossum

Guido van Rossum added the comment:

We discussed cache size previously and 128 is fine.

--Guido (mobile)

--

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-11-10 Thread Ed Schouten

Ed Schouten added the comment:

It can also be a structure or a union.

--

___
Python tracker 

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



[issue28659] xml.etree.cElementTree.write misses opening tag

2016-11-10 Thread Stelios

New submission from Stelios:

import xml.etree.cElementTree as ET

events = ET.Element('Events')
tree = ET.ElementTree(events)
tree.write('test.xml', xml_declaration=True, encoding='UTF-8')

writes to file:



Where opening tag  is missing

Python version: Python 3.5.2

--
components: XML
messages: 280515
nosy: chefarov
priority: normal
severity: normal
status: open
title: xml.etree.cElementTree.write misses opening tag
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



[issue28659] xml.etree.cElementTree.write misses opening tag

2016-11-10 Thread Xiang Zhang

Xiang Zhang added the comment:

 is an empty tag. It closes it self, not '/>'.

With some content, you can see it has start and end tag.

>>> import xml.etree.cElementTree as ET
>>> events = ET.Element('Events')
>>> events.text = 'abc'
>>> tree = ET.ElementTree(events)
>>> tree.write('/tmp/a.xml', xml_declaration=True, encoding='UTF-8')


abc

--
nosy: +xiang.zhang
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



[issue28659] xml.etree.cElementTree.write misses opening tag

2016-11-10 Thread Xiang Zhang

Xiang Zhang added the comment:

s/not/note

--

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0da2e381ad71 by Guido van Rossum in branch '3.5':
Issue #28649: fix first issue with _ForwardRef (#327)
https://hg.python.org/cpython/rev/0da2e381ad71

New changeset 249a1f0b2857 by Guido van Rossum in branch '3.6':
Issue #28649: fix first issue with _ForwardRef (#327) (3.5->3.6)
https://hg.python.org/cpython/rev/249a1f0b2857

New changeset 304f017462e4 by Guido van Rossum in branch 'default':
Issue #28649: fix first issue with _ForwardRef (#327) (3.6->3.7)
https://hg.python.org/cpython/rev/304f017462e4

--

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 555f0ca31587 by Guido van Rossum in branch '3.5':
Issue #28649: fix second issue with _ForwardRef (#328)
https://hg.python.org/cpython/rev/555f0ca31587

New changeset 0f863906cf2e by Guido van Rossum in branch '3.6':
Issue #28649: fix second issue with _ForwardRef (#328) (3.5->3.6)
https://hg.python.org/cpython/rev/0f863906cf2e

New changeset 84b4ac243508 by Guido van Rossum in branch 'default':
Issue #28649: fix second issue with _ForwardRef (#328) (3.6->3.7)
https://hg.python.org/cpython/rev/84b4ac243508

--

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks a bundle, Ivan! I've merged those two into CPython 3.5, 3.6, 3.7. We can 
now watch the build bots for a while and double-check the refleaks.

Yury, when you're happy with the situation can you close this issue?

--

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you Guido and Ivan!

> Yury, when you're happy with the situation can you close this issue?

I'll close it now, will reopen if something comes up.

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

___
Python tracker 

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



[issue28660] TextWrapper break_long_words=True, break_on_hyphens=True on long words

2016-11-10 Thread Peter

New submission from Peter:

Quoting https://docs.python.org/2/library/textwrap.html

width (default: 70) The maximum length of wrapped lines. As long as there are 
no individual words in the input text longer than width, TextWrapper guarantees 
that no output line will be longer than width characters.

It appears that with break_long_words=True and break_on_hyphens=True, any 
hyphenated term longer than the specified width does not get preferentially 
broken at a hyphen.

Example input:

We used the enyzme 2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate 
synthase.


Using break_long_words=True, break_on_hyphens=True
==
We used the enyzme 2-succinyl-6-hydroxy-2,4-cycloh
exadiene-1-carboxylate synthase.
==


Expected result using break_long_words=True, break_on_hyphens=True
==
We used the enyzme 2-succinyl-6-hydroxy-2,4-
cyclohexadiene-1-carboxylate synthase.
==


Given a width=50, then the 53 character long "word" of 
"2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate" must be split 
somewhere, and since break_on_hyphens=True it should break at a hyphen as shown 
above as the desired output.


Sample code:


import textwrap
w = 50
text = "We used the enyzme 
2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate synthase."
print("Input:")
print("=" * w)
print(text)
print("=" * w)
print("Using break_long_words=True, break_on_hyphens=True")
print("=" * w)
print(textwrap.fill(text, width=w, break_long_words=True, 
break_on_hyphens=True))
print("=" * w)

--
messages: 280522
nosy: maubp
priority: normal
severity: normal
status: open
title: TextWrapper break_long_words=True, break_on_hyphens=True on long words
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



[issue28649] refleak in typing.py

2016-11-10 Thread Guido van Rossum

Guido van Rossum added the comment:

BTW, do we still want the tearDown()? Or is that no longer necessary?

--

___
Python tracker 

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



[issue28649] refleak in typing.py

2016-11-10 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I think tearDown() is not necessary. But on the other hand it could be nice to 
have a method in tests to force cache clear. I would propose it not as a 
default, but as an opt-in to check that cache works well, or that a certain 
tested feature is "cache independent", etc.

--

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-11-10 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

Umm, API seems a design that is passing into function by integer or pointer 
because the users don't need type detail. I think the implementation of complex 
type is not realistic. Actually, CouldABI and Cygwin are used pointer, and type 
detail is hided.

--

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-11-10 Thread Ed Schouten

Ed Schouten added the comment:

CloudABI uses a structure type, which is exactly why I filed this bug report.

Instead of speculating about what kind of type existing implementations use, 
please just focus on the specification to which we're trying to stick: POSIX.

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

"All of the types shall be defined as arithmetic types of an appropriate 
length, with the following exceptions:

[...]
pthread_key_t
[...]"

--

___
Python tracker 

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



[issue28656] build error in cygwin64 ,because pthread_key_t

2016-11-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> PyThread assumes pthread_key_t is an integer, which is against 
POSIX

___
Python tracker 

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



[issue28660] TextWrapper break_long_words=True, break_on_hyphens=True on long words

2016-11-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Library (Lib)
nosy: +georg.brandl, serhiy.storchaka
type:  -> behavior
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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-11-10 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

On, I got complex type in cloudABI. I see my patch doesn't solve it.

https://github.com/NuxiNL/cloudlibc/blob/master/src/include/sys/types.h#L94
https://github.com/NuxiNL/cloudlibc/blob/master/src/include/_/types.h#L209

--

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Elvis Pranskevichus

Changes by Elvis Pranskevichus :


Added file: 
http://bugs.python.org/file45429/0002-Issue-28635-What-s-New-in-Python-3.6-updates.patch

___
Python tracker 

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



[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-10 Thread Elvis Pranskevichus

Elvis Pranskevichus added the comment:

This should now be covered in #28635.

--

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Elvis Pranskevichus

Changes by Elvis Pranskevichus :


Added file: 
http://bugs.python.org/file45428/0001-Issue-28635-Fix-a-couple-of-missing-incorrect-versio.patch

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Elvis Pranskevichus

Elvis Pranskevichus added the comment:

Attached patch for another pass on what's new.

--

___
Python tracker 

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



[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-10 Thread Yury Selivanov

Yury Selivanov added the comment:

Closing this one.

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bcd4ab982429 by Yury Selivanov in branch '3.6':
Issue #28635: Fix a couple of missing/incorrect versionchanged tags
https://hg.python.org/cpython/rev/bcd4ab982429

New changeset 5c4ce500dd35 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #28635)
https://hg.python.org/cpython/rev/5c4ce500dd35

--

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c0060567f35d by Yury Selivanov in branch '3.6':
Issue #28635: What's New in Python 3.6 updates
https://hg.python.org/cpython/rev/c0060567f35d

New changeset 69bdf8bdfd61 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #28635)
https://hg.python.org/cpython/rev/69bdf8bdfd61

--

___
Python tracker 

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



[issue557704] netrc module can't handle all passwords

2016-11-10 Thread Cristian Măgherușan-Stanciu

Cristian Măgherușan-Stanciu added the comment:

Is there anything blocking this from being really fixed? It's still broken on 
3.5.

The patch added two years ago works well for quoted passwords, I think that's 
good enough, anyway having some support is much better than the current out of 
the box situation.

--
versions: +Python 3.5 -Python 2.2

___
Python tracker 

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



[issue21145] Add the @cached_property decorator

2016-11-10 Thread Carl Meyer

Carl Meyer added the comment:

I've used the cached_property pattern across many different projects, and never 
yet wanted a TTL. The simple "cache for the lifetime of the instance" behavior 
is easy to implement, easy to understand, and useful for a wide range of 
scenarios where instances are effectively immutable. +1 for adding this to the 
stdlib (not just as a docs recipe); I'll see about providing a patch.

--
nosy: +carljm

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patches for following issues was applied in 3.5. They may be bug fixes, not new 
features.

#13248 #16113 #20476 #22115 #23517 #24764 #25590 #25593 #25913 #26470 #26733 
#26754 #26801 #27040 #27041 #27243 #27392 #27598 #27691 #27766 #27850 #27932 
#28370 #28613

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28661] Fix code example in Python 3.5 telnetlib documentation

2016-11-10 Thread Ivan Tomilov

New submission from Ivan Tomilov:

The code sample on page https://docs.python.org/3/library/telnetlib.html is a 
little confusing. The extra space in string "Password: " before the second 
quote basically hangs the example program when you try to run it.

Please, check my answer on Stack Overflow for more details:
http://stackoverflow.com/questions/28345839/python3-telnet-code-stays-quiet-after-launching-does-not-initiate-the-command-t/40535049#40535049

I'm sorry if I get something wrong.

Thanks,
Ivan.

--
assignee: docs@python
components: Documentation
messages: 280536
nosy: docs@python, tiabc
priority: normal
severity: normal
status: open
title: Fix code example in Python 3.5 telnetlib documentation
type: enhancement
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



[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-11-10 Thread Sohaib Ahmad

Sohaib Ahmad added the comment:

@Senthil, thanks for looking into this.

Looking forward to your commit.

Regards.

--

___
Python tracker 

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



[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-11-10 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

+The disassembler now decodes ``FORMAT_VALUE`` argument.
+(Contributed by Serhiy Storchaka in :issue:`28317`.)

FORMAT_VALUE is new in 3.6. This change should be considered as a part of PEP 
498 and is not deserve special mentioning.

--

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Elvis Pranskevichus

Elvis Pranskevichus added the comment:

Thanks Serhiy.  I removed mentions of things that were indeed fixes backported 
to 3.5.  Other issue references are valid news, including new features to 
provisional modules backported to 3.5.  It is customary to include these in the 
news for the major release.

--
Added file: 
http://bugs.python.org/file45430/0001-Issue-28635-what-s-new-in-3.6-remove-mentions-of-bac.patch

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4c81a107ccab by Yury Selivanov in branch '3.6':
Issue #28635: what's new in 3.6: remove mentions of backported fixes.
https://hg.python.org/cpython/rev/4c81a107ccab

New changeset 8ebaa546a033 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #28635)
https://hg.python.org/cpython/rev/8ebaa546a033

--

___
Python tracker 

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



[issue28644] Document recent changes in typing.py

2016-11-10 Thread Guido van Rossum

Changes by Guido van Rossum :


--
title: Document recen changes in typing.py -> Document recent changes in 
typing.py

___
Python tracker 

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



[issue21145] Add the @cached_property decorator

2016-11-10 Thread Carl Meyer

Carl Meyer added the comment:

Attaching a patch with the simplest version of cached_property (tehnique is not 
original, similar code is found in Django, Bottle, Flask, the cached_property 
lib, and many other places).

--
components: +Library (Lib)
keywords: +patch
versions: +Python 3.7 -Python 3.6
Added file: http://bugs.python.org/file45431/cached_property.diff

___
Python tracker 

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



[issue21145] Add the @cached_property decorator

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The decorator should support classes with __slots__.

--

___
Python tracker 

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



[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2016-11-10 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> half a millisecond is reduced.

I would like to caution against any significant changes to save microscopic 
amounts of time.  Twisting the code into knots for minor time savings is rarely 
worth it and it not what Python is all about.

> Half milliseconds is small, but it isn't negligible on some situation.

I would say that it is almost always negligible and reflects a need for a 
better sense of proportion and perspective.

Also, in the past we've found that efforts to speed start-up time were 
measurable only in trivial cases.  Tools like mercurial end-up importing and 
using a substantial chunk of the standard library anyway, so those tools got 
zero benefit from the contortions we did to move _collections_abc.py from 
underneath the collections module.

In the case of functools, if the was a real need (and I don't believe there 
is), I would be willing to accept INADA's original patch replacing the 
namedtuple call with its source.

That said, I don't think half millisecond is worth the increase in code volume 
and the double maintenance problem keeping it in-sync with any future changes 
to namedtuple.   In my opinion, accumulating technical debt in this fashion is 
a poor software design practice.

--

___
Python tracker 

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



[issue28591] imghdr doesn't recognize some jpeg formats

2016-11-10 Thread Raul

Raul added the comment:

New patch for imghdr bug, including unittets. This patch works on python 3.x

--
Added file: http://bugs.python.org/file45432/imghdr_py3.patch

___
Python tracker 

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



[issue28591] imghdr doesn't recognize some jpeg formats

2016-11-10 Thread Raul

Raul added the comment:

Image used in the unit-tests of previous patch.
Add it under Lib/test/imghdrdata/python1.jpg

--
Added file: http://bugs.python.org/file45433/python1.jpg

___
Python tracker 

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



[issue28591] imghdr doesn't recognize some jpeg formats

2016-11-10 Thread Raul

Raul added the comment:

The issue16512 don't solve the problem, note how the patch it provide fails to 
detect all the valid JPEG images attached in this issue.

--

___
Python tracker 

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



[issue21145] Add the @cached_property decorator

2016-11-10 Thread Carl Meyer

Carl Meyer added the comment:

How do you propose that slots should be supported?

Part of the value of cached_property is that cached access is a normal Python 
attribute access with no function call overhead. I am not interested in adding 
support for slots if it loses that benefit. I would not use such an 
implementation myself.

I may be missing some option, but I can't see how to add slots support without 
losing that benefit, because it requires the ability to store an instance 
attribute under the same name as the descriptor, taking advantage of the fact 
that instance dict overrides a non-data descriptor.

This implementation of cached_property has been in wide use in multiple very 
popular projects for many years. The fact that none of those implementations 
have ever needed to add slots support suggests that it isn't actually that 
important.

If you have an idea for how to support slots without making cached_property 
less valuable for the common case, please share it and I am willing to 
implement it.

Otherwise, I propose that this implementation which is already proved in wide 
usage should be added to the stdlib; I can add a documentation note that 
objects with slots are not supported. If there is demand for 
cached_property_with_slots, it can be added separately.

--

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-10 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I spotted a small typo in the "PEP 495: Local Time Disambiguation" section: 
"The values of the fold attribute have the value 0 all instances ..." should be 
"The values of the fold attribute have the value 0 *for* all instances ..."

--
nosy: +belopolsky

___
Python tracker 

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



[issue28661] Fix code example in Python 3.5 telnetlib documentation

2016-11-10 Thread R. David Murray

R. David Murray added the comment:

Well, the example code is correct for a typical telnet service running on a 
unix variant.  That will output a space after the colon, so that the user's 
input is separated from the colon when they start to type.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue28591] imghdr doesn't recognize some jpeg formats

2016-11-10 Thread Raul

Raul added the comment:

New patch for imghdr bug, including unittets. This patch works on python 2.7

--
Added file: http://bugs.python.org/file45434/imghdr_py27.patch

___
Python tracker 

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



[issue28662] catch also PermissionError in tests when spawning a non existent program

2016-11-10 Thread Xavier de Gaye

New submission from Xavier de Gaye:

This is yet another idiosyncrasy of Android, the /sbin directory is in the 
$PATH of the adb shell used for running the tests on the emulator or on a 
device connected with usb to the build platform, and /sbin is readable and 
searchable only by root. For a plain user, the loop over exec_array[] in 
child_exec() at _posixsubprocess.c sets saved_errno to EACCES after failing to 
exec /sbin/some_non_existent_program.

The patch fixes these failing tests on Android API 24: test_dtrace test_shutil 
test_subprocess.

--
components: Tests
files: catch_PermissionError.patch
keywords: patch
messages: 280551
nosy: xdegaye
priority: normal
severity: normal
stage: patch review
status: open
title: catch also PermissionError in tests when spawning a non existent program
type: behavior
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45435/catch_PermissionError.patch

___
Python tracker 

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



[issue28637] Python startup performance regression

2016-11-10 Thread STINNER Victor

STINNER Victor added the comment:

Oh nice, python_startup benchmark at Nov 10 (rev at 8ebaa546a033) is now faster 
than python_startup at Feb 29 (rev dfeadfb4c8cc): new 16.8 ms, old 19.5. And 
it's much before when I opened the issue: 26.6 ms. Thanks.

https://speed.python.org/timeline/#/?exe=4&ben=python_startup&env=1&revs=50&equid=off&quarts=on&extr=on

The main difference is the removal of "import re" from Lib/site.py. If I added 
back "import re", python_startup comes back to 24.2 ms +- 0.0 ms. I understand 
that "import re" adds 7.4 ms. Any additional import has an important cost of 
python startup performance :-/

--

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-11-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 137c7b92360e by Terry Jan Reedy in branch '2.7':
Issue #25507: Add back import needed for 2.x encoding warning box.
https://hg.python.org/cpython/rev/137c7b92360e

--
status: pending -> open

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-11-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Import is only needed for the warning issued when someone using IDLE 2.x puts a 
non-ascii character into code being edited and tries to save without adding an 
encoding declaration.  
https://stackoverflow.com/questions/40523932/idle-2-7-11-12-nameerror-global-name-toplevel-is-not-defined

--

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-11-10 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
status: open -> closed

___
Python tracker 

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



[issue27854] Installed 2.7: IDLE Help disabled because help.html is missing

2016-11-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Does attached file look correct?

--
keywords: +patch
stage:  -> commit review
Added file: http://bugs.python.org/file45436/add_idle_help.diff

___
Python tracker 

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



[issue28618] Decorate hot functions using __attribute__((hot)) to optimize Python

2016-11-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 59b91b4e9506 by Victor Stinner in branch 'default':
Issue #28618: Make hot functions using __attribute__((hot))
https://hg.python.org/cpython/rev/59b91b4e9506

--
nosy: +python-dev

___
Python tracker 

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



[issue28658] MacOsX idle don't run

2016-11-10 Thread Andrew Kontokanis

Changes by Andrew Kontokanis :


--
nosy: +ned.deily

___
Python tracker 

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



[issue28618] Decorate hot functions using __attribute__((hot)) to optimize Python

2016-11-10 Thread STINNER Victor

STINNER Victor added the comment:

I tried different patches and ran many quick & dirty benchmarks.

I tried to use likely/unlikely macros (using GCC __builtin__expect): the effect 
is not significant on call_simple microbenchmark. I gave up on this part.

__attribute__((hot)) on a few Python core functions fixes the major slowdown on 
call_method on the revision 83877018ef97 (described in the initial message).

I noticed tiny differences when using __attribute__((hot)), speedup in most 
cases. I noticed sometimes slowdown, but very small (ex: 1%, but 1% on a 
microbenchmark doesn't mean anything).

I pushed my patch to try to keep stable performance when Python is not compiled 
with PGO.

If you would like to know more about the crazy effect of code placement in 
modern Intel CPUs, I suggest you to see the slides of this recent talk from an 
Intel engineer:
https://llvmdevelopersmeetingbay2016.sched.org/event/8YzY/causes-of-performance-instability-due-to-code-placement-in-x86
"Causes of Performance Swings Due to Code Placement in IA by Zia Ansari 
(Intel), November 2016"

--

About PGO or not PGO: this question is not simple, I suggest to discuss it in a 
different place to not flood this issue ;-)

For my use case, I'm not convinced yet that PGO with our current build system 
produce reliable performance.

Not all Linux distributions compile Python using PGO: Fedora and RHEL don't 
compile Python using PGO for example. Bugzilla for Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=613045

I guess that there also some developers running benchmarks on Python compiled 
with "./configure && make". I'm trying to enhance documentation and tools 
around Python benchmarks to advice developers to use LTO and/or PGO.

--

___
Python tracker 

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



[issue28637] Python startup performance regression

2016-11-10 Thread Ethan Furman

Ethan Furman added the comment:

Leaving `re` out of site.py is fine; the current question is whether to add 
`enum` back to `re`.

--

___
Python tracker 

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



[issue28637] Python startup performance regression

2016-11-10 Thread Guido van Rossum

Guido van Rossum added the comment:

I think it's okay to add `enum` back into `re`.

--

___
Python tracker 

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



[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2016-11-10 Thread Nick Coghlan

Nick Coghlan added the comment:

I'll echo Raymond's concerns here, as we simply don't have the collective 
maintenance capacity to sustain a plethora of special case micro-optimisations 
aimed at avoiding importing common standard library modules.

I will note however, that there has been relatively little work done on 
optimising CPython's code generator, as the use of pyc files and the fact 
namedtuples are typically only defined at start-up already keeps it out of the 
critical path in most applications.

While work invested there would technically still be a micro-optimisation at 
the language level, it would benefit more cases than just avoiding the use of 
namedtuple in functools would.

Alternatively, rather than manually duplicating the namedtuple code and having 
to keep it in sync by hand, you could investigate the work Larry Hastings has 
already done for Argument Clinic in Python's C files: 
https://docs.python.org/3/howto/clinic.html

Argument Clinic already includes the machinery necessary to assist with 
automated maintenance of generated code (at least in C), and hence could 
potentially be adapted to the task of "named tuple inlining". If Victor's AST 
transformation pipeline and function guard proposals in PEP's 511 and 510 are 
accepted at some point in the future, then such inlining could potentially even 
be performed implicitly some day.

Caring about start-up performance is certainly a good thing, but when 
considering potential ways to improve the situation, structural enhancements to 
the underlying systems are preferable to ad hoc special cases that complicate 
future development efforts.

--

___
Python tracker 

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



[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2016-11-10 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks Nick.  I'm going to mark this as closed, as the proposal to microscopic 
to warrant incurring technical debt.

If someone comes forward with more fully formed idea for code generation or 
overall structural enchancement, that can be put in another tracker item.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue21145] Add the @cached_property decorator

2016-11-10 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue23839] Clear caches after every test

2016-11-10 Thread Raymond Hettinger

Raymond Hettinger added the comment:

LGTM.

--
nosy: +rhettinger

___
Python tracker 

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



[issue28661] Fix code example in Python 3.5 telnetlib documentation

2016-11-10 Thread Ivan Tomilov

Ivan Tomilov added the comment:

I see, thanks for the clarification.
But in my OS X the things are different and I spent about 1 hour trying
this code to take off.
Maybe it's better to change this code to avoid spending time for such
subtle bugs? Say:
tn.read_until(b"Password:")
tn.read_eager()

Or just add a comment. It's confusing when one takes code from the official
website and it doesn't work.

What do you think?

On 11 November 2016 at 02:05, R. David Murray 
wrote:

>
> R. David Murray added the comment:
>
> Well, the example code is correct for a typical telnet service running on
> a unix variant.  That will output a space after the colon, so that the
> user's input is separated from the colon when they start to type.
>
> --
> nosy: +r.david.murray
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue26786] bdist_msi duplicates directories with names in ALL CAPS to a bogus location

2016-11-10 Thread Ivan Pozdeev

Changes by Ivan Pozdeev :


Added file: http://bugs.python.org/file45437/bdist_msi.patch

___
Python tracker 

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



[issue26786] bdist_msi duplicates directories with names in ALL CAPS to a bogus location

2016-11-10 Thread Ivan Pozdeev

Changes by Ivan Pozdeev :


Removed file: http://bugs.python.org/file42496/bdist_msi.patch

___
Python tracker 

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



[issue28654] sys.stdout.isatty() returns True even if redirected to NUL

2016-11-10 Thread Kuno Meyer

Kuno Meyer added the comment:

2) Yes, it should be `> /dev/null` instead of `> /dev/nul` (my bad). The output 
remains the same.

--

___
Python tracker 

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



[issue28662] catch also PermissionError in tests when spawning a non existent program

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee:  -> xdegaye
nosy: +serhiy.storchaka
stage: patch review -> commit review

___
Python tracker 

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