[issue24700] array compare is hideously slow

2017-08-07 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The PR looks very reasonable.  This is a nice optimization.

--
nosy: +rhettinger

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See issue25130. Maybe forcing garbage collecting will help.

--

___
Python tracker 

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



[issue31137] Add a path attribute to NamedTemporaryFile

2017-08-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can just pass the name attribute to the pathlib.Path constructor. Adding a 
name attribute will not allow you to do what you can't do now, but will 
increase the coupling between the tempfile and pathlib modules. The purpose of 
introducing the path protocol was avoiding creating such couplings.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31138] dir argument NamedTemporaryFile should accept a pathlib.Path

2017-08-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Doesn't it support it?

>>> import tempfile, pathlib
>>> tempfile.NamedTemporaryFile(dir=pathlib.Path('/tmp'))


--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> The PR resolved the stack overflow in dfs(), however it now fails in the 
> stackdepth() routine (technically, the stackdepth_walk() helper).

Indeed. The compiler crashes for longer sequences on Linux too. I'm trying to 
rewrite stackdepth_walk() too, but it is much harder.

--

___
Python tracker 

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



[issue29910] Ctrl-D eats a character on IDLE

2017-08-07 Thread Louie Lu

Louie Lu added the comment:

da..., Terry reverts this soon.

--

___
Python tracker 

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



[issue29910] Ctrl-D eats a character on IDLE

2017-08-07 Thread Louie Lu

Louie Lu added the comment:

After bisecting, commit 213ce12adfc9281c6f381bb45d132e9de8ffd450 cause calltip 
can't close when type to `)` at the end.

for example:

print('blablalbalba')
 ^ show ^ didn't
   tipclose tip

--
nosy: +louielu

___
Python tracker 

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



[issue31072] add filter to zipapp

2017-08-07 Thread Jeffrey Rackauckas

Changes by Jeffrey Rackauckas :


--
pull_requests: +3054

___
Python tracker 

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



[issue31139] Improve tracemalloc demo code in docs

2017-08-07 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +3053

___
Python tracker 

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



