[issue28556] typing.py upgrades

2018-05-17 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
pull_requests: +6624

___
Python tracker 

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



[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-17 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Your PRs made modifications to code and did not include a useful commit message 
or appropriate NEWS entries for the code modifications.

Further, VSTS is unreliable.  core-workflow made a premature decision to turn 
off Travis and AppVeyor and make VSTS blocking.

--
nosy: +gregory.p.smith
resolution: fixed -> 
stage: resolved -> 

___
Python tracker 

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



[issue33519] Should MutableSequence provide .copy()?

2018-05-17 Thread Jelle Zijlstra

Change by Jelle Zijlstra :


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

___
Python tracker 

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



[issue33564] IDLE: add 'async' to codecontext block openers

2018-05-17 Thread Terry J. Reedy

Change by Terry J. Reedy :


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



[issue33565] strange tracemalloc results

2018-05-17 Thread Alexander Mohr

Change by Alexander Mohr :


--
type:  -> behavior

___
Python tracker 

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



[issue33565] strange tracemalloc results

2018-05-17 Thread Alexander Mohr

New submission from Alexander Mohr :

while investigating https://github.com/boto/botocore/issues/1464 I used 
tracemalloc (like I've done before in 3.5.2) to try to figure out where the 
leak was.  To my surprise tracemalloc listed stacks that didn't make any sense.


Strangest example is the top result when running the attached script against 
python 3.6.5 in the following manner: PYTHONMALLOC=malloc /valgrind/bin/python3 
/tmp/test.py head_object

The top hit is listed as:

21 memory blocks: 4.7 KiB
  File "/tmp/test.py", line 28
raise
  File "/tmp/test.py", line 47
test(s3_client)
  File "/tmp/test.py", line 65
main()

how is it that the "raise" is a leak?  It doesn't make any sense to me 
specially given that no contexts are used in that call.  Further that line is 
never hit because the exception is not re-thrown.


Further a bunch of regular expression allocs don't make any sense either given 
that I've cleared the cache before doing snapshots.

if someone could shed some light on why this is/isn't a bug that would be 
great.  It seems to me that the callstacks are not related at all to the leak.

--
components: Library (Lib)
files: tracemalloc_test.py
messages: 317002
nosy: thehesiod
priority: normal
severity: normal
status: open
title: strange tracemalloc results
versions: Python 3.6
Added file: https://bugs.python.org/file47600/tracemalloc_test.py

___
Python tracker 

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



[issue33556] leftover thread crumb in threading.ident docstring

2018-05-17 Thread Skip Montanaro

Change by Skip Montanaro :


--
keywords: +patch
pull_requests: +6622
stage: needs patch -> patch review

___
Python tracker 

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



[issue33564] IDLE: add 'async' to codecontext block openers

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset b2a02b9d88db04c12f800bc088afea0ef6862673 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.7':
bpo-33564: Add async to IDLE's code context block openers. (GH-6960) (#6961)
https://github.com/python/cpython/commit/b2a02b9d88db04c12f800bc088afea0ef6862673


--

___
Python tracker 

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



[issue33547] Relative imports do not replace local variables

2018-05-17 Thread Rolf Campbell

Rolf Campbell  added the comment:

Thanks David, I agree that my assumption that the local valiables were not 
being replaced is not really what was going on there.

I also agree that, while this might not strictly classify as a bug, it's 
probably not the most helpful/useful way that "from ." could be implemented for 
__main__. Why does it act different than in modules?

I have reproduced my original ploblem in a simplified scenario, for which I 
will raise a new bug.

Thanks

--

___
Python tracker 

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



[issue33531] test_asyncio: test_subprocess test_stdin_broken_pipe() failure on Travis CI

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The Travis retest (for 3.7 backport) just failed with the same errors.  Why 
can't we disable this tests.  It now takes hours to do a merge with two 
backports.

--

___
Python tracker 

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



[issue33564] IDLE: add 'async' to codecontext block openers

2018-05-17 Thread miss-islington

miss-islington  added the comment:


New changeset eb4590e4d9abecdbbc91c3531df83e1f9bed50f1 by Miss Islington (bot) 
in branch '3.6':
bpo-33564: Add async to IDLE's code context block openers. (GH-6960)
https://github.com/python/cpython/commit/eb4590e4d9abecdbbc91c3531df83e1f9bed50f1


--
nosy: +miss-islington

___
Python tracker 

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



[issue28418] Raise Deprecation warning for tokenize.generate_tokens

2018-05-17 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks Thomas.  I've been a long term user of tokenize.generate_tokens() and 
would be sad to see it go.  

The underlying _tokenize() functionality is used else within the module, so 
there the no benefit to removing the API.

--
nosy: +rhettinger

___
Python tracker 

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



[issue22552] ctypes.CDLL returns singleton objects, resulting in usage conflicts

2018-05-17 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


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



[issue31645] openssl build fails in win32 if .pl extension is not associated with Perl

2018-05-17 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


--
resolution:  -> wont fix
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



[issue33531] test_asyncio: test_subprocess test_stdin_broken_pipe() failure on Travis CI

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I just got the two broken pipe error on Travis.

--

___
Python tracker 

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



[issue33531] test_asyncio: test_subprocess test_stdin_broken_pipe() failure on Travis CI

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I have also gotten test_async errors on AppVeyor and MSTS Windows.

ERROR: test__sock_sendfile_native_failure 
(test.test_asyncio.test_base_events.BaseLoopSockSendfileTests)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1881, in test__sock_sendfile_native_failure
sock, proto = self.prepare()
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1866, in prepare
self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1846, in run_loop
return self.loop.run_until_complete(coro)
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 566, in 
run_until_complete
return future.result()
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 475, in 
sock_connect
return await fut
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 505, in 
_sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 6284)
==
ERROR: test_sock_sendfile_fallback 
(test.test_asyncio.test_base_events.BaseLoopSockSendfileTests)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1903, in test_sock_sendfile_fallback
sock, proto = self.prepare()
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1866, in prepare
self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1846, in run_loop
return self.loop.run_until_complete(coro)
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 566, in 
run_until_complete
return future.result()
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 475, in 
sock_connect
return await fut
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 505, in 
_sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 6303)
==
ERROR: test_sock_sendfile_fallback_offset_and_count 
(test.test_asyncio.test_base_events.BaseLoopSockSendfileTests)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1914, in test_sock_sendfile_fallback_offset_and_count
sock, proto = self.prepare()
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1866, in prepare
self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1846, in run_loop
return self.loop.run_until_complete(coro)
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 566, in 
run_until_complete
return future.result()
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 475, in 
sock_connect
return await fut
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 505, in 
_sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 6308)
==
ERROR: test_sock_sendfile_no_fallback 
(test.test_asyncio.test_base_events.BaseLoopSockSendfileTests)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1892, in test_sock_sendfile_no_fallback
sock, proto = self.prepare()
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1866, in prepare
self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 
1846, in run_loop
return self.loop.run_until_complete(coro)
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 566, in 
run_until_complete
return future.result()
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 475, in 
sock_connect
return await fut
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 505, in 
_sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 6338)
--
Ran 1729 tests in 89.932s

