[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> We report all sorts of things found by the bytecode compiler as SyntaxError.

Except of these which are reported with IndentationError or its subclass 
TabError.

--

___
Python tracker 

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



[issue34488] improve performance of BytesIO.writelines() by avoiding creation of unused PyLongs

2019-08-05 Thread Inada Naoki


Change by Inada Naoki :


--
components: +IO -Extension Modules
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue21261] Teach IDLE to Autocomplete dictionary keys

2019-08-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for going through the history of this issue.  It was surprisingly 
convoluted.  I still hope this feature comes to fruition.

--

___
Python tracker 

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



[issue37770] implement __reversed__ on reversed types

2019-08-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Happy to post a pull request if it would be considered.

I don't we should do this.  Mostly, it seems pointless, but it also isn't 
really something we would want people to be doing.

> Should that give [1, 2, 3] or [1, 2, 3, 4]? I think that
> either answer will annoy and surprise some people.

Right.  I don't think we should open this can of worms.

Thank for you the suggestion, but we should decline this one unless a 
compelling use case arises.

--
nosy: +rhettinger
resolution:  -> rejected
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



[issue25172] Unix-only crypt should not be present on Windows.

2019-08-05 Thread Srinivas Nyayapati


Srinivas Nyayapati  added the comment:

Hello
I would like to work on this issue. First time contributor here. Would putting 
the import _crypt statement on line 3 in crypt.py inside a try/except block and 
checking to see if platform is windows then give an appropriate message be a 
good fix?

Thank you
-Srinivas

--
nosy: +shireenrao

___
Python tracker 

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



[issue37765] IDLE: Include keywords in __main__ autocomplete list

2019-08-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Terry, I used a similar patch. My main use case was around typing where 
normal shell autocompletes it and was curious if it was intentional. I didn't 
know that windows didn't give keywords. The keywords are short and added very 
rarely and perhaps the bigger completion list to actual usage might be low 
since no one opened this issue as Tal mentioned I am open to others feedback.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37770] implement __reversed__ on reversed types

2019-08-05 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Both 3.7 and 3.8 are in feature-freeze, so the earliest we can get this would 
be 3.9.

But before that, we have to decide on what reversing a reversed object means.

it = reversed([1, 2, 3, 4])
next(it)
list( reversed(it) )

Should that give [1, 2, 3] or [1, 2, 3, 4]? I think that either answer will 
annoy and surprise some people.

[1, 2, 3] will surprise those who expect to get the original iterable back. [1, 
2, 3, 4] will surprise those who expect reversed to operate on the current 
state of an iterator, not it's previous state.

--
nosy: +steven.daprano
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

But we don't do that with any of the other (many) errors detected by later 
passes of the compiler. Those report dozens of SyntaxErrors, with good 
descriptive messages. Users can search the web for those messages too.

Also, I doubt that many people will ever get a TargetScopeError. The examples 
are all esoteric -- yes, the compiler needs to reject them, but no, they are 
not things one is likely to try intentionally. (The exception may be the 
forbidden form you're adding, [... for ... in (i := ...)].)

--

___
Python tracker 

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



[issue37771] No equivalent of `inspect.getcoroutinestate` for PyAsyncGenASend instances

2019-08-05 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +yselivanov

___
Python tracker 

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



[issue37771] No equivalent of `inspect.getcoroutinestate` for PyAsyncGenASend instances

2019-08-05 Thread GeeVye


New submission from GeeVye :

In PEP 525, async generators were introduced. They use `.asend()` and 
`.athrow()` methods that return a "coroutine-like" object - specifically, a 
PyAsyncGenASend and PyAsyncGenAThrow respectively.

While these "coroutine-like" object implement `.send()`, `.throw()`, and 
`.close()`, they don't provide any attributes like normal coroutine objects do 
such as `cr_running` or `cr_await`.

When I use `inspect.getcoroutinestate()`, it raises an AttributeError on how 
there isn't a `cr_running` attribute / flag.

There is a workaround I use which is to wrap it with another coroutine as below:

>>> async def async_generator():
... yield
...
>>> async def wrap_coro(coro):
... return await coro
>>> agen = async_generator()
>>> asend = wrap_coro(agen.asend(None))

This seems like something that should be changed to make it more inline with 
normal coroutines / awaitables.

--
components: Demos and Tools
messages: 349093
nosy: GeeVye
priority: normal
severity: normal
status: open
title: No equivalent of `inspect.getcoroutinestate` for PyAsyncGenASend 
instances
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-05 Thread Nick Coghlan


Nick Coghlan  added the comment:

I believe our main motivation for separating it out was the fact that even 
though TargetScopeError is a compile-time error, the affected code is 
syntactically fine - there are just issues with unambiguously inferring the 
intended read/write location for the affected target names. (Subclassing 
SyntaxError is then a pragmatic concession to the fact that "SyntaxError" also 
de facto means "CompilationError")

Searching for "Python TargetScopeError" will also get folks to relevant 
information far more quickly than searching for "Python SyntaxError" will.

Pre-seeding Stack Overflow with an answer to "What does TargetScopeError mean 
in Python?" would probably be a good idea though (similar to what I did for 
https://stackoverflow.com/questions/25445439/what-does-syntaxerror-missing-parentheses-in-call-to-print-mean-in-python
 )

--

___
Python tracker 

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



[issue21261] Teach IDLE to Autocomplete dictionary keys

2019-08-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The history is confusing. bpo user Louie Lu (louielu), as github user 'noname 
louisom', open PR 1511 for this existing issue on 2017 May 9.  On May 12, he 
opened #30348 and PR 1512 with the tests for fetch_completions and get_entity 
that were part of PR 1511.  (This was a needed separation.)

By June, he had switched to a new github name 'Louie Lu mlouielu'.  On June 12, 
he opened #30632 and PR 2124, which duplicated #30348 and PR 1512 (which partly 
duplicated PR 1511).  On June 15, he closed PR 1511 to 'migrate' it to pr 2209. 
 But the latter only included the tests also in PR 1512, which it replaced on 
#30348, and PR 2124.  He also closed #1512.  Loiue moved on to other projects 
in Fall, 2017.