[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-07 Thread Tim Peters

Tim Peters added the comment:

Yes, I'm closing as not-a-bug.  It's been this way (and documented) forever.  
More specifically, as the docs say, a raw string can't end with an _odd_ number 
of backslashes:

"""
String quotes can be escaped with a backslash, but the backslash remains in the 
string; for example, r"\"" is a valid string literal consisting of two 
characters: a backslash and a double quote; r"\" is not a valid string literal 
(even a raw string cannot end in an odd number of backslashes). Specifically, a 
raw string cannot end in a single backslash (since the backslash would escape 
the following quote character).
"""

--
nosy: +tim.peters
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



[issue31139] Improve tracemalloc demo code in docs

2017-08-07 Thread Louie Lu

New submission from Louie Lu:

Current tutorial of tracemalloc:
https://docs.python.org/3/library/tracemalloc.html

Current doc using a un-reproducible output, that will confuse the reader. 
Propose to use the test code `allocate_bytes` to control the memory usage 
output, provide more meaningful output to reader.

--
assignee: docs@python
components: Documentation
messages: 299892
nosy: docs@python, haypo, louielu
priority: normal
severity: normal
status: open
title: Improve tracemalloc demo code in docs
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



[issue31033] Add argument to .cancel() of Task and Future

2017-08-07 Thread Chris Jerdonek

Chris Jerdonek added the comment:

A couple thoughts on this issue:

First, I think the OP's original issue could perhaps largely be addressed 
without having to change cancel()'s signature. Namely, simply passing a 
hard-coded string to CancelledError in the couple spots that CancelledError is 
raised would cause the exception to display:

https://github.com/python/cpython/blob/733d0f63c562090a2b840859b96028d6ec0a4803/Lib/asyncio/futures.py#L153
https://github.com/python/cpython/blob/733d0f63c562090a2b840859b96028d6ec0a4803/Lib/asyncio/futures.py#L173

The "raise CancelledError" could be changed to "raise CancelledError('future is 
cancelled')", a bit like how InvalidStateError is handled a couple lines later:

if self._state == _CANCELLED:
raise CancelledError
if self._state != _FINISHED:
raise InvalidStateError('Result is not ready.')

Second, in terms of making cancellations easier to debug, is it a deliberate 
design decision that the CancelledError traceback "swallows" / doesn't show the 
point at which the coroutine was cancelled?

For example, running the following code--

async def run():
await asyncio.sleep(100)

loop = asyncio.new_event_loop()
task = asyncio.ensure_future(run(), loop=loop)
loop.call_later(2, task.cancel)
loop.run_until_complete(task)

Results in the following output:

Traceback (most recent call last):
  File "test-cancel.py", line 46, in 
loop.run_until_complete(task)
  File "/Users/.../python3.6/asyncio/base_events.py", line 466,
  in run_until_complete
return future.result()
concurrent.futures._base.CancelledError

In particular, it doesn't show that the task was waiting on 
asyncio.sleep(100) when the task was cancelled. It would be very useful to 
see full tracebacks in these cases. (Sorry in advance if this second point is 
off-topic for this issue.)

--

___
Python tracker 

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



[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-07 Thread Gregory P. Smith

Gregory P. Smith added the comment:

This may well be a "not a bug" resolution to preserve existing semantics that 
weren't what I expected.

--

___
Python tracker 

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



[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-07 Thread Martin Panter

Martin Panter added the comment:

What would your proposal do where an embedded backslash is currently valid?

>>> print(r'Backslash apostrophe: \'.')
Backslash apostrophe: \'.
>>> r'\'  # Comment or string?'
"\\'  # Comment or string?"

--
nosy: +martin.panter

___
Python tracker 

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



[issue29400] Add instruction level tracing via sys.settrace

2017-08-07 Thread George King

George King added the comment:

(Also I did prototype instruction filtering but it had mild performance 
implications when tracing so I have shelved it for the moment.)

--

___
Python tracker 

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



[issue29400] Add instruction level tracing via sys.settrace

2017-08-07 Thread George King

George King added the comment:

I've updated the patch and I think it's ready for a more serious review. A few 
notes:

* settracestate now takes a flag `trace_instructions`. This describes slightly 
better the behavior, which is that line events take precedence over 
instructions.

* the old gettrace now raises when `trace_instructions` was set, to prevent 
silent failure of the old idiom `saved = gettrace(); ... settrace(saved)`.

* gettracestate returns a dictionary, which can be passed to settracestate as 
kwargs. This allows for a replacement idiom `saved = gettracestate(); ... 
settracestate(**saved)` which should be forward-compatible with any flags we 
might add in the future.

The patch can be viewed here: 
https://github.com/python/cpython/compare/master...gwk:trace-inst

Let me know if I should open up an official PR. Also I just filled out the CLA.

--

___
Python tracker 

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



[issue30701] Exception parsing certain invalid email address headers

2017-08-07 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2017-08-07 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue30988] Exception parsing invalid email address headers starting or ending with dot

2017-08-07 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +gpolo

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +gpolo

___
Python tracker 

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



[issue31138] dir argument NamedTemporaryFile should accept a pathlib.Path

2017-08-07 Thread Wilfredo Sanchez

New submission from Wilfredo Sanchez:

Or, better, any object which conforms to the file system path protocol 
(__fspath__).

--
components: Library (Lib)
messages: 299886
nosy: wsanchez
priority: normal
severity: normal
status: open
title: dir argument NamedTemporaryFile should accept a pathlib.Path
versions: Python 3.6

___
Python tracker 

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



[issue31033] Add argument to .cancel() of Task and Future

2017-08-07 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

Workaround working on all Python versions, string concatenation made by the 
compiler: r"" "...".

>>> print(r"a\n" "\\")
a\n\

--
nosy: +haypo

___
Python tracker 

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



[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-07 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue31137] Add a path attribute to NamedTemporaryFile

2017-08-07 Thread Wilfredo Sanchez

New submission from Wilfredo Sanchez:

Add a path attribute to NamedTemporaryFile which provides a pathlib.Path object 
pointing to the file on disk.

--
components: Library (Lib)
messages: 299884
nosy: wsanchez
priority: normal
severity: normal
status: open
title: Add a path attribute to NamedTemporaryFile
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
title: test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7 -> 
test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 
2.7

___
Python tracker 

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



[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-07 Thread Gregory P. Smith

New submission from Gregory P. Smith:

A raw string literal cannot end in a backslash.  There is no friendly way to 
write a string that ends in a backslash character.

In particular I want to put the following into a Python string: \\?\

'?\\' works but is escaping hell so I wanted to suggest to the author to 
use r'\\?\' but that leads to:
SyntaxError: EOL while scanning string literal

Tested in a random 3.7.0a0 build as well as older 2.7 and 3.x stable versions.

r'\' is the easiest way to reproduce this.  (which could be written using the 
same number of bytes as '\\'... the use case above where a string containing a 
lot of \s that also ends in a \ is where it matters more from a code beauty 
point of view)

Can we update the parser to allow this?

--
components: Interpreter Core
messages: 299883
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: raw strings cannot end with a backslash character r'\'
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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

I created bpo-31135: "[2.7] test_ttk_guionly doesn't destroy all widgets on 
Python 2.7".

--

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

I only tested Python 2.7. I didn't check if other branches are affected.

--
title: test_ttk_guionly doesn't destroy all widgets -> [2.7] test_ttk_guionly 
doesn't destroy all widgets on Python 2.7

___
Python tracker 

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



[issue31135] test_ttk_guionly doesn't destroy all widgets

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file47062/fix_destroy.patch

___
Python tracker 

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



[issue31135] test_ttk_guionly doesn't destroy all widgets

2017-08-07 Thread STINNER Victor

New submission from STINNER Victor:

While working on bpo-31068, I wrote attached widget_instance.patch to check if 
test_ttk_guionly really removes all widgets. Bad news: it doesn't. Example:

haypo@selma$ ./python -m test  -u all test_ttk_guionly
(...)
test test_ttk_guionly crashed -- : leaking 69 
widgets
(...)

Attached fix_destroy.patch is my attempt to fix this issue.

--
components: Tkinter
files: widget_instance.patch
keywords: patch
messages: 299880
nosy: haypo
priority: normal
severity: normal
status: open
title: test_ttk_guionly doesn't destroy all widgets
type: resource usage
versions: Python 2.7
Added file: http://bugs.python.org/file47061/widget_instance.patch

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

Another bug, truncated traceback since the top was the same:

(...)
File: "C:\haypo\2.7\lib\lib-tk\test\test_ttk\test_widgets.py", line 1367, in 
test_heading_callback
  self.tv.update()
File: "C:\haypo\2.7\lib\lib-tk\Tkinter.py", line 1023, in update
  self.tk.call('update')

--

___
Python tracker 

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



[issue29432] wait_for(gather(...)) logs weird error message

2017-08-07 Thread Chris Jerdonek

Chris Jerdonek added the comment:

By the way, I see this exact issue was also raised and discussed here, with a 
couple responses by Guido, too:
https://github.com/python/asyncio/issues/253

--

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

Ah! I captured the traceback of a first bug using the command:

PCbuild\amd64\python_d.exe -m test -R 3:3 -u all -v --timeout=30 -r -F 
test_ttk_guionly

Output:

(...)
test_resize (test_ttk.test_extensions.LabeledScaleTest) ...
*** STACKTRACE - START ***
# ThreadID: 1216
File: "C:\haypo\2.7\lib\threading.py", line 774, in __bootstrap
  self.__bootstrap_inner()
File: "C:\haypo\2.7\lib\threading.py", line 801, in __bootstrap_inner
  self.run()
File: "C:\haypo\2.7\lib\test\regrtest.py", line 2024, in run
  self.dump_threads()
File: "C:\haypo\2.7\lib\test\regrtest.py", line 2050, in dump_threads
  self.dump_thread(stack)

# ThreadID: 2172
File: "C:\haypo\2.7\lib\runpy.py", line 174, in _run_module_as_main
  "__main__", fname, loader, pkg_name)
File: "C:\haypo\2.7\lib\runpy.py", line 72, in _run_code
  exec code in run_globals
File: "C:\haypo\2.7\lib\test\__main__.py", line 3, in 
  regrtest.main_in_temp_cwd()
File: "C:\haypo\2.7\lib\test\regrtest.py", line 2083, in main_in_temp_cwd
  main()
File: "C:\haypo\2.7\lib\test\regrtest.py", line 841, in main
  result = local_runtest()
File: "C:\haypo\2.7\lib\test\regrtest.py", line 827, in local_runtest
  testdir=testdir)