Before that, for Brett
test_popen 

[issue33554] Optimize PyDictObject

2018-05-17 Thread INADA Naoki

INADA Naoki  added the comment:

> A little performance optimization, but I think the key is not in
performance optimization.
> The semantics of the dictresize function are not uniform, and it is
inconvenient for others to read. The dictresize function should be split to
make it just resize. What do you think?

I can't understand.
What dictresize does now other than resize?
Could you show how dictresize can be simplified when clear_dummy_keys() is
added?

Anyway, current my opinion is -1 on this.
We can add similar function when fixing Issue31954.

--

___
Python tracker 

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



[issue33564] IDLE: add 'async' to codecontext block openers

2018-05-17 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6621

___
Python tracker 

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



[issue33564] IDLE: add 'async' to codecontext block openers

2018-05-17 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6620

___
Python tracker 

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



[issue33564] IDLE: add 'async' to codecontext block openers

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset d89ca94847d943b883ebcc68e4f0a18cb042ed0d by Terry Jan Reedy in 
branch 'master':
bpo-33564: Add async to IDLE's code context block openers. (GH-6960)
https://github.com/python/cpython/commit/d89ca94847d943b883ebcc68e4f0a18cb042ed0d


--

___
Python tracker 

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



[issue33564] IDLE: add 'async' to codecontext block openers

2018-05-17 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +6619
stage: needs patch -> patch review

___
Python tracker 

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



[issue32831] IDLE: Add docstrings and tests for codecontext

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Because BLOCKOPENERS is sufficiently distant from the changes for this issue, I 
will add 'async' now, without tests, in #33564.

Some of my comments for this issue are ideas for future changes in 
codecontext.py.

--

___
Python tracker 

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



[issue33564] IDLE: add 'async' to codecontext block openers

2018-05-17 Thread Terry J. Reedy

New submission from Terry J. Reedy :

I am just going to add 'async' to BLOCKOPENERS.  I don't think this needs a 
particular test, as most of the openers are not used in the new tests added by 
#32831.  We could eventually expand the sample to have one of each opener.

--
assignee: terry.reedy
components: IDLE
messages: 316991
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: add 'async' to codecontext block openers
type: enhancement
versions: Python 3.6, 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



[issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()

2018-05-17 Thread Paul Goins

Paul Goins  added the comment:

I don't know enough about those tests and how important they are considered.  
My only concern would be with the increased risk of undetected breakage caused 
by removing them from CI, but if people think the risk is negligible and/or 
acceptable, it's fine by me.

Anything to change in git, or is this purely build agent stuff at this point?

--

___
Python tracker 

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



[issue33459] Fix "tuple display" mention in Expressions

2018-05-17 Thread Andrés Delfino

Andrés Delfino  added the comment:

I'm restoring the original title since we are not sure it was incorrect after 
all.

I have also updated the PR to remove the tuple display entry from the index.

--
title: Define "tuple display" in the docs -> Fix "tuple display" mention in 
Expressions
versions: +Python 2.7, 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



[issue33563] fileinput input's and Fileinput's bufsize=0 do not remit deprecationWarnings

2018-05-17 Thread Matthias Bussonnier

New submission from Matthias Bussonnier :

In Lib/fileinput.py, passing bufsize=0 does not raise any DeprecationWarning.

Also when using `input` the stacklevel could be better as it passes bufsize 
directly for FileInput.

in Lib/test/test_fileinput.py ; MockFileInput does not reflect the changes of 
FileInput. Presumably MockFielInput was made to make sure that `input` was 
passing the parameters as is and should be update accordingly.

--
messages: 316988
nosy: mbussonn
priority: normal
severity: normal
status: open
title: fileinput input's and Fileinput's bufsize=0 do not remit 
deprecationWarnings

___
Python tracker 

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



[issue33563] fileinput input's and Fileinput's bufsize=0 do not remit deprecationWarnings

2018-05-17 Thread Matthias Bussonnier

Change by Matthias Bussonnier :


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

___
Python tracker 

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



[issue32831] IDLE: Add docstrings and tests for codecontext

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

After this is merged, we should immediately add 'async' to the list of block 
openers.

With complete tests, we can more confidently cleanup the code a bit, as well as 
change behavior.  The fourth field of info tuples, block keyword, is never used 
as part of info tuples.  (It is used before being added in get_context.)

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



[issue33562] Check that the global settings for asyncio are not changed by tests

2018-05-17 Thread Brett Cannon

Change by Brett Cannon :


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

___
Python tracker 

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



[issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()

2018-05-17 Thread David Bolen

David Bolen  added the comment:

A longer timeout might be another workaround, but for myself, I tend to favor 
Zachary's original suggestion of eliminating largefile tests for the moment as 
simplest and most robust.  It would also reduce the overall percentage of test 
time currently spent on a small number of tests.

Time (and budget) permitting, I do hope to try some tests on newer Azure 
machine types to see if they behave differently, which might be a longer term 
option.

--

___
Python tracker 

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



[issue33562] Check that the global settings for asyncio are not changed by tests

2018-05-17 Thread Brett Cannon

New submission from Brett Cannon :

There were not checks in test.libregrtest.save_env to make sure tests were not 
mucking with the default event loop. The settings to check seem to be:

'asyncio.get_event_loop_policy', 'asyncio.get_event_loop',
'asyncio_get_exception_handler', 'asyncio_get_debug',
'asyncio_get_child_watcher',

I have a PR that I'm working on that checks these things and it looks like the 
following tests are being a little sloppy:

test_asyncgen
test_contextlib_async
test_coroutines
test_socket
test_sys_settrace

And test_asyncio never seems to complete.

--
components: Tests
messages: 316985
nosy: asvetlov, brett.cannon, giampaolo.rodola, yselivanov
priority: normal
severity: normal
status: open
title: Check that the global settings for asyncio are not changed by tests
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



[issue28418] Raise Deprecation warning for tokenize.generate_tokens

2018-05-17 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

I've opened a PR moving in the other direction (making this public rather than 
deprecating it):

https://github.com/python/cpython/pull/6957

--
nosy: +takluyver

___
Python tracker 

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



[issue9969] tokenize: add support for tokenizing 'str' objects

2018-05-17 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

I've opened a PR for issue #12486, which would make the existing but 
undocumented 'generate_tokens' function public:

https://github.com/python/cpython/pull/6957

I agree that it would be good to design a nicer API for this, but the perfect 
shouldn't be the enemy of the good.

--

___
Python tracker 

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



[issue12486] tokenize module should have a unicode API

2018-05-17 Thread Thomas Kluyver

Change by Thomas Kluyver :


--
pull_requests: +6616

___
Python tracker 

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



[issue12486] tokenize module should have a unicode API

2018-05-17 Thread Matthias Bussonnier

Matthias Bussonnier  added the comment:

> Why not just bless the existing generate_tokens() function as a public API, 

Yes please, or just make the private `_tokenize` public under another name. The 
`tokenize.tokenize` method try to magically detect encoding which may be 
unnecessary.

--
nosy: +mbussonn

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread miss-islington

miss-islington  added the comment:


New changeset efa642779739b5af028b0f6ebb9033395e124273 by Miss Islington (bot) 
in branch '3.7':
bpo-33559: Attribute changed repr of exceptions (GH-6954)
https://github.com/python/cpython/commit/efa642779739b5af028b0f6ebb9033395e124273


--
nosy: +miss-islington

___
Python tracker 

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



[issue25478] Consider adding a normalize() method to collections.Counter()

2018-05-17 Thread Vedran Čačić

Vedran Čačić  added the comment:

As I said above, if we're going to go down that route, it seems much more 
reasonable to me that total should be a cached property, that's updated on 
every Counter update (in __setitem__, increased by a difference of a new value 
and an old one for that key).

And normalization should just provide a view over the Counter, that just passes 
the values through division with the above cached property. The view should of 
course be immutable by itself, but should reflect the changes of the underlying 
counter, just as already existing views (e.g. dict_values) do.

--

___
Python tracker 

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



[issue33558] Python has no icon in taskbar and in start screen

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

For me, 3.6.5 IDLE has the same Python app icon (white notebook page with 
blue/yellow snakes) as always.  But I upgraded from 3.6.4, etc, so my Win10 
machine already had the icon.

Filip, which Windows (in case it makes a difference)?  Which *exact* installer 
(there are two you could have used).

--
assignee: terry.reedy -> 
components: +Installation

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6615

___
Python tracker 

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



[issue25478] Consider adding a normalize() method to collections.Counter()

2018-05-17 Thread Allen Downey

Allen Downey  added the comment:

I'd like to second Raymond's suggestion.  With just a few additional methods, 
you could support a useful set of operations.  One possible API:

def scaled(self, factor)
"""Returns a new Counter with all values multiplied by factor."""

def normalized(self, total=1)
"""Returns a new Counter with values normalized so their sum is total."""

def total(self)
"""Returns the sum of the values in the Counter."""

These operations would make it easier to use a Counter as a PMF without 
subclassing.

I understand two arguments against this proposal

1) If you modify the Counter after normalizing, the result is probably nonsense.