After revisions, I merged PR 2209 for #30348 last March.  I followed up with 
#36419, PR 15121, now merged. I just opened #37766 to finish preparing 
autocomplete for new additions such as this.  I was thinking of this issue when 
I included adding an htest.  (Note: #27609 is the master issue for completions.)

Notes for migrating the dict keys code:
1. In PR 15121, I shrank mode names to ATTRS and FILES.  The new mode name 
should be KEYS, or maybe SKEYS (for string keys).  Other refactors should not 
affect KEYS too much.
2. I intend to change 'smalll' and 'bigl' to 'small' and 'big' and might make 
other changes to fetch_completions.
3. I intend to split test_fetch_completions into separate methods for each 
mode. The new KEYS tests should be a separate method 'test_fetch_keys'.

The questions of function calls in the entity expression is more nuanced than I 
know when I wrote msg293520.  For force-open-completions, control-space, 
function calls are allowed.  But I do not think that this affects the new mode.

--
assignee:  -> terry.reedy

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2019-08-05 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> Why is the code in `Lib/importlib/metadata/__init__.py`

Mainly because originally, the code was in multiple modules. I'm happy for it 
to move into a single file module.

--

___
Python tracker 

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



[issue2889] curses for windows (alternative patch)

2019-08-05 Thread Ulf Magnusson


Ulf Magnusson  added the comment:

Just as an FYI, there is a repository for building curses wheels for Windows at 
https://github.com/zephyrproject-rtos/windows-curses, based on patches from 
here and Gohlke's work.

Building wheels is less straightforward than it used to be, e.g. due to term.h 
disappearing from PDCurses.

We also make wheels available on PyPI.

--
nosy: +ulfalizer

___
Python tracker 

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



[issue37770] implement __reversed__ on reversed types

2019-08-05 Thread Jason Curtis


Change by Jason Curtis :


--
title: reversed class should implement __reversed__ -> implement __reversed__ 
on reversed types

___
Python tracker 

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



[issue37770] reversed class should implement __reversed__

2019-08-05 Thread Jason Curtis


Jason Curtis  added the comment:

Ok, not so sure about the PR now; I dug around and realized this is a C 
implementation and my C is likely not strong enough!

--

___
Python tracker 

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



[issue37769] Windows Store installer should warn user about MAX_PATH

2019-08-05 Thread Eryk Sun


Eryk Sun  added the comment:

> I think this only happens with open(). 

Well, and everything else that calls a CRT function and relies on errno, such 
as C read() and write(). Though we'd have to look through on a case-by-case 
basis to ensure that _doserrno is valid in each case, i.e. that errno was set 
based on a Windows error code.

--

___
Python tracker 

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



[issue37769] Windows Store installer should warn user about MAX_PATH

2019-08-05 Thread Eryk Sun


Eryk Sun  added the comment:

> First it seems the error is being raised incorrectly - winerror 2 is 
> for file not found, but it's being passed as errno 2. 

I think this only happens with open(). The _io module could use the CRT's 
_doserrno value to call PyErr_SetExcFromWindowsErrWithFilenameObject. We can 
rely on _doserrno if _wopen fails.

Otherwise this is the expected mapping from Windows ERROR_PATH_NOT_FOUND (3) or 
ERROR_FILENAME_EXCED_RANGE (206) to POSIX ENOENT (2). The Windows error in the 
case of path that's too long is not ERROR_FILE_NOT_FOUND (2).

--
nosy: +eryksun

___
Python tracker 

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



[issue37770] reversed class should implement __reversed__

2019-08-05 Thread Jason Curtis


New submission from Jason Curtis :

I've just been trying to implement some logic which potentially involves 
reversing things back to their initial orders, and it'd be nice to just be able 
to call reversed() on something that has already been reversed.

>>> reversed(reversed([1,2,3,4]))
TypeError: 'list_reverseiterator' object is not reversible

Seems like this should be trivial to implement by just returning the initial 
iterator.

Happy to post a pull request if it would be considered.

--
components: Library (Lib)
messages: 349085
nosy: jason.curtis
priority: normal
severity: normal
status: open
title: reversed class should implement __reversed__
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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

[Barry]
> I know the PEP defines TargetScopeError as a subclass of SyntaxError, but it 
> doesn't really explain why a subclass is necessary.  I think seeing 
> "TargetScopeError" will be a head scratcher.  Why not just SyntaxError 
> without introducing a new exception?

Hm, that's not a bad point. We report all sorts of things found by the bytecode 
compiler as SyntaxError.

OTOH This would require a PEP change, formal review, etc. (IMO much more so 
than adding the new edge case that Nick and Damien discovered.) Maybe the best 
way of doing this would be to implement TargetScopeError now, then start the 
debate about killing it, and try to get that in before beta4?

--

___
Python tracker 

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



[issue37769] Windows Store installer should warn user about MAX_PATH

2019-08-05 Thread Steve Dower


Steve Dower  added the comment:

Short of adding a popup into Python itself the first time you run it (and would 
that include if you run "pip" first?), we don't have any ability to extend the 
installer.

We could reduce the "local-packages/Python37/site-packages" part of the path by 
implementing an alternative way (in both Python and pip, presumably) to specify 
the user's site packages. Right now, the best I can do is reduce 
"local-packages" down to a single character (in PC/python_uwp.cpp ) - the rest 
is forcibly added by the shared part of the runtime.

Since pip is likely to be the first place users hit this, it might be easiest 
to start by adding a more descriptive error message. Copying from the other bug:

pip3 install 
https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl
fails with an error message:

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such 
file or directory: 
'C:\\Users\\[username]\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\caffe2\\python\\serialized_test\\data\\operator_test\\collect_and_distribute_fpn_rpn_proposals_op_test.test_collect_and_dist.zip'

First it seems the error is being raised incorrectly - winerror 2 is for file 
not found, but it's being passed as errno 2. But otherwise it should be 
possible to detect this case, see that the path is too long on Windows and 
point users at 
https://docs.python.org/3/using/windows.html#removing-the-max-path-limitation

--
nosy: +Marcus.Smith, dstufft, ncoghlan, pradyunsg

___
Python tracker 

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



[issue37759] Polish whatsnew for 3.8

2019-08-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 26f91db5ba487033994b396011518cfc80bf8401 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-37759:  First round of major edits to Whatsnew 3.8 (GH-15127) (GH-15139)
https://github.com/python/cpython/commit/26f91db5ba487033994b396011518cfc80bf8401


--

___
Python tracker 

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



[issue37415] Error build Python with Intel compiler: doesn't provide atomic_uintptr_t

2019-08-05 Thread Christian Berger


Christian Berger  added the comment:

I have the same problem on RH6 with icc 2019.4 and Python 3.6.9. Do you want a 
new bug for that?
Changing Include/pyatomic.h to use _Atomic as suggested by Victor in msg346785 
leads to the error that _Atomic was undefined.

--
nosy: +cberger

___
Python tracker 

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



[issue37706] IDLE: fix sidebar click-drag bug and macOS test failures

2019-08-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I remembered this morning that we need to check test_tkk_guionly or (easier, 
but less obviously also all gui) test_tk either in test suite output, or run by 
itself with
  python -m test.test_tk  # or test -ugui test_tk
because idle it has non-gui tests that always run. From a random Azure Mac 
output:
  test_ttk_guionly skipped -- cannot run without OS X gui process
whereas Azure Ubuntu gives
  [201/419] test_ttk_guionly passed
and ditto for test_tk.  Also, "test_tix test_tk test_ttk_guionly" under 'tests 
skipped'.

The skips for the only current Mac buildbot I found,
https://buildbot.python.org/all/#/workers/20,
Matt Billenstein  High Sierra 10.13.6,
also include "test_tix test_tk test_ttk_guionly"

Perhaps you can ask him if his machine is suitable for adding gui tests and 
offer to help.

Tal, when you can build on Mac, are you making framework builds?  Does test_tk 
run?

--

___
Python tracker 

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



[issue37769] Windows Store installer should warn user about MAX_PATH

2019-08-05 Thread Jonas Binding


New submission from Jonas Binding :

The "Windows Store" installer for Python has a seemingly low entry barrier, 
causing people to install without reading something like 
https://docs.python.org/3.7/using/windows.html. 

However, due to the really long path it uses for Python (e.g. 
C:\Users\USERNAME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\),
 the chances of running into issues with paths longer than 260 characters are 
really high. 

For example installing pytorch already fails due to this limitation, see 
https://github.com/pytorch/pytorch/issues/23823 and 
https://www.reddit.com/r/pytorch/comments/c6cllq/issue_installing_pytorch/

Therefore, the Windows Store installer should offer to change the registry key 
to enable longer paths, or at least show a message to this effect.

--
components: Windows
messages: 349079
nosy: Jonas Binding, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows Store installer should warn user about MAX_PATH
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



[issue21261] Teach IDLE to Autocomplete dictionary keys

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

I had no idea that this was desired... I had this working in a old version of 
autocomplete back before 2010!  I'm not sure whether I'll be able to find it 
though.

I can't understand why Louie's PR was closed, it seemed to be going in the 
right direction... Any explanation?

--
nosy: +taleinat
versions: +Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue37706] IDLE: fix sidebar click-drag bug and macOS test failures