File: "C:\haypo\2.7\lib\test\regrtest.py", line 1042, in runtest
  return runtest_inner(test, verbose, quiet, huntrleaks, pgo, testdir)
File: "C:\haypo\2.7\lib\test\regrtest.py", line 1234, in runtest_inner
  huntrleaks)
File: "C:\haypo\2.7\lib\test\regrtest.py", line 1369, in dash_R
  run_the_test()
File: "C:\haypo\2.7\lib\test\regrtest.py", line 1355, in run_the_test
  indirect_test()
File: "C:\haypo\2.7\lib\test\test_ttk_guionly.py", line 37, in test_main
  *runtktests.get_tests(text=False, packages=['test_ttk']))
File: "C:\haypo\2.7\lib\test\support\__init__.py", line 1577, in run_unittest
  _run_suite(suite)
File: "C:\haypo\2.7\lib\test\support\__init__.py", line 1532, in _run_suite
  result = runner.run(suite)
File: "C:\haypo\2.7\lib\unittest\runner.py", line 151, in run
  test(result)
File: "C:\haypo\2.7\lib\unittest\suite.py", line 70, in __call__
  return self.run(*args, **kwds)
File: "C:\haypo\2.7\lib\unittest\suite.py", line 108, in run
  test(result)
File: "C:\haypo\2.7\lib\unittest\suite.py", line 70, in __call__
  return self.run(*args, **kwds)
File: "C:\haypo\2.7\lib\unittest\suite.py", line 108, in run
  test(result)
File: "C:\haypo\2.7\lib\unittest\case.py", line 393, in __call__
  return self.run(*args, **kwds)
File: "C:\haypo\2.7\lib\unittest\case.py", line 329, in run
  testMethod()
File: "C:\haypo\2.7\lib\lib-tk\test\test_ttk\test_extensions.py", line 184, in t
est_resize
  x.update()
File: "C:\haypo\2.7\lib\lib-tk\Tkinter.py", line 1023, in update
  self.tk.call('update')

*** STACKTRACE - END ***

--

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-07 Thread Eryk Sun

Eryk Sun added the comment:

Here are a couple of workarounds for the crash in Windows.

The default stack reservation size is a field in the PE/COFF header, which you 
can edit using editbin.exe, e.g.:

editbin /stack:[size_in_bytes] "path\to\python.exe"

The distributed python.exe has a 2000 byte stack reservation. I changed it 
to 3 MiB and was able to run generated.py. You can also pre-compile it on a 
thread with a larger stack, e.g.:

>>> import threading
>>> from compileall import compile_file
>>> threading.stack_size(2**20 * 3)
0
>>> t = threading.Thread(target=compile_file, args=('generated.py',))
>>> t.start()
>>> Compiling 'generated.py'...

--
nosy: +eryksun

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

I'm trying to reproduce the bug using the following command run in a Command 
Prompt:

PCbuild\amd64\python_d.exe -m test -r -u all -R 3:3 -F -v --timeout=30 
test_ttk_guionly

Note: I'm using https://github.com/python/cpython/pull/3019 to get --timeout 
feature.