That's true, but it is already the case that some Counter methods don't make 
sense for some use cases, depending on how you are using the Counter (as a bag, 
multiset, etc)

So the new features would come with caveats, but I don't think that's fatal.

2) PMF operations are not general enough for core Python; they should be in a 
stats module.

I think PMFs are used (or would be used) for lots of quick computations that 
don't require full-fledged stats.

Also, stats libraries tend to focus on analytic distributions; they don't 
really provide this kind of light-weight empirical PMF.

I think the proposed features have a high ratio of usefulness to implementation 
effort, without expanding the API unacceptably.


Two thoughts for alternatives/extensions:

1) It might be good to make scaled() available as __mul__, as Peter Norvig 
suggests.

2) If the argument of scaled() is a mapping type, it might be good to support 
elementwise scaling.  That would provide an elegant implementation of Raymond's 
chi-squared example and my inspection paradox example 
(http://greenteapress.com/thinkstats2/html/thinkstats2004.html#sec33)

Thank you!
Allen

--
nosy: +Allen Downey

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Steve Dower

Steve Dower  added the comment:


New changeset fb9dd8915314d857161de89fcbbb041f2b49fc22 by Steve Dower (Miro 
Hrončok) in branch 'master':
bpo-33559: Attribute changed repr of exceptions (GH-6954)
https://github.com/python/cpython/commit/fb9dd8915314d857161de89fcbbb041f2b49fc22


--

___
Python tracker 

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



[issue33554] Optimize PyDictObject

2018-05-17 Thread b@n

b@n  added the comment:

A little performance optimization, but I think the key is not in performance 
optimization.
The semantics of the dictresize function are not uniform, and it is 
inconvenient for others to read. The dictresize function should be split to 
make it just resize. What do you think?

--

___
Python tracker 

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



[issue33561] Add .tostring() method to xml.etree.ElementTree.Element

2018-05-17 Thread Stefan Behnel

Stefan Behnel  added the comment:

Sorry, but you are proposing an API extension here that provides no benefits 
but duplicates existing functionality in a less versatile place. This is not 
going to happen.

The second proposal (str(xml)) is actually not very helpful as it does not 
allow any kind of configuration, so it breaks backwards compatibility without 
benefit. Also not going to happen.

--
nosy: +scoder

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Steve Dower

Steve Dower  added the comment:


New changeset 54fc49737a6a79f6e2ece16e22b233858b836567 by Steve Dower (Miss 
Islington (bot)) in branch '3.7':
bpo-33559: Document changed repr of exceptions (GH-6943) (GH-6950)
https://github.com/python/cpython/commit/54fc49737a6a79f6e2ece16e22b233858b836567


--

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Steve Dower

Steve Dower  added the comment:

It's worth documenting. I'll merge the next PR with the attribution.

--

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Miro Hrončok

Miro Hrončok  added the comment:

I was bit by this, so that's why I think this is worth documenting. 
https://github.com/testing-cabal/testtools/issues/270

--

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Miro Hrončok

Change by Miro Hrončok :


--
pull_requests: +6614

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This was done in issue30399, and I was not sure that this change is worth 
adding in What's New. Add a reference to the issue.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()

2018-05-17 Thread Paul Goins

Paul Goins  added the comment:

Also, to be clear, I understand what David is saying and don't disagree at all. 
 And if this really is Spectre related, it may be difficult to "go back" and 
test a before case, so my last comment about "digging in" may be rather moot.

Does tweaking the timeout sound right (or good enough)?  Or are there other 
things we ought to try first?

--

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6613

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Steve Dower

Steve Dower  added the comment:


New changeset 631753fcc5e88bbbad402933e77295675cfe1fee by Steve Dower (Miro 
Hrončok) in branch 'master':
bpo-33559: Document changed repr of exceptions (GH-6943)
https://github.com/python/cpython/commit/631753fcc5e88bbbad402933e77295675cfe1fee


--
nosy: +steve.dower

___
Python tracker 

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



[issue33561] Add .tostring() method to xml.etree.ElementTree.Element

2018-05-17 Thread Steven Vascellaro

Steven Vascellaro  added the comment:

Alternatively, the most intuitive solution would be to give `Element` an 
explicit `__str__` method.

The current behavior of `str(Element)` is to return the object's location in 
memory.

```
from xml.etree import ElementTree

xml = ElementTree.Element('Person', Name='John')
print(str(xml))
# Output: 
```

Unfortunately, changing this behavior could cause issues with backwards 
compatibility.

--

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-05-17 Thread Emily Morehouse

Change by Emily Morehouse :


--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue33555] No SyntaxError raised for `return` with argument inside generator