2019-08-05 Thread Ned Deily


Ned Deily  added the comment:

Terry, using an out-of-date version of Tcl/Tk is the least of the problems 
here.  My point was that, the way things are now, IDLE GUI tests are not being 
run at all on macOS Azure CI runs regardless of the Tk version in use and, 
AFAIK, there is no easy way to tell that from the default output from the 
tests.  The particular test failures reported here *do* fail when properly 
configured to actually run using the Apple-supplied Tk 8.5.9 (in fact, with the 
latest fixes to the tests, all of test_idle passes with Tk 8.5.9).  And I'm 
guessing that most times when you or Tal or other developers are running the 
tests from your own local builds, you aren't aware that the GUI tests are being 
skipped.

There is a long-standing issue with Aqua Tk on macOS that, if a process tries 
to call Tk to draw objects on a screen but the process is not running under a 
username that is logged in through the normal macOS GUI (i.e. does not have a 
macOS Finder window, does not have a macOS "console"), Tk will segfault 
crashing Python along with it, which is very bad when running tests.  There 
have been various issues about this going back a long time (see, for example, 
Issue22770 but there are older ones).  To avoid those segfaults, we take a 
conservative approach in test.support._is_gui_available()  
(Lib/test/support/__init__.py) which is effectively (I believe) only allows GUI 
tests on macOS to run if they are being run under an application bundle which 
effectively means the Python under test must be a framework build (./configure 
... --enable-framework=... ...).  I believe that test is overly stringent but 
we haven't up to now found a reliable way to test and prevent the segfaults 
without depen
 ding on the framework approach.

So (1) if you don't build Python with an --enable-framework= option, Tk and 
IDLE GUI tests are not going to be run.

(2) If the GUI tests are skipped, there is no indication of this in the default 
log output.  You only see this if you run, for example, with the regrtest -v 
(verbose) option:

$ ./python.exe -m test -uall -j2 test_idle
Run tests in parallel using 2 child processes
0:00:01 load avg: 2.56 [1/1] test_idle passed

== Tests result: SUCCESS ==

1 test OK.

Total duration: 1 sec 753 ms
Tests result: SUCCESS