Once (when I wasn't using --timeout=30), I saw 
test_ttk.test_widgets.TreeviewTest.test_tag_bind() stuck! But it only saw this 
bug twice in 1 hour of intensive tests, and so I'm not sure that it exists.

Since I unable to easily reproduce the bug, it's hard to collect more 
information about the program state when the bug occurs.

--

___
Python tracker 

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



[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-07 Thread Varun Agrawal

Varun Agrawal added the comment:

Hi David,
It seems you already took a look at the man page. There are some subtle 
differences such as being unable to match to a directory when the pattern ends 
with a forward slash.
Overall, I'd like to see fnmatch be used to create a program that can perform 
pattern matching of files similar to how a gitignore works. Currently, this 
involves quite a bit of hackery to get working well.

--

___
Python tracker 

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



[issue31134] python not added to path

2017-08-07 Thread Eryk Sun

Changes by Eryk Sun :


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



[issue30351] [2.7] regrtest hangs on Python 2.7 (test_threading?)

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3052

___
Python tracker 

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



[issue31134] python not added to path

2017-08-07 Thread AW

Changes by AW :


--
resolution:  -> not a bug

___
Python tracker 

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



[issue31134] python not added to path

2017-08-07 Thread AW

AW added the comment:

Sorry, no I didn't.  When I went off to find out how to add Python to the path 
manually, I found out that opening a new command window would be needed to see 
any update.  I was coming back to say "never mind" when I saw your message.  

Sorry to bother you!

--

___
Python tracker 

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



[issue31134] python not added to path

2017-08-07 Thread Eryk Sun

Eryk Sun added the comment:

A WM_SETTINGCHANGE message gets broadcasted to top-level windows, so Explorer 
should reload its environment from the registry. Did you start a new command 
prompt from Explorer?

--
nosy: +eryksun

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-08-07 Thread Ned Deily

Ned Deily added the comment:

Just to clarify:  the revision added since 3.5.4rc1, 
f9fbed19a964e55ee703005823d8a7408f83d7f4 ([3.5] bpo-30876: Add new import test 
files to projects) fixes a test failure seen on all non-Windows platforms when 
running tests from an installed Python.  It's probably not worth retagging 
3.5.4 final at this point just for this.

--

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-07 Thread Brett Cannon

Brett Cannon added the comment:

One fix at a time. 😉

On Mon, Aug 7, 2017, 07:52 Jeremy Kloth,  wrote:

>
> Jeremy Kloth added the comment:
>
> The PR resolved the stack overflow in dfs(), however it now fails in the
> stackdepth() routine (technically, the stackdepth_walk() helper).
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2017-08-07 Thread Shane Harvey

Shane Harvey added the comment:

When are these functions going to be deprecated? In 3.5, 3.6, and master they 
still raise PendingDeprecationWarning, not DeprecationWarning:
https://github.com/python/cpython/blob/v3.5.3/Lib/platform.py#L305-L306
https://github.com/python/cpython/blob/v3.6.2/Lib/platform.py#L304-L305
https://github.com/python/cpython/blob/5c4b0d0/Lib/platform.py#L304-L305

--
nosy: +ShaneHarvey

___
Python tracker 

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



[issue31134] python not added to path

2017-08-07 Thread AW

New submission from AW:

I selected "Add Python 3.6 to PATH" when I installed the program. 

I am able to launch Python from the start button. 

It isn't recognized on the command line.

See screen shots in the attached Word file.

--
files: PythonError.docx
messages: 299868
nosy: AW
priority: normal
severity: normal
status: open
title: python not added to path
type: behavior
Added file: http://bugs.python.org/file47060/PythonError.docx

___
Python tracker 

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



[issue27755] Retire DynOptionMenu with a ttk Combobox

2017-08-07 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Maybe there should be a bug tracker issue to add it to ttk.py?

--

___
Python tracker 

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



[issue31132] test_prlimit from test_resource fails when building python3 inside systemd-nspawn environment

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

Maybe we should simply skip the test if the user is root? If os.getuid()==0.

--
nosy: +haypo

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

The merged change is the correct fix. My change was only a workaround.

Thanks for the fix Terry ;-)

--

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

I confirm that test_idle doesn't leak anymore:

$ ./python -m test -R 3:3 -u all test_idle 
1 test OK.

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-08-07 Thread Alexander Mohr

Alexander Mohr added the comment:

hmm, may be my fault due to docker image tagging issue.  Will redeploy and 
update if the issue persists.  If I don't reply again sorry for the noise.

--

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread Terry J. Reedy

Changes by Terry J. Reedy :


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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 9d7d928b5853b921ed27f1e535dfe8174169854c by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-31130: IDLE -- stop leaks in test_configdialog. (GH-3016) (#3018)
https://github.com/python/cpython/commit/9d7d928b5853b921ed27f1e535dfe8174169854c


--

___
Python tracker 

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



[issue27755] Retire DynOptionMenu with a ttk Combobox

2017-08-07 Thread Mark Roseman

Mark Roseman added the comment:

Cheryl, regarding the spinbox, as per 
http://www.tkdocs.com/tutorial/morewidgets.html#spinbox, the ttk version 
appeared in Tk 8.5.9, which might explain it's absence in tkinter.

A wrapper isn't too hard to do of course... e.g. 
https://stackoverflow.com/questions/30783603/create-new-ttk-widget-from-tkinter

--

___
Python tracker 

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



[issue24700] array compare is hideously slow

2017-08-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Not saying that this issue shouldn't be fixed, but Numpy arrays are a much more 
powerful and well-optimized replacement for array.array.

--
nosy: +pitrou

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3051

___
Python tracker 

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



[issue29910] Ctrl-D eats a character on IDLE

2017-08-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset b61de2d46596ac00dcf2d33bbce2023d0bf4207b by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-29910: IDLE - revert `break`s that disabled calltip close. (GH-2997) 
(#3017)
https://github.com/python/cpython/commit/b61de2d46596ac00dcf2d33bbce2023d0bf4207b


--

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 733d0f63c562090a2b840859b96028d6ec0a4803 by Terry Jan Reedy in 
branch 'master':
bpo-31130: IDLE -- stop leaks in test_configdialog. (#3016)
https://github.com/python/cpython/commit/733d0f63c562090a2b840859b96028d6ec0a4803


--

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Attached is an improved idlelib.idle_test.test_* leak checker that uses the 
--match option.

--
assignee:  -> terry.reedy
components: +IDLE, Tests
nosy: +terry.reedy
Added file: http://bugs.python.org/file47059/findleak.py

___
Python tracker 

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



[issue30642] Fix leaks in idlelib

2017-08-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Unlinked old findleak.py after uploading much improved version to #31130.

--

___
Python tracker 

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



[issue30642] Fix leaks in idlelib

2017-08-07 Thread Terry J. Reedy

Changes by Terry J. Reedy :


Removed file: http://bugs.python.org/file46948/findleak.py

___
Python tracker 

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



[issue29910] Ctrl-D eats a character on IDLE

2017-08-07 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3050

___
Python tracker 

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



[issue29910] Ctrl-D eats a character on IDLE

2017-08-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 89225871d314fa675ea9ac292e7bc75320f1aef5 by Terry Jan Reedy in 
branch 'master':
bpo-29910: IDLE - revert `break`s that disabled calltip close. (#2997)
https://github.com/python/cpython/commit/89225871d314fa675ea9ac292e7bc75320f1aef5


--

___
Python tracker 

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



[issue31133] [2.7] PCbuild/pcbuild.sln of Python 2.7 cannot be open by Visual Studio 2010

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
title: [2.7] PCbuild/pcbuild.sln cannot be open by Visual Studio 2010 -> [2.7] 
PCbuild/pcbuild.sln of Python 2.7 cannot be open by Visual Studio 2010

___
Python tracker 

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



[issue31133] [2.7] PCbuild/pcbuild.sln cannot be open by Visual Studio 2010

2017-08-07 Thread STINNER Victor

New submission from STINNER Victor:

The devguide says that Python 2.7 can be build using VS 2010 but it's wrong.

PCbuild/pcbuild.sln starts with:

Microsoft Visual Studio Solution File, Format Version 12.00

Where 12.00 means Visual Studio 2013.

Replacing 12.00 with 11.00 allows me to open the solution in Visual Studio 
2010. So I suggest to make this change.

Note: By the way, why VS wants to build in 32-bit mode by default? It would be 
nice to switch to 64-bit mode by default!

--
components: Build, Windows
messages: 299854
nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [2.7] PCbuild/pcbuild.sln cannot be open by Visual Studio 2010
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



[issue31132] test_prlimit from test_resource fails when building python3 inside systemd-nspawn environment

2017-08-07 Thread Tomas Orsava

Tomas Orsava added the comment:

So the issue seems to be that Python believes it's run without root privileges, 
but it's mistaken because it indeed has root.

--
nosy: +torsava

___
Python tracker 

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



[issue31132] test_prlimit from test_resource fails when building python3 inside systemd-nspawn environment

2017-08-07 Thread Charalampos Stratakis

New submission from Charalampos Stratakis:

FAIL: test_prlimit (test.test_resource.ResourceTest)
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.6.2/Lib/test/support/__init__.py", line 
556, in wrapper
return func(*args, **kw)
  File "/builddir/build/BUILD/Python-3.6.2/Lib/test/test_resource.py", line 
153, in test_prlimit
1, resource.RLIMIT_AS)
AssertionError: PermissionError not raised by prlimit


I observed this issue when mock [0] the underlying build system we use in 
Fedora started using the systemd-nspawn container technology instead of chroot 
[1][2] in order to create a minimal build environment.

[0] https://github.com/rpm-software-management/mock
[1] https://github.com/rpm-software-management/mock/wiki/Release-Notes-1.4.1
[2] https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

--
messages: 299852
nosy: cstratak
priority: normal
severity: normal
status: open
title: test_prlimit from test_resource fails when building python3 inside 
systemd-nspawn environment
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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3049

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-08-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Idlelib is a bit exceptional: see PEP 434.  Except for one test and the news 
files, I keep idlelib identical in 3.6 and 3.7.  This makes all backports, 
*including new tests*, trivial and overall reduces the risk of regression 
(unless IDLE 3.6 were abandoned completely).  The risk of regression is why I 
have only touched 3.6/7 since last Fall, why I am increasingly strict about 
testing, and why I will manually test everything at least a few days before the 
next release candidate.

--

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-07 Thread Jeremy Kloth

Jeremy Kloth added the comment:

The PR resolved the stack overflow in dfs(), however it now fails in the 
stackdepth() routine (technically, the stackdepth_walk() helper).

--

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PR 3015 gets rid of recursion for normal control flow in the compiler. This 
fixes a stack overflow for this case.

--

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3048

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2017-08-07 Thread Guillaume Sanchez

Guillaume Sanchez added the comment:

> I don't think unicodedata is the right place

I do agree with that. A new module sounds good, would it be a problem if that 
module would contain very few functions at first?

> Can we mark this as having a Provisional API to give us time to decide on the 
> best API before locking it in permanently?

I'm not sure it's my call to make, but I would gladly consider that option.

> we should go through a PEP.

Why not. I may need a bit of guidance though.

> If you want state keeping for iterating over multiple  parts of 
> the string, you can use an iterator.

Sure thing. It just wasn't specified like this in the proto-PEP.

> The APIs were inspired by the standard string.find() APIs, that's why they 
> work on indexes and don't return Unicode strings. As such, they serve a 
> different use case than an iterator.

I personally like having a generator returning slice objects, as suggested 
above. What would be some good objections to this?

> Wouldn't this be a typical case where we'd expect a module to evolve and gain 
> usage on PyPI first, before adding it to the stdlib? [...] they might give 
> inspiration for a suitable API design

I'll give it a look.

> The well known library for Unicode support in C++ and Java is ICU

Yes. I clearly don't want this PR to be interpreted as "we're needing ICU". ICU 
provides much much more than what I'm willing to provide. My goal here is just 
to "fix" how the python's standard library iterates over characters. Noting 
more, nothing less.

One might think that splitlines() should be "fixed" too, and there is clearly 
matter to discuss here. Same for words splitting. However, I do not intend to 
bring normalization, which you already have, collations, locale dependant 
upcasing or lowercasing, etc. We might need a wheel, but we don't have to take 
the whole truck.

How do we discuss all of this? Who's in charge of making decisions? How long 
should we debate? That's my first time contributing to Python and I'm new to 
all of that.

Thanks for your time.

--

___
Python tracker 

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



[issue29432] wait_for(gather(...)) logs weird error message

2017-08-07 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I noticed that the future defined by asyncio.gather(sleep) is in a "pending" 
state immediately after the asyncio.TimeoutError.

One workaround is to wait for the cancellation to finish:

@asyncio.coroutine
def main():
sleep = asyncio.sleep(0.2)
future = asyncio.gather(sleep)
try:
yield from asyncio.wait_for(future, timeout=0.1)
except asyncio.TimeoutError:
print(f'future: {future}')
try:
yield from future
except asyncio.CancelledError:
print(f'future: {future}')
yield from asyncio.sleep(0.1)

asyncio.get_event_loop().run_until_complete(main())

Outputs:

future: <_GatheringFuture pending>
future: <_GatheringFuture finished exception=CancelledError()>

Another option is to pass return_exceptions=True to gather(). This appears to 
make the log messages you were concerned about go away:

future: <_GatheringFuture pending>

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue28414] SSL match_hostname fails for internationalized domain names

2017-08-07 Thread Christian Heimes

Christian Heimes added the comment:

For the record, I'm now considering match_hostname() on U-Labels crazy level 'A 
sure sign of someone who wears his underpants on his head.'. Once upon a time I 
had some hope to make it work and keep server_hostname to be an IDN U-Label. I 
no longer think it feasible and safe at the same time.

Pros:

* ACE is native encoding in SNI TLSEXT.
* ACE is native encoding in X509v3 SAN extension.
* ACE is native encoding in DNS.
* ACE is required to avoid partial wildcards on punycode ("x*" must not match 
"xn--...").
* OpenSSL's hostname verification operates on ACE.
* ACE is not ambiguous, ACE -> U-label -> ACE depends on IDNA standard and 
settings.

Cons:

* Making SSLSocket.server_hostname IDN A-label instead of U-label is backwards 
incompatible.

Self-quote from 
https://github.com/pyca/cryptography/issues/3357#issuecomment-318902879

---
I have been struggling with similar issues in Python's ssl module. The current 
implementation cannot verify and match IDN host names. It's also a bit of a 
mess, SNI callback and server_hostname are IDN U-labels, cert attributes are 
IDN A-labels. I have played with several approaches to fix the issue. So far 
only one approach is both simple enough to be memorable and not a potential 
source of security issues. It's also fully backwards compatible with ASCII-only 
host names.

User supplied input (hostname for TCP connection, server hostname) can be 
specified as either IDN U-label (str), IDN A-label (aka ACE, str) or ACE bytes. 
Internally the socket module and SSL module use ACE bytes only. Text (str) are 
converted to ACE bytes using IDNA. Since ACE str are just ASCII, IDNA encoding 
of ACE str is equivalent to encoding with ASCII encoding.

All output (SAN dNSName, SAN URI, CN, SNI callback, server_hostname attribute) 
are decoded as ACE strings. Since IDN is not a bijective mapping and also 
depends on the IDNA standard (2003, 2008, UTS46), this avoids some potential 
security issues. X.509 hostname verification and matching is defined on ACE, 
not IDN U-labels. I would rather keep them as bytes, but it wouldn't be 
backwards compatible. Also the aligns the SSL module with the socket module. 
socket.getnameinfo() decodes with ASCII, not with IDNA.

The new approach will make the SSL module compatible with the external idna 
package and IDNA 2008. Users just have to pass in ACE bytes as server_hostname.
---

--

___
Python tracker 

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



[issue31131] asyncio.wait_for() TimeoutError doesn't provide full traceback

2017-08-07 Thread Chris Jerdonek

New submission from Chris Jerdonek:

In Python 3.6.1, if asyncio.wait_for() times out with a TimeoutError, the 
traceback doesn't show what line the code was waiting on when the timeout 
occurred. This makes it more difficult to diagnose the cause of a timeout.

To reproduce, you can use the following code:

import asyncio

async def run():
print('running...')
await asyncio.sleep(100)

def main(coro):
loop = asyncio.new_event_loop()
future = asyncio.wait_for(coro, timeout=1)
loop.run_until_complete(future)

main(run())

It gives the following output (notice that the sleep() line is missing):

$ python test-timeouterror.py 
running...
Traceback (most recent call last):
  File "test-timeouterror.py", line 12, in 
main(run())
  File "test-timeouterror.py", line 10, in main
loop.run_until_complete(future)
  File "/Users/.../python3.6/asyncio/base_events.py", line 466,
 in run_until_complete
return future.result()
  File "/Users/.../python3.6/asyncio/tasks.py", line 356, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

It seems like it should be possible to show the full traceback because, for 
example, if I register a signal handler with loop.add_signal_handler() as 
described here:
https://mail.python.org/pipermail/async-sig/2017-August/000374.html
and press Control-C before the timeout occurs, I do get a full traceback 
showing the line:

await asyncio.sleep(100)

--
components: Library (Lib), asyncio
messages: 299845
nosy: chris.jerdonek, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.wait_for() TimeoutError doesn't provide full traceback
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue31120] [2.7] Python 64 bit _ssl compile fails due missing buildinf_amd64.h

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

> Summary on builds 42-61, builds interrupted because of test_ttk_guionly: 43, 
> 52, 55, 56, 61.

5 fails/20 builds: a failure rate of 25% (1/4) :-(

--

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

The build 43 was also interrupted (it was running for 10 hours).

Summary on builds 42-61, builds interrupted because of test_ttk_guionly: 43, 
52, 55, 56, 61.

Note: build 53 also failed, but for a different unknown reason.

--

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

The build 56 was also interrupted, it was running for 85 hours.

--

___
Python tracker 

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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

I interrupted the build 61 (it was running since 58 hours).

...
running: test_ttk_guionly (191065 sec)
running: test_ttk_guionly (191095 s
command interrupted, attempting to kill

--

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3047

___
Python tracker 

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



[issue30855] [3.5] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

Oh, the test also failed on Python 3.5 (on "AMD64 Windows8.1 Refleaks 3.5" 
buildbot):

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.5/builds/62/steps/test/logs/stdio

==
ERROR: test_use (tkinter.test.test_tkinter.test_widgets.ToplevelTest) 
(wid='0x87a60298')
--
Traceback (most recent call last):
  File 
"D:\buildarea\3.5.ware-win81-release.refleak\build\lib\tkinter\test\test_tkinter\test_widgets.py",
 line 96, in test_use
widget2 = self.create(use=wid)
  File 
"D:\buildarea\3.5.ware-win81-release.refleak\build\lib\tkinter\test\test_tkinter\test_widgets.py",
 line 70, in create
return tkinter.Toplevel(self.root, **kwargs)
  File 
"D:\buildarea\3.5.ware-win81-release.refleak\build\lib\tkinter\__init__.py", 
line 2190, in __init__
BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
  File 
"D:\buildarea\3.5.ware-win81-release.refleak\build\lib\tkinter\__init__.py", 
line 2147, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: integer value too large to represent

--

___
Python tracker 

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



[issue30855] [3.5] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

The test failed on "AMD64 Windows8.1 Refleaks 2.7" buildbot:

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%202.7/builds/60/steps/test/logs/stdio

test_padx (test_tkinter.test_widgets.ToplevelTest) ... ok
test_pady (test_tkinter.test_widgets.ToplevelTest) ... ok
test_relief (test_tkinter.test_widgets.ToplevelTest) ... ok
test_screen (test_tkinter.test_widgets.ToplevelTest) ... skipped 'No $DISPLAY 
set.'
test_takefocus (test_tkinter.test_widgets.ToplevelTest) ... ok
test_use (test_tkinter.test_widgets.ToplevelTest) ... ERROR
test_visual (test_tkinter.test_widgets.ToplevelTest) ... ok
test_width (test_tkinter.test_widgets.ToplevelTest) ... test test_tk failed -- 
Traceback (most recent call last):
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_tkinter\test_widgets.py",
 line 92, in test_use
widget2 = self.create(use=wid)
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_tkinter\test_widgets.py",
 line 67, in create
return tkinter.Toplevel(self.root, **kwargs)
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\Tkinter.py", line 
2138, in __init__
BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\Tkinter.py", line 
2095, in __init__
(widgetName, self._w) + extra + self._options(cnf))
TclError: expected integer but got "0x92b20298L"

ok

==
ERROR: test_use (test_tkinter.test_widgets.ToplevelTest)
--
Traceback (most recent call last):
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_tkinter\test_widgets.py",
 line 92, in test_use
widget2 = self.create(use=wid)
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_tkinter\test_widgets.py",
 line 67, in create
return tkinter.Toplevel(self.root, **kwargs)
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\Tkinter.py", line 
2138, in __init__
BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\Tkinter.py", line 
2095, in __init__
(widgetName, self._w) + extra + self._options(cnf))
TclError: expected integer but got "0x92b20298L"

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

___
Python tracker 

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



[issue30830] HTTPHandlerTest of test_logging leaks a "dangling" thread on AMD64 FreeBSD CURRENT Non-Debug 3.x

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

Another test_listen_config_10_ok() example:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/674/steps/test/logs/stdio

test_config_8a_ok (test.test_logging.ConfigDictTest) ... ok
test_config_9_ok (test.test_logging.ConfigDictTest) ... ok
test_listen_config_10_ok (test.test_logging.ConfigDictTest) ... Warning -- 
threading_cleanup() failed to cleanup -1 threads after 2 sec (count: 0, 
dangling: 1)
ok
test_listen_config_1_ok (test.test_logging.ConfigDictTest) ... ok
test_listen_verify (test.test_logging.ConfigDictTest) ... ok
test_out_of_order (test.test_logging.ConfigDictTest) ... ok
test_manager_loggerclass (test.test_logging.ManagerTest) ... ok

--

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

I don't know anything about idlelib, but it seems like the following patch 
fixes the failing test:

diff --git a/Lib/idlelib/idle_test/test_configdialog.py 
b/Lib/idlelib/idle_test/test_configdialog.py
index aff3c2f..9f495fd 100644
--- a/Lib/idlelib/idle_test/test_configdialog.py
+++ b/Lib/idlelib/idle_test/test_configdialog.py
@@ -41,6 +41,7 @@ def tearDownModule():
 global root, dialog
 idleConf.userCfg = usercfg
 tracers.detach()
+tracers.clear()
 del dialog
 root.update_idletasks()
 root.destroy()

Extract of ConfigDialog.create_page_highlight():

self.builtin_theme = tracers.add(
StringVar(parent), self.var_changed_builtin_theme)

This method contains many tracers.add() calls, but tearDownModule() of 
Lib/idlelib/idle_test/test_configdialog.py only calls "tracers.detach()" and 
detatch() doesn't clear VarTrace.untraced list.

--

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

By the way, I suggest to not backport refactoring changes to stable branches 
like Python 3.6. Any refactoring is a risk of regressions. Well, it's just an 
advice, Terry knows IDLE much better than me ;-) It's up to you to decide to 
backport or not such change.

--

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
versions: +Python 3.6

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:

> New changeset 9397e2a87ed6e0e724ad71a0c751553620cb775e by Terry Jan Reedy 
> (csabella) in branch 'master':
> bpo-31004: IDLE: Factor out FontPage class from configdialog (step 1) (#2905)

This change introduced reference leaks in test_idle: see bpo-31130.

--
nosy: +haypo

___
Python tracker 

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



[issue31130] test_idle: idlelib.configdialog leaks references

2017-08-07 Thread STINNER Victor

New submission from STINNER Victor:

Starting at the following build, test_idle started to leak references:
http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.x/builds/60/steps/test/logs/stdio

Example of leak:

$ ./python -m test -R 3:3 -u all test_idle -m 
idlelib.idle_test.test_configdialog.FontPageTest.test_set_samples
(...)
test_idle leaked [2168, 2168, 2168] references, sum=6504
test_idle leaked [1152, 1154, 1155] memory blocks, sum=3461
(...)

A bisection identified this commit:

commit 9397e2a87ed6e0e724ad71a0c751553620cb775e
Author: csabella 
Date:   Sun Jul 30 13:34:25 2017 -0400

bpo-31004: IDLE: Factor out FontPage class from configdialog (step 1) 
(#2905)

The slightly modified tests continue to pass. The General test
broken by the switch to Notebook is fixed.
Patch mostly by Cheryl Sabella.

--
messages: 299834
nosy: haypo
priority: normal
severity: normal
status: open
title: test_idle: idlelib.configdialog leaks references
type: resource usage
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



[issue31106] os.posix_fallocate() generate exception with errno 0

2017-08-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-08-07 Thread Larry Hastings

Larry Hastings added the comment:

Okay, that's good news.  That means I don't have to accept a fix for it in the 
3.5 branch *after* 3.5 transitions to security-fixes-only mode tomorrow ;-)

--

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-08-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a FreeBSD bug. It isn't related to this change. See issue31044 for 
details.

--

___
Python tracker 

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



[issue31045] Add a language switch to the Python documentation

2017-08-07 Thread STINNER Victor

STINNER Victor added the comment:


New changeset dff9b5f9d62aa0b23f8a255867d09d11890efd1b by Victor Stinner 
(Julien) in branch 'master':
bpo-31045: Language switch (#2652)
https://github.com/python/cpython/commit/dff9b5f9d62aa0b23f8a255867d09d11890efd1b


--
nosy: +haypo

___
Python tracker 

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



[issue31106] os.posix_fallocate() generate exception with errno 0

2017-08-07 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Adding Larry who is listed as posix expert.

--
nosy: +Mariatta, larry
stage:  -> patch review

___
Python tracker 

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



[issue13487] inspect.getmodule fails when module imports change sys.modules

2017-08-07 Thread Patrik Simons

Patrik Simons added the comment:

list(sys.modules.items()) still raises RuntimeError: dictionary changed size 
during iteration when another thread imports a module.

I would assume dict.copy() is thread-safe so a working fix could use 
sys.modules.copy().items()

I hit this bug when printing the name of the caller function using
inspect.stack(). The workaround in this case is calling 
inspect.stack(context=0).

--
nosy: +psimons

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-08-07 Thread Larry Hastings

Larry Hastings added the comment:

It seems this change broke the 3.5 build on AMD FreeBSD:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.5

On the 3.5 branch, the previous revision 
(19b2890014d3098147d16475c492a47a43893768) built and tested successfully on 
July 26.  But once this revision (f9fbed19a964e55ee703005823d8a7408f83d7f4) was 
checked in on July 27 the build started failing.

I haven't included this fix in 3.5.4.  Please fix the buildbot and it'll go 
into 3.5.5.

--
nosy: +larry

___
Python tracker 

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



  1   2   >