2018-05-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

See also What’s New In Python 3.3:

https://docs.python.org/3/whatsnew/3.3.html#pep-380-syntax-for-delegating-to-a-subgenerator

And PEP 380 itself.

--

___
Python tracker 

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



[issue33561] Add .tostring() method to xml.etree.ElementTree.Element

2018-05-17 Thread Steven Vascellaro

New submission from Steven Vascellaro :

In Python 3.6, converting an xml `xml.etree.ElementTree.Element` to a string is 
done using `xml.etree.ElementTree.tostring()`.

```
from xml.etree import ElementTree

xml = ElementTree.Element('Person', Name='John')
print(ElementTree.tostring(xml, encoding='unicode', method='xml')
# Output: 
```

I would like to propose adding a `tostring()` function to the `Element` class, 
so that `ElementTree.tostring(xml)` could be replaced with the more intuitive 
`xml.tostring()`.

```
from xml.etree import ElementTree

xml = ElementTree.Element('Person', Name='John')
print(xml.tostring(encoding='unicode', method='xml'))
# Output: 
```

Benefits:

- Doesn't require importing `xml.etree.ElementTree`
- Allows writing more concise code
- Makes `tostring` part of the `Element` class
- Maintains backwards compatibility

--
components: XML
messages: 316966
nosy: Stevoisiak
priority: normal
severity: normal
status: open
title: Add .tostring() method to xml.etree.ElementTree.Element
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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-05-17 Thread Yury Selivanov

Change by Yury Selivanov :


--
nosy:  -yselivanov

___
Python tracker 

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



[issue33558] Python has no icon in taskbar and in start screen

2018-05-17 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> terry.reedy
components: +IDLE, Windows
nosy: +paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
type: performance -> behavior
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue33548] tempfile._candidate_tempdir_list should consider common TEMP locations

2018-05-17 Thread Steve Dower

Steve Dower  added the comment:

Merged as part of the VSTS PR (it was needed to fix some tests on the Windows 
build machine)

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



[issue33560] tuple.index() could return a more explicit error message

2018-05-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is a duplicate of issue13349.

--
nosy: +serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
superseder:  -> Non-informative error message in index() and remove() functions

___
Python tracker 

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



[issue33533] Provide an async-generator version of as_completed

2018-05-17 Thread Yury Selivanov

Yury Selivanov  added the comment:

I like the idea. Let's revisit it after Python 3.7 is released.

--

___
Python tracker 

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



[issue33544] Asyncio Event.wait() is a hold over from before awaitable, and should be awaitable

2018-05-17 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Deprecating Event.wait would be incorrect because Event was designed to mimic 
> the threading.Event class which has a (blocking) wait() method[1].

This is rather important. I'd like to continue maintaining this similarity. 
Adding 'await event' would be similar (in a way) to making instances of 
threading.Event callable.  So deprecation of '.wait()' isn't something we will 
do.

Having *both* 'await event.wait()' and 'await event' worries me.  IMO the 
slight readability improvement isn't worth the added complexity.

--

___
Python tracker 

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



[issue33403] asyncio.tasks.wait does not allow to set custom exception when return_when=FIRST_EXCEPTION

2018-05-17 Thread Yury Selivanov

Yury Selivanov  added the comment:

This isn't a priority now, so let's postpone the discussion on this until 3.7 
is released.

--

___
Python tracker 

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



[issue33560] tuple.index() could return a more explicit error message

2018-05-17 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue33499] Environment variable to set alternate location for pycache tree

2018-05-17 Thread Nick Coghlan

Nick Coghlan  added the comment:

I believe the main argument for -X options is the fact that cmd on Windows 
doesn't offer a nice way of setting environment variables as part of the 
command invocation (hence "-X utf8", for example).