$ ./python.exe -m test -v -uall -j2 test_idle
[...]
Run tests in parallel using 2 child processes
0:00:01 load avg: 2.22 [1/1] test_idle passed
skipped 'cannot run without OS X gui process'
skipped 'cannot run without OS X gui process'
skipped 'cannot run without OS X gui process'
test_geticonname (idlelib.idle_test.test_browser.ChildBrowserTreeItemTest) ... 
ok
test_getsublist (idlelib.idle_test.test_browser.ChildBrowserTreeItemTest) ... ok
test_gettext (idlelib.idle_test.test_browser.ChildBrowserTreeItemTest) ... ok
test_init (idlelib.idle_test.test_browser.ChildBrowserTreeItemTest) ... ok
test_isexpandable (idlelib.idle_test.test_browser.ChildBrowserTreeItemTest) ... 
ok
test_ondoubleclick (idlelib.idle_test.test_browser.ChildBrowserTreeItemTest) 
... ok
skipped 'cannot run without OS X gui process'
[...]
skipped 'cannot run without OS X gui process'
idlelib.idle_test.test_textview (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_tooltip (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_tree (unittest.loader.ModuleSkipped) ... skipped 'cannot 
run without OS X gui process'
idlelib.idle_test.test_undo (unittest.loader.ModuleSkipped) ... skipped 'cannot 
run without OS X gui process'
test_run_show (idlelib.idle_test.test_warning.RunWarnTest) ... ok
test_showwarnings (idlelib.idle_test.test_warning.RunWarnTest) ... ok
test_idle_formatter (idlelib.idle_test.test_warning.ShellWarnTest) ... ok
test_shell_show (idlelib.idle_test.test_warning.ShellWarnTest) ... ok
test_showwarnings (idlelib.idle_test.test_warning.ShellWarnTest) ... ok
skipped 'cannot run without OS X gui process'
test_init (idlelib.idle_test.test_window.WindowListTest) ... ok
skipped 'cannot run without OS X gui process'

--

Ran 257 tests in 1.001s

OK (skipped=70)

== Tests result: SUCCESS ==

1 test OK.

Total duration: 1 sec 836 ms
Tests result: SUCCESS

So there is a false sense of security that tests are being run when they aren't 
and those skipped GUI test might be failing if they were actually run as was 
the case in this issue.

Possible followup actions:

1. Have test_idle (and test_ttk_guionly?) issue a warning message by default if 
GUI tests are being skipped.

2. Investigate if it is practical to run GUI tests under Azure CI (I'm guessing 
it is not) or one of the other CI runners we use (Appveyor maybe?).  (Note I 
personally will not have time to look into this until at least the Sep dev 
sprint so it would be good for someone else to look into it).  That would also 
require 

[issue37768] IDLE: Show help(object) output in a text viewer

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

Raymond, I'm interested in your opinion on this.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37768] IDLE: Show help(object) output in a text viewer

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

See PR GH-15140.

--

___
Python tracker 

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



[issue37768] IDLE: Show help(object) output in a text viewer

2019-08-05 Thread Tal Einat


Change by Tal Einat :


--
keywords: +patch
pull_requests: +14878
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15140

___
Python tracker 

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



[issue37767] TTK Treeview alternating row color not working

2019-08-05 Thread Zachary Ware


Zachary Ware  added the comment:

That file is part of Tcl/Tk and just bundled with Python on Windows; please 
raise an issue on the Tk issue tracker (which appears to be here: 
https://core.tcl-lang.org/tk/ticket).  If and when the change is released in a 
new version of Tcl/Tk, please feel free to open a new issue here requesting 
that we update to that version.

--
nosy: +zach.ware
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue37768] IDLE: Show help(object) output in a text viewer

2019-08-05 Thread Tal Einat


New submission from Tal Einat :

Currently, IDLE just writes the entire help message into the shell.

If auto-squeezing is enabled, then long help messages are automatically 
squeezed, following which the help text can be viewed in a text viewer or 
expanded inline.  This is still not great UX.

I propose to simply have help(object) open a text viewer with the help text.  
There's actually an old (2007) comment in Lib\idlelib\pyshell.py by KBK that 
this should be done.

See related discussion in issue #35855.

--
assignee: taleinat
components: IDLE
messages: 349073
nosy: taleinat, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: Show help(object) output in a text viewer
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue35855] IDLE squeezer: improve unsqueezing and autosqueeze default

2019-08-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I presume you are proposing to wrap the site-added help with a function that 
would check object outputs and put them either in the shell unsqueezed or 
directly into a viewer.  Seems plausible.

--

___
Python tracker 

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



[issue37767] TTK Treeview alternating row color not working

2019-08-05 Thread Christopher Caputo


New submission from Christopher Caputo :

The default installation of Python3.7 on all my Win10 machines has a ttk theme 
file that disables treeview alternating row colors. The specific file for me is 
"vistaTheme.tcl" located at "C:\Program Files\Python37\tcl\tk8.6\ttk". In the 
#Treeview section of the file the "ttk::style map Treeview" line needed to be 
changed from:

ttk::style map Treeview \
-background [list disabled $colors(-frame)\
{!disabled !selected} $colors(-window) \
selected SystemHighlight] \
-foreground [list disabled $colors(-disabledfg) \
{!disabled !selected} black \
selected SystemHighlightText]

Changed to:

ttk::style map Treeview
-background [list selected SystemHighlight]
-foreground [list selected SystemHighlightText]

Essentially all the "disabled" parts needed to be removed.

--
components: Tkinter
messages: 349071
nosy: Mookiefer
priority: normal
severity: normal
status: open
title: TTK Treeview alternating row color not working
type: behavior
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



[issue27609] IDLE completions: format, factor, and fix

2019-08-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#37765 Include keywords in ''(__main__) list.

## Annotate completion list, at least as an option, with 'keyword' or 
class, possibly prefixed with 'built-in', so 'built-in function', 'function', 
and so on.

#37766 revise fetch_completions, add htest

--
dependencies: +IDLE autocomplete: revise fetch_completions, add htest, IDLE: 
Include keywords in __main__ autocomplete list

___
Python tracker 

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



[issue37766] IDLE autocomplete: revise fetch_completions, add htest

2019-08-05 Thread Terry J. Reedy


New submission from Terry J. Reedy :

#36419 did not cover fetch_ completions.  Most of the remaining 7% of 
autocomplete not covered by tests is in that function.  I want to rename smalll 
to small and bigl to big (and in test file); they are awkward to read and 
write.  I may want to revise otherwise to aid testing.

The test line referencing #36405 fails when run in autocomplete itself.  I need 
to refresh myself as to why I added it and revise or delete.

Some of the test_fetch_completion needs revision, and it should be split before 
being augmented.

An htest would make manual testing of intended behavior changes easier.

--
assignee: terry.reedy
components: IDLE
messages: 349069
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE autocomplete: revise fetch_completions, add htest
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37759] Polish whatsnew for 3.8

2019-08-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14877
pull_request: https://github.com/python/cpython/pull/15139

___
Python tracker 

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



[issue37759] Polish whatsnew for 3.8

2019-08-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 4f9ffc9d1a6a293563def4a13331302219b4 by Raymond Hettinger in 
branch 'master':
bpo-37759:  First round of major edits to Whatsnew 3.8 (GH-15127)
https://github.com/python/cpython/commit/4f9ffc9d1a6a293563def4a13331302219b4


--

___
Python tracker 

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



[issue37765] IDLE: Include keywords in __main__ autocomplete list

2019-08-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +14876
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/15138

___
Python tracker 

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



[issue37765] IDLE: Include keywords in __main__ autocomplete list

2019-08-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

If keywords are included when the REPL has tab completions (which Windows 
doesn't), then it is plausible that IDLE should.  It could be considered part 
of 'Shell should (mostly) imitate REPL'.  But I can see Tal's point, though the 
relative expansion is pretty small.  And there is nothing on the master 
completions issue #27609 where I collected known not-yet-rejected suggestions 
and ideas.

The implementation is trivial.  Add two new lines to autocomplete.py.  So you 
can easily patch a private copy.  I am preparing a minimal PR.

import keyword  # add
...
def fetch_completions(self, what, mode):
...
bigl = eval("dir()", namespace)
bigl.extend(keyword.kwlist)  # add
bigl.sort()

True, False, and None are also in builtins, so cannot serve as a test.
---

A separate idea: annotate completion list, at least as an option, with 
'keyword' or class, possibly prefixed with 'built-in', so 'built-in function', 
'function', and so on.

--
nosy:  -rhettinger
stage:  -> test needed
title: Include keywords in autocomplete list for IDLE -> IDLE: Include keywords 
in __main__ autocomplete list
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue35855] IDLE squeezer: improve unsqueezing and autosqueeze default

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

Regarding help(), there's actually a comment in IDLE's code by KBK that it 
should be opened in a reader (this was before TextViewer was added).  IMO 
that's a much better approach for long help() outputs, and is simple to 
implement.

--

___
Python tracker 

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



[issue37765] Include keywords in autocomplete list for IDLE

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

To be clear, I'm currently -1 on this suggestion.

--

___
Python tracker 

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



[issue37765] Include keywords in autocomplete list for IDLE

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

The global completion list (i.e. when not completing a file name or object 
attribute) is already full of all the built-ins, imported modules and 
variables.  So IMO we'd need a good reason to add yet more options into the 
completions list.

Personally, I don't think that adding all of the keywords to that list would be 
helpful: They are all short words and most of them must be memorized anyways to 
work with Python.

For instance, I don't recall this being brought up by those who often teach 
newcomers with IDLE, such as Raymond Hettinger, when discussing what's missing 
in IDLE. I'd be happy to get more input from them on this.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2019-08-05 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

@jaraco - Why is the code in `Lib/importlib/metadata/__init__.py` instead of 
`Lib/importlib/metadata.py`?  Is that to make it easier to port between CPython 
stdlib and the standalone version?

--

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2019-08-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Including a module directive with synopsis as below in importlib.metadata.rst 
seems to fix this. It would also be good to include a link to source code from 
the importlib.metadata docs page since it's written in Python.

.. module:: importlib.metadata
   :synopsis: The implementation of the importlib metadata.

**Source code:** :source:`Lib/importlib/metadata/__init__.py`

--
nosy: +xtreak

___
Python tracker 

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



[issue37765] Include keywords in autocomplete list for IDLE

2019-08-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +taleinat

___
Python tracker 

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



[issue37765] Include keywords in autocomplete list for IDLE

2019-08-05 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Currently, the basic repl for python provides keywords as part of 
autocompletion but IDLE doesn't provide them. I was trying to build an async 
repl on top of IDLE to support top level await statements as part of IDLE since 
"python -m asyncio" doesn't provide a good repl and found during usage keywords 
like async/await being part of autocomplete to provide a good experience like 
the basic repl to type faster. I couldn't find any old issues with search 
around why keywords were excluded so I thought of filing a new one for this 
suggestion.

--
assignee: terry.reedy
components: IDLE
messages: 349061
nosy: terry.reedy, xtreak
priority: normal
severity: normal
status: open
title: Include keywords in autocomplete list for IDLE
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2019-08-05 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

There's an importlib.metadata.rst file which describes how to use the API, but 
that doesn't appear to be linked from either the main library ToC or the 
importlib documentation itself.  I'll see if I can put together a PR to fix 
this.

--
assignee: docs@python -> barry

___
Python tracker 

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



[issue37762] IDLE very slow due a super long line output in chunks

2019-08-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

One may copy and paste small chunks of code and output into a message. By 'demo 
script', I presume you mean the following.

import tensorflow as tf
mnist = tf.keras.datasets.mnist

(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

model = tf.keras.models.Sequential([
  tf.keras.layers.Flatten(input_shape=(28, 28)),
  tf.keras.layers.Dense(512, activation=tf.nn.relu),
  tf.keras.layers.Dropout(0.2),
  tf.keras.layers.Dense(10, activation=tf.nn.softmax)
])
model.compile(optimizer='adam',
  loss='sparse_categorical_crossentropy',
  metrics=['accuracy'])

model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)

The boxes represent characters that cannot be displayed in the tk Text widget 
with the current font.  They represent whatever is printed in the standard 
shell, which you call 'normal', which implies that they are not control chars.  
Since the length of the box run is 1 less than the length of the visible data, 
my guess is that the intended format is alternating lines something like
 9696/6 acc: 0.8691
==
except that the line separators are some non-ascii char.  (Note that the 
sequence of [] substitutes in one less than the sequence of printable ascii, 
which would make it impossible to set the shell width so that wrapped chunks 
line up.)

The problem is the absence of '\n' newlines, which I consider a bug in keras. 
The result is one line that grows in chunks to some humongous length.  This is 
eventually deadly to tk Text widgets.  The symptom is that chunks are added 
quickly at first, then more slowly, then to a crawl, and maybe a stop.  Here is 
a short test.