As far as setting values for X options goes, `sys._xoptions` in CPython is a 
str:Union[bool,str] dict, with the command args split on "=":

$ python3 -X arg=value -c "import sys; print(sys._xoptions)"

  
{'arg': 'value'}

If no value is given for the arg, then it's just set to the boolean True.

The _xoptions entry shouldn't be the public API though - it's just a way of 
shuttling settings from the command line through to CPython-specific 
initialisation code.

--

___
Python tracker 

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



[issue33537] Help on importlib.resources outputs the builtin open description

2018-05-17 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset 6417d33633a3979d996015e52e4ff6c7a88e93e5 by Barry Warsaw (Miss 
Islington (bot)) in branch '3.7':
bpo-33537: Add an __all__ to importlib.resources (GH-6920) (#6941)
https://github.com/python/cpython/commit/6417d33633a3979d996015e52e4ff6c7a88e93e5


--

___
Python tracker 

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



[issue33499] Environment variable to set alternate location for pycache tree

2018-05-17 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Honestly, I don't think there's a strong argument for a CLI option.  I'm 
perfectly happy with just an environment variable.

--

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Miro Hrončok

Change by Miro Hrončok :


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

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2018-05-17 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le 17/05/2018 à 18:20, Nick Coghlan a écrit :
> 
> The question is whether we might be able to avoid some 
> bytes->Python-objects->bytes cycles if there were a few more 
> contiguous-binary-data-centric operations on bytes and/or memoryview (similar 
> to the way the ASCII-centric operations on bytes and bytearray help to avoid 
> bytes->text->bytes cycles).

Can you elaborate on your question?

--

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2018-05-17 Thread Nick Coghlan

Nick Coghlan  added the comment:

Thanks for the link Serhiy (I'd forgotten about the struct changes proposed in 
PEP 3118), but the existing struct formatting codes are fine for my purposes.

The question is whether we might be able to avoid some 
bytes->Python-objects->bytes cycles if there were a few more 
contiguous-binary-data-centric operations on bytes and/or memoryview (similar 
to the way the ASCII-centric operations on bytes and bytearray help to avoid 
bytes->text->bytes cycles).

--

___
Python tracker 

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



[issue33560] tuple.index() could return a more explicit error message

2018-05-17 Thread Cyril Roelandt

New submission from Cyril Roelandt :

The tuple.index() method returns an error message that does not allow users to 
know what element was being looked for inside the tuple:

>>> ().index(1)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: tuple.index(x): x not in tuple

The list.index() method has a much better error message:

>>> [].index(1)   
Traceback (most recent call last):
  File "", line 1, in 
ValueError: 1 is not in list

We could improve tuple.index() so that its behaviour becomes similar to that of 
list.index().

--
messages: 316955
nosy: Cyril Roelandt
priority: normal
severity: normal
status: open
title: tuple.index() could return a more explicit error message
type: enhancement
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



[issue33499] Environment variable to set alternate location for pycache tree

2018-05-17 Thread Carl Meyer

Carl Meyer  added the comment:

Can we have a named -X option that also takes a parameter? I don't see any 
existing examples of that. This option needs to take the path where bytecode 
should be written.

Are there strong use-cases for having a CLI arg for this? I don't mind doing 
the implementation work if there are, but right now I'm struggling to think of 
any case where it would be better to run `python -C /tmp/bytecode` than 
`PYTHONBYTECODEPATH=/tmp/bytecode python`. Our existing "takes a path" env 
variables (`PYTHONHOME` and `PYTHONPATH`) do not have CLI equivalents.

--

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Miro Hrončok

Change by Miro Hrončok :


--
type:  -> behavior

___
Python tracker 

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



[issue33559] Exception's repr change not documented

2018-05-17 Thread Miro Hrončok

New submission from Miro Hrončok :

Python 3.6.5 ...
>>> Exception('foo',)
Exception('foo',)

Python 3.7.0b4 ...
>>> Exception('foo',)
Exception('foo')

This is a change that might bit people who rely on doctesting.

It is not documented at https://docs.python.org/3.7/whatsnew/3.7.html

I'll send a PR.

--
assignee: docs@python
components: Documentation
messages: 316953
nosy: Elvis.Pranskevichus, docs@python, hroncok, ned.deily, yselivanov
priority: normal
severity: normal
status: open
title: Exception's repr change not documented
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



[issue33558] Python has no icon in taskbar and in start screen

2018-05-17 Thread Filip

New submission from Filip :

I've just downloaded the latest version of Python (3.6.5) from python.org. 
After installing, I launched it and I found out the app has no icon. Then I 
tried to download Python using different link, but it was the same as the first 
try.

--
files: bug.png
messages: 316952
nosy: e_l_e_c_t_r_i_f_y
priority: normal
severity: normal
status: open
title: Python has no icon in taskbar and in start screen
type: performance
versions: Python 3.5
Added file: https://bugs.python.org/file47599/bug.png

___
Python tracker 

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



[issue33537] Help on importlib.resources outputs the builtin open description

2018-05-17 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6610

___
Python tracker 

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



[issue33537] Help on importlib.resources outputs the builtin open description

2018-05-17 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset 0ed66df5242138fc599b4735749e55f953d9a1e4 by Barry Warsaw in 
branch 'master':
bpo-33537: Add an __all__ to importlib.resources (#6920)
https://github.com/python/cpython/commit/0ed66df5242138fc599b4735749e55f953d9a1e4


--

___
Python tracker 

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



[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-17 Thread Steve Dower

Steve Dower  added the comment:

This is implemented and merged now. I'll leave it to core-workflow to decide 
whether and when to make the builds required and/or reduce use of 
Travis/AppVeyor.

--
resolution:  -> fixed
stage: patch review -> resolved

___
Python tracker 

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



[issue33557] Windows multiprocessing doesn't propagate tabcheck to children

2018-05-17 Thread Jakub Wilk

New submission from Jakub Wilk :

Multiprocessing on Windows is supposed to start child processes using
the same sys.flags as the current process (see issue 12098).
However, at least sys.flags.tabcheck is not propagated.

I've attached small test program that reproduces this bug.
On Linux, as expected, it fails with TabError if you use -tt:

  $ python -tt test-tabcheck.py 
  Process Process-1:
  Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in 
_bootstrap
  self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
  self._target(*self._args, **self._kwargs)
File "test-tabcheck.py", line 6, in test_ast_parse
  ast.parse('if 1:\n\t1\n' + '\x20' * 8 +'1')
File "/usr/lib/python2.7/ast.py", line 37, in parse
  return compile(source, filename, mode, PyCF_ONLY_AST)
File "", line 3
  1
  ^
  TabError: inconsistent use of tabs and spaces in indentation

But it doesn't on Windows:

  >python -tt test-tabcheck.py
  Process Process-1:
  Traceback (most recent call last):
File "C:\Python27\lib\multiprocessing\process.py", line 267, in _bootstrap
  self.run()
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
  self._target(*self._args, **self._kwargs)
File "...\test-tabcheck.py", line 7, in test_ast_parse
  assert sys.flags.tabcheck == expected_tabcheck, 'sys.flags.tabcheck == 
{0} != {1}'.format(sys.flags.tabcheck, expected_tabcheck)
  AssertionError: sys.flags.tabcheck == 0 != 2

This was tested with Python 2.7.15.

--
components: Library (Lib), Windows
files: test-tabcheck.py
messages: 316949
nosy: jwilk, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows multiprocessing doesn't propagate tabcheck to children
versions: Python 2.7
Added file: https://bugs.python.org/file47598/test-tabcheck.py

___
Python tracker 

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



[issue33341] python3 fails to build if directory or sysroot contains "*icc*" string

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

icc-find.patch (and a 2nd version) has been uploaded to #28584 also. I unlinked 
the erroneous upload 'patch'.

--

___
Python tracker 

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



[issue33341] python3 fails to build if directory or sysroot contains "*icc*" string

2018-05-17 Thread Terry J. Reedy

Change by Terry J. Reedy :


Removed file: https://bugs.python.org/file47547/patch

___
Python tracker 

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



[issue33341] python3 fails to build if directory or sysroot contains "*icc*" string

2018-05-17 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
stage: patch review -> resolved
status: open -> closed
superseder:  -> ICC compiler check is too permissive

___
Python tracker 

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



[issue33051] IDLE: Create new tab for editor options in configdialog

2018-05-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

A new option would (maybe) apply to saving the shell also.  (Something to 
discuss there.)

--

___
Python tracker 

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



[issue28584] ICC compiler check is too permissive

2018-05-17 Thread Gianfranco

Gianfranco  added the comment:

My first attempt was instead of
*gcc*
to just check for
*gcc

this avoids when "icc" is the last part of the string, I admit this is not too 
strong.
Another approach is to use basename with cut -d " " -f 1 to pick just the first 
parameter, but maybe the best way is to do something like this:
gcc|*/gcc|*-gcc

I confirm the "icc-find-v2.patch" works in this way

--
Added file: https://bugs.python.org/file47597/icc-find-v2.patch

___
Python tracker 

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



[issue33341] python3 fails to build if directory or sysroot contains "*icc*" string

2018-05-17 Thread Gianfranco

Gianfranco  added the comment:

This was the patch I wanted to add, but I picked up a wrong one (a vbox one)

In any case, duplicate of issue28584

--
keywords: +patch
resolution:  -> duplicate
Added file: https://bugs.python.org/file47596/icc-find.patch

___
Python tracker 

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



[issue28584] ICC compiler check is too permissive

2018-05-17 Thread Gianfranco

Gianfranco  added the comment:

I'm attaching the patch that works also for parameters, e.g. when CC contains 
--sysroot=/home/icc or similar.
we can mark https://bugs.python.org/issue33341 duplicate to this one I think

--
nosy: +locutusofborg
versions: +Python 3.8 -Python 2.7, Python 3.5, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47595/icc-find.patch

___
Python tracker 

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



[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-17 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6608

___
Python tracker 

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



[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-17 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset dff46758f267ad6c13096c69c4e1dee17f9969aa by Gregory P. Smith in 
branch 'master':
bpo-19950: Clarify unittest TestCase instance use. (GH-6875)
https://github.com/python/cpython/commit/dff46758f267ad6c13096c69c4e1dee17f9969aa


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-17 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6609

___
Python tracker 

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



[issue33516] unittest.mock: Add __round__ to supported magicmock methods

2018-05-17 Thread John Reese

Change by John Reese :


--
nosy: +jreese, lukasz.langa

___
Python tracker 

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



[issue33051] IDLE: Create new tab for editor options in configdialog

2018-05-17 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Yes, I thought it would be good to have this before issue33046.

--

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2018-05-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Nick, for your tasks you may be interested in PEP 3118 which still is not 
completely implemented (issue3132).

--

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2018-05-17 Thread Nick Coghlan

Nick Coghlan  added the comment:

This issue isn't at the stage where a PR would help - the core question is 
still "Should we add better native support for multi-byte bitwise operations?", 
not the specifics of what they API might look like or how we would implement it.

--
stage: needs patch -> 

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2018-05-17 Thread Марк Коренберг

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

@ncoghlan

Could you please create Pull-request on Github ?

--

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-05-17 Thread Eric Snow

Eric Snow  added the comment:


New changeset 3ab0136ac5d6059ce96d4debca89c5f5ab0356f5 by Eric Snow in branch 
'master':
bpo-32604: Implement force-closing channels. (gh-6937)
https://github.com/python/cpython/commit/3ab0136ac5d6059ce96d4debca89c5f5ab0356f5


--

___
Python tracker 

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



[issue33538] Remove useless check in subprocess

2018-05-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It is in PyImport_Cleanup() in Python/import.c. Search 
PyObject_SetItem(modules, name, Py_None).

If you will run Python with the -v option you will see numerous messages "# 
cleanup[2] removing ..." emitted on stderr.

--

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2018-05-17 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'm back in the embedded software world now, and hence working with the 
combination of:

- low level serial formats (including fixed length CAN packets)
- C firmware developers that are quite capable of writing supporting 
C-in-Python code using the standard library, but aren't the least bit 
interested in graduating from writing standalone stdlib-only Python scripts 
that live in repositories otherwise full of C code to writing full Python 
applications with PyPI backed dependency management (etc)

It's the kind of environment where having the struct module in the standard 
library is incredibly valuable, and the main things that better support for 
direct manipulation of binary data could potentially offer us is avoiding some 
"memory -> struct.unpack -> process -> struct.pack -> memory" round trips, as 
well as potentially reducing the overall amount of code we have to maintain.

So I'll keep an eye out for potential opportunities for code simplification - 
while crypto algorithms, file formats, network protocols, and hardware 
interfaces can all call for this kind of thing, I'm less sure how often we're 
encountering it in situations where having it available would have let us avoid 
invoking struct entirely.

--
nosy: +ncoghlan
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue2506] Add mechanism to disable optimizations

2018-05-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Few different optimizations work together here. Folding constants at the AST 
level allows to eliminate the constant expression statement in the code 
generation stage. This makes 'continue' a first statement in the 'if' body. 
Boolean expressions optimizations (performed in the code generation stage now) 
creates a conditional jump to the start of the 'if' body (which is 'continue' 
now). If 'continue' is not nested in 'try' or 'with' blocks, it is compiled to 
an unconditional jump. And finally the jump optimization in the peepholer 
retargets the conditional jump from the unconditional jump to the start of the 
loop.

--

___
Python tracker 

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



[issue33556] leftover thread crumb in threading.ident docstring

2018-05-17 Thread Zachary Ware

Zachary Ware  added the comment:

Rather than a leading underscore, I think `thread.` should just be removed.  
`get_ident` is now exposed by the threading module itself.

For a change this small, 
https://github.com/python/cpython/edit/master/Lib/threading.py can be used to 
create it, but every change requires a PR :)

--
nosy: +zach.ware

___
Python tracker 

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



[issue33538] Remove useless check in subprocess

2018-05-17 Thread TaoQingyun

TaoQingyun <845767...@qq.com> added the comment:

I can't find the reset code, could you give me a link? Thanks.

--

___
Python tracker 

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



[issue31656] Bitwise operations for bytes-type

2018-05-17 Thread Nick Coghlan

Nick Coghlan  added the comment:

Issue 19251 is still under consideration, so marking this as a duplicate, 
rather than as rejected.

--
nosy: +ncoghlan
resolution: rejected -> duplicate
superseder:  -> bitwise ops for bytes of equal length

___
Python tracker 

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



  1   2   >