from __future__ import print_function  # To run with 2.7.
for i in range(10):
print('%6s' % i, end='')

On my Win10 machine with 3.8.0b3 and tk 8.6.9 (see Help => About IDLE for the 
latter), slow down is evident after 1 chars (200 chunks) and crawling by 
4 chars.  It might be worse on Linux and Mac.

I added a note about auto-squeezing the long lines in chunks case to #35855.  I 
expect to close this as 3rd party, or as a duplicate of #1442493.

--
title: IDLE very slow due to special characters -> IDLE very slow due a super 
long line output in chunks

___
Python tracker 

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



[issue35855] IDLE squeezer: improve unsqueezing and autosqueeze default

2019-08-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

A4: Autosqueeze long lines output in chunks.  tensorflow.keras appears to do 
this.  See #37762.  Easy reproducer:

for i in range(1):
print('%6s' % i, end='')

--

___
Python tracker 

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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-05 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

I know the PEP defines TargetScopeError as a subclass of SyntaxError, but it 
doesn't really explain why a subclass is necessary.  I think seeing 
"TargetScopeError" will be a head scratcher.  Why not just SyntaxError without 
introducing a new exception?

--
nosy: +barry

___
Python tracker 

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



[issue37706] IDLE: fix sidebar click-drag bug and macOS test failures

2019-08-05 Thread Steve Dower


Steve Dower  added the comment:

All I can add is these are the steps: 
https://github.com/python/cpython/blob/master/.azure-pipelines/macos-steps.yml

The Linux steps use xvfb, but the macOS steps do not. And we don't do anything 
at all to install Tcl/Tk on the build agent.

--

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-05 Thread Ned Deily


Change by Ned Deily :


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue37722] imaplib crashes when trying to read a letter from an imap server imaps.почта.рус

2019-08-05 Thread My Tran


Change by My Tran :


--
components: +email -Library (Lib)
nosy: +barry, r.david.murray

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-08-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +maxking

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-08-05 Thread My Tran


New submission from My Tran :

The following will hang the system until it runs out of memory. 

import email
import email.policy

text = """From: u...@host.com
To: u...@host.com
Bad-Header:
 =?us-ascii?Q?LCSwrV11+IB0rSbSker+M9vWR7wEDSuGqmHD89Gt=ea0nJFSaiz4vX3XMJPT4vrE?=
 =?us-ascii?Q?xGUZeOnp0o22pLBB7CYLH74Js=wOlK6Tfru2U47qR?=
 =?us-ascii?Q?72OfyEY2p2=2FrA9xNFyvH+fBTCmazxwzF8nGkK6D?=

Hello!
"""

eml = email.message_from_string(text, policy=email.policy.SMTPUTF8)
eml.as_string()

--
components: email
messages: 349055
nosy: barry, mytran, r.david.murray
priority: normal
severity: normal
status: open
title: email.Message.as_string infinite loop
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



[issue37763] Need setup.py to pick up -isystem flags from CPPFLAGS

2019-08-05 Thread Johan Herland


Change by Johan Herland :


--
keywords: +patch
pull_requests: +14874
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15136

___
Python tracker 

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



[issue37763] Need setup.py to pick up -isystem flags from CPPFLAGS

2019-08-05 Thread Johan Herland


New submission from Johan Herland :

First time contributor here, still learning the ropes.

We're cross-compiling python in an environment where we set up CPPFLAGS, 
LDFLAGS, etc. to point directly to the locations where we have built Python's 
dependencies. For example, we will typically build Python in an environment 
that includes:

  CPPFLAGS=\
-isystem /path/to/ncurses/build/include \
-isystem /path/to/libffi/build/include \
-isystem /path/to/zlib/build/include \
-isystem /path/to/openssl/build/include \
-isystem /path/to/readline/build/include
  
  LDFLAGS=\
-L/path/to/ncurses/build/lib \
-L/path/to/libffi/build/lib \
-L/path/to/zlib/build/lib \
-L/path/to/openssl/build/lib \
-L/path/to/ciscossl-fom/build/lib \
-L/path/to/readline/build/lib

setup.py already picks up our -L options from LDFLAGS and propagates them into 
the build commands, but the -isystem options from CPPFLAGS are currently 
ignored.

I will post a PR that teaches setup.py to handle -isystem options in CPPFLAGS 
the same way it currently handles -I options.

--
components: Cross-Build
messages: 349054
nosy: Alex.Willmer, jherland
priority: normal
severity: normal
status: open
title: Need setup.py to pick up -isystem flags from CPPFLAGS
type: enhancement
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue35545] asyncio.base_events.create_connection doesn't handle scoped IPv6 addresses

2019-08-05 Thread Michael Felt


Michael Felt  added the comment:

I did not ask back in June - but could this also be backported to 3.7. I am 
trying very hard to have all tests also passing on 3.7. as @asvetlov is ok with 
a skipped test for AIX - see https://bugs.python.org/issue35545#msg344003

I can make the backport, if needed.

--

___
Python tracker 

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



[issue33997] multiprocessing Pool hangs in terminate()

2019-08-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Removed Python 3.6 as it is in security fixes now.

--
versions: +Python 3.8, Python 3.9 -Python 3.6
Added file: https://bugs.python.org/file48532/test_multiprocessing.py

___
Python tracker 

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



[issue33997] multiprocessing Pool hangs in terminate()

2019-08-05 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
components: +Library (Lib) -Windows

___
Python tracker 

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



[issue33997] multiprocessing Pool hangs in terminate()

2019-08-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi, I got bit by this bug last week, I wrote an example that reproduce the 
basic idea of our program main loop and it hangs

 - around 20% of the time with a release build of Python 3.7.4
 - around 6% of the time with a debug build of Python 3.7, 3.8 and 3.9

With some of our inputs, it hangs nearly all the time but I cannot post them 
here.

I tested PR 8009 and it solves the issue. It seems to me that it is an 
appropriate fix for this.

--
Added file: https://bugs.python.org/file48531/multiprocessing_hangs.py

___
Python tracker 

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



[issue37762] IDLE very slow due to special characters

2019-08-05 Thread Bernhard Hiller


New submission from Bernhard Hiller :

After installing tensorflow, I tried to run the demo script found at 
https://www.tensorflow.org/tutorials?
In a common python shell, the "model.fit(x_train, y_train, epochs=5)" step 
takes a few minutes. In IDLE, no end is in sight after half an hour.
While the output looks normal in the common shell, IDLE shows some control 
characters (see attached screenshot).
Windows Task Managers shows a "pythonw.exe" process taking up 25% of CPU (i.e. 
1 of 4 cores).

--
assignee: terry.reedy
components: IDLE
files: Python374-3.PNG
messages: 349050
nosy: Bernie, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE very slow due to special characters
type: performance
versions: Python 3.7
Added file: https://bugs.python.org/file48530/Python374-3.PNG

___
Python tracker 

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



[issue19692] Rename Py_SAFE_DOWNCAST

2019-08-05 Thread hai shi


hai shi  added the comment:

It's a big problem, no ability to answer this question :(

--

___
Python tracker 

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



[issue33829] C API: provide new object protocol helper

2019-08-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue33829] C API: provide new object protocol helper

2019-08-05 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

I agree with rejecting and closing this issue.

--
nosy: +jdemeyer

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in some files

2019-08-05 Thread Jordon.X


Jordon.X <9651...@qq.com> added the comment:

After the full search for the project code, there are more than a dozen similar 
issues that need to be modified. A new PR will be added later.

--
title: Redundant Py_CHARMASK called in normalizestring(codecs.c) -> Redundant 
Py_CHARMASK called in some files

___
Python tracker 

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



[issue37562] PEP 590 implementation may have introduced a performance regression

2019-08-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue36974] Implement PEP 590

2019-08-05 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Should we add a note like "if you get a 'SystemError: bad call flags' on 
> import, check the descriptor flags of your functions" in What's New in Python 
> 3.8?

A better solution would be to change the error message. We could change it to 
something like SystemError("bad flags 0x2 for PyCOMPS_categories_match")

But maybe it's not worth it. Are there many projects that define 
functions/methods but never call them?

--

___
Python tracker 

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



[issue37562] PEP 590 implementation may have introduced a performance regression

2019-08-05 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Please close

--

___
Python tracker 

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



[issue36757] uuid constructor accept invalid strings (extra dash)

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

I too find this surprising, especially given how thoroughly UUID validates 
inputs of types other than "hex".

The documentation simply states that for hex input, hypens, curly braces and a 
URN prefix are optional.  In practice, though, it is much more lenient than 
that, as described here.

Since the UUID has no expert listed, we'll have to decide whether to make the 
input validation stricter and break backwards-compatibility, or simply make the 
docs clearer.  Clarifying the docs certainly seems simpler, safer and more 
user-friendly.  It also seems reasonable, given that this issue apparently 
hasn't affected many users.

--
nosy: +taleinat
type:  -> behavior
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue36767] Segmentation fault when running c extension on macOS

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

I'm closing this: It has had no followup in over 3 months, and seems to be a 
simple misuse of the C API rather than a bug.

--
nosy: +taleinat
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue37587] JSON loads performance improvement for long strings

2019-08-05 Thread Inada Naoki


Inada Naoki  added the comment:

And I confirmed performance improvement by my patch (GH-15134) on all of 4 
compilers.

$ ./python -m pyperf timeit  -s "import json; x = json.dumps({'k': '1' * 2 ** 
20})" "json.loads(x)"

old:  9211e2
new:  8a758f
opt2: 284e47

gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0

old:  Mean +- std dev: 721 us +- 0 us
new:  Mean +- std dev: 722 us +- 0 us
opt2: Mean +- std dev: 715 us +- 1 us


gcc-7 (Ubuntu 7.4.0-8ubuntu1) 7.4.0

old:  Mean +- std dev: 1.03 ms +- 0.00 ms
new:  Mean +- std dev: 726 us +- 0 us
opt2: Mean +- std dev: 715 us +- 0 us


clang version 7.0.1-8 (tags/RELEASE_701/final)

old:  Mean +- std dev: 721 us +- 1 us
new:  Mean +- std dev: 722 us +- 0 us
opt2: Mean +- std dev: 715 us +- 1 us


clang version 8.0.0-3 (tags/RELEASE_800/final)

old:  Mean +- std dev: 721 us +- 0 us
new:  Mean +- std dev: 721 us +- 1 us
opt2: Mean +- std dev: 715 us +- 0 us

--

___
Python tracker 

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



[issue37587] JSON loads performance improvement for long strings

2019-08-05 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +14873
pull_request: https://github.com/python/cpython/pull/15134

___
Python tracker 

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



[issue36756] tkinter tk.createcommand memory leak

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

Tkinter calls Tcl_DeleteInterp when a Tk object is garbage collected, and it 
registers a cleanup callback for each registered command, which according to 
the Tcl docs should be called upon Tcl_DeleteInterp[1]. So this must either be 
a bug in Tcl or something in the circumstances isn't giving it a chance to 
clean up the commands.

It's worth noting that Tk.destroy() calls Misc.destroy() which explicitly calls 
deletecommand for all registered commands. So calling .destroy() when done with 
a Tk instance, which is good practice in general, will also avoid this issue.

Considering the above, I'm not sure this is worth investigating and 
addressing...

A simple solution could be to add __del__ to Tk or Misc and have that also 
clean up any registered commands.

--
nosy: +taleinat

___
Python tracker 

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



[issue37587] JSON loads performance improvement for long strings

2019-08-05 Thread Inada Naoki


Inada Naoki  added the comment:

I tried without PGO and confirmed performance improved on GCC 7.2.0.
No change on other compiler versions.


$ ./python -m pyperf timeit  -s "import json; x = json.dumps({'k': '1' * 2 ** 
20})" "json.loads(x)"

old: 9211e2
new: 8a758f

gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0

old: Mean +- std dev: 721 us +- 0 us
new: Mean +- std dev: 722 us +- 0 us


gcc-7 (Ubuntu 7.4.0-8ubuntu1) 7.4.0

old: Mean +- std dev: 1.03 ms +- 0.00 ms
new: Mean +- std dev: 726 us +- 0 us


clang version 7.0.1-8 (tags/RELEASE_701/final)

old: Mean +- std dev: 721 us +- 1 us
new: Mean +- std dev: 722 us +- 0 us


clang version 8.0.0-3 (tags/RELEASE_800/final)

old: Mean +- std dev: 721 us +- 0 us
new: Mean +- std dev: 721 us +- 1 us

--

___
Python tracker 

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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37730] NotImplemented is used instead of NotImplementedError in docs

2019-08-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution David!

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

___
Python tracker 

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



[issue37730] NotImplemented is used instead of NotImplementedError in docs

2019-08-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 35f9bccd8198330579ecb4b4c503062f8b5da130 by Serhiy Storchaka 
(David H) in branch '2.7':
[2.7] bpo-37730: Fix usage of NotImplemented instead of NotImplementedError in 
docs. (GH-15062). (GH-15133)
https://github.com/python/cpython/commit/35f9bccd8198330579ecb4b4c503062f8b5da130


--

___
Python tracker 

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



[issue37730] NotImplemented is used instead of NotImplementedError in docs

2019-08-05 Thread David Heiberg


Change by David Heiberg :


--
pull_requests: +14872
pull_request: https://github.com/python/cpython/pull/15133

___
Python tracker 

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



[issue28716] Fractions instantiation revisited

2019-08-05 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

See 
https://discuss.python.org/t/pep-3141-ratio-instead-of-numerator-denominator/2037/24?u=jdemeyer
 for a proposal to define a new dunder __ratio__ (instead of as_integer_ratio) 
for this.

--
nosy: +jdemeyer

___
Python tracker 

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



[issue12680] cPickle.loads is not thread safe due to non-thread-safe imports

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

I am able to reproduce this with Python 3.6.3 and 3.7.0, but not with 3.7.4, 
3.8.0b3 or current master (to be 3.9).

This has been fixed since 3.7.3; see issue #34572.

--
nosy: +taleinat
resolution: not a bug -> fixed
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue36773] Race condition during pickle.load()

2019-08-05 Thread Tal Einat


Tal Einat  added the comment:

On Windows 10, this reproduces consistently with 3.6 and 3.7.0, but not with 
3.7.4, 3.8.0b3 and current master. So this definitely seems to be fixed.

--
nosy: +taleinat
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



[issue35224] PEP 572: Assignment Expressions

2019-08-05 Thread Nick Coghlan


Nick Coghlan  added the comment:

Proposed PEP update is here: https://github.com/python/peps/pull/1140

The update also aims to clarify *why* we're doing the extra work in CPython's 
compiler to make these cases fail (i.e. we don't want to implicitly impose the 
current CPython runtime behaviour on other implementations)

--

___
Python tracker 

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



[issue37761] Inaccurate explanation of ArgumentParser.add_argument()'s name-or-flags in JA

2019-08-05 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-05 Thread Nick Coghlan


Nick Coghlan  added the comment:

Added a PEP update as well: https://github.com/python/peps/pull/1140

--

___
Python tracker 

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



[issue37761] Inaccurate explanation of ArgumentParser.add_argument()'s name-or-flags in JA

2019-08-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Japanese translation is tracked as part of GitHub issues at 
https://github.com/python/python-docs-ja .

--
nosy: +xtreak

___
Python tracker 

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



[issue37761] Inaccurate explanation of ArgumentParser.add_argument()'s name-or-flags in JA

2019-08-05 Thread Tatsuo Sekine

New submission from Tatsuo Sekine :

Second sentence of name-or-flags explanation of 
argparse.ArgumentParser.add_argument() in ja lang. is:

> そのため、add_argument() の第1引数は、フラグのリストか、シンプルな引数名のどちらかになります。
#[1]

while its original English is:

> The first arguments passed to add_argument() must therefore be either a 
> series of flags, or a simple argument name.
# [2]

If I translate Japanese language one back to English, it'd be something:

The first argument passed to add_argument() must therefore be either a list of 
flags, or a simple argument name.

Japanese one's explanation means, name-or-flags could be either
- "name"
- ["-f", "--flag"]

So, Japanese translation could be improved to clarify that name-of-flags (i.e. 
first argument*s*) could be either name or *series* (not list) of flags.

Note that, following sentences in the doc have many supporting explanations, 
and also, there is argparse HOWTO doc with many examples, so this is not 
critical issue at all.

[1] https://docs.python.org/ja/3/library/argparse.html#name-or-flags
[2] https://docs.python.org/3/library/argparse.html#name-or-flags

--
assignee: docs@python
components: Documentation
messages: 349031
nosy: Tatsuo Sekine, docs@python
priority: normal
severity: normal
status: open
title: Inaccurate explanation of ArgumentParser.add_argument()'s name-or-flags 
in JA
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



[issue37729] gc: stats from multi process are mixed up

2019-08-05 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue37729] gc: stats from multi process are mixed up

2019-08-05 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset e8ea34855c7635f8a84b430f17dc01a666f4c0ef by Inada Naoki (Miss 
Islington (bot)) in branch '3.8':
bpo-37729: gc: write stats at once (GH-15050)
https://github.com/python/cpython/commit/e8ea34855c7635f8a84b430f17dc01a666f4c0ef


--

___
Python tracker 

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



[issue19692] Rename Py_SAFE_DOWNCAST

2019-08-05 Thread Inada Naoki


Inada Naoki  added the comment:

While Py_SAFE_DOWNCAST is not documented, it doesn't start with underscore.
How many 3rd party code are broken by changing the name?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue37623] namedtuple integration for importlib.abc.Loader

2019-08-05 Thread Andrew Yurisich


Andrew Yurisich  added the comment:

If anyone is interested in the progress I was able to make as a result of this 
discussion, feel free to check out 
https://github.com/captain-kark/python-module-resources/blob/d85453ff4f5022127874a5842449d95bb5eda234/module_resources/module_resources.py
 and leave you feedback or comments.

--

___
Python tracker 

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