[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-23 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue31559] IDLE: test_browser is failed when run twice

2017-09-23 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Buildbots failures:

http://buildbot.python.org/all/builders/x86%20Gentoo%20Refleaks%203.x/builds/101/steps/test/logs/stdio
http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.x/builds/116/steps/test/logs/stdio

I don't know why test_browser fails first time, but this provokes running it 
second time why always fails.

$ ./python -m test -vuall -m test_browser test_idle test_idle
...
==
FAIL: test_gettext (idlelib.idle_test.test_browser.ChildBrowserTreeItemTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython3.6/Lib/idlelib/idle_test/test_browser.py", line 
181, in test_gettext
self.assertEqual(self.cbt_C1.GetText(), 'class C1')
AssertionError: 'class C1()' != 'class C1'
- class C1()
? --
+ class C1


==
FAIL: test_init (idlelib.idle_test.test_browser.ChildBrowserTreeItemTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython3.6/Lib/idlelib/idle_test/test_browser.py", line 
175, in test_init
eq(self.cbt_C1.name, 'C1')
AssertionError: 'C1()' != 'C1'
- C1()
?   --
+ C1


==
FAIL: test_getsublist (idlelib.idle_test.test_browser.ModuleBrowserTreeItemTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython3.6/Lib/idlelib/idle_test/test_browser.py", line 
141, in test_getsublist
self.assertEqual(sub1.name, 'C0')
AssertionError: 'C0(base)' != 'C0'
- C0(base)
+ C0


==
FAIL: test_nested (idlelib.idle_test.test_browser.NestedChildrenTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython3.6/Lib/idlelib/idle_test/test_browser.py", line 
238, in test_nested
self.assertEqual(actual_names, expected_names)
AssertionError: Lists differ: ['f0', 'C0(base)', 'f1', 'c1', 'F1', 'C1()', 
'f2', 'C2', 'F3'] != ['f0', 'C0', 'f1', 'c1', 'F1', 'C1()', 'f2', 'C2', 'F3']

First differing element 1:
'C0(base)'
'C0'

- ['f0', 'C0(base)', 'f1', 'c1', 'F1', 'C1()', 'f2', 'C2', 'F3']
?   --

+ ['f0', 'C0', 'f1', 'c1', 'F1', 'C1()', 'f2', 'C2', 'F3']

--

The test is passed if run it once on my computer.

--
assignee: terry.reedy
components: IDLE, Tests
messages: 302786
nosy: serhiy.storchaka, terry.reedy
priority: high
severity: normal
status: open
title: IDLE: test_browser is failed when run twice
type: behavior
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



[issue31553] Extend json.tool to handle jsonlines (with a flag)

2017-09-23 Thread Ezio Melotti

Ezio Melotti added the comment:

I agree with Raymond that this is a reasonable request.
Even if jsonlines is not part of the JSON specification, the format is quite 
common, and practicality beats purity (espcially considering that we are just 
talking about json.tool).

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-23 Thread Benjamin Peterson

Benjamin Peterson added the comment:

This is only useful if the parent process has a lot of memory that's never used 
by the child processes right? Otherwise, you would lose via refcounting COWs.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue31560] hashlib.blake2: error in example for signed cookies

2017-09-23 Thread Roundup Robot

Changes by Roundup Robot :


--
keywords: +patch
pull_requests: +3693

___
Python tracker 

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



[issue31560] hashlib.blake2: error in example for signed cookies

2017-09-23 Thread Benjamin Peterson

Benjamin Peterson added the comment:


New changeset aecc08ac3a14a73aa353655bb65ff8d965e935a0 by Benjamin Peterson 
(Dmitry Chestnykh) in branch 'master':
Docs: correct hashlib.blake2 keyed hashing example (bpo-31560)
https://github.com/python/cpython/commit/aecc08ac3a14a73aa353655bb65ff8d965e935a0


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue31560] hashlib.blake2: error in example for signed cookies

2017-09-23 Thread Dmitry Chestnykh

New submission from Dmitry Chestnykh:

The example for creating and verifying signed cookies with hashlib.blake2 
doesn't work. Corrected in GitHub PR #3694.

--
assignee: docs@python
components: Documentation
messages: 302787
nosy: dchest, docs@python
priority: normal
pull_requests: 3692
severity: normal
status: open
title: hashlib.blake2: error in example for signed cookies
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



[issue31561] difflib pathological behavior with mixed line endings

2017-09-23 Thread Mahmoud Al-Qudsi

Mahmoud Al-Qudsi added the comment:

Attaching file2

--
Added file: https://bugs.python.org/file47165/file2

___
Python tracker 

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



[issue31561] difflib pathological behavior with mixed line endings

2017-09-23 Thread Mahmoud Al-Qudsi

New submission from Mahmoud Al-Qudsi:

While using the icdiff command line interface to difflib, I ran into an 
interesting issue where difflib took 47 seconds to compare two simple text 
documents (a PHP source code file that had been refactored via phptidy).

On subsequent analysis, it turned out to be some sort of pathological behavior 
triggered by the presence of mixed line endings. Normalizing the line endings 
in both files to \r\n via unix2dos and then comparing (making no other changes) 
resulted in the diff calculation completing in under 2 seconds.

I have attached the documents in question (file1 and file2) to this bug report.

--
components: Library (Lib)
files: file1
messages: 302788
nosy: Mahmoud Al-Qudsi
priority: normal
severity: normal
status: open
title: difflib pathological behavior with mixed line endings
versions: Python 3.6
Added file: https://bugs.python.org/file47164/file1

___
Python tracker 

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



[issue31559] IDLE: test_browser is failed when run twice

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

browser.transform_children, when called the first time on a dict of children 
nodes, rebinds the name attribute of Classes with bases*. Tests that called the 
real browser.transform_children the first time on a node mutate the global 
mock_pyclbr_tree.  When the tests are re-run in the same process, tests 
initially run before the mutation are also run after the mutation.

*This is not an issue in current real use.  IDLE gets a new tree each time a 
module browser is opened.  The current tree widget calls GetSublist and hence 
transform_children at most once per node as it caches the result for each node. 
 But don't know what ttk.Treeview does and do know that tests can make multiple 
calls.  

Restoring the tree with
def tearDownModule():
C0.name = 'C0'
C1.name = 'C1'
fixes the failures found when rerunning the test module in the same process, 
but not the underlying problem of order dependence.

Instead, I added immediate calls to transform_children so that the mock tree is 
never mutated thereafter by any of the tests.  The subsequent class checks that 
the initial name replacements are correct.  All tests see the tree in the same 
state, so there should not be any order dependence left.

Testing global function calls in a testcase is slightly awkward, but the 
testcase follows immediately, and making the tree and its nodes global 
simplifies the tests that use the tree.

I checked that running test_pyclbr and test_idle twice each succeeds.

--

___
Python tracker 

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



[issue31559] IDLE: test_browser is failed when run twice

2017-09-23 Thread Terry J. Reedy

Changes by Terry J. Reedy :


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

___
Python tracker 

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



[issue31560] hashlib.blake2: error in example for signed cookies

2017-09-23 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> patch review

___
Python tracker 

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



[issue31560] hashlib.blake2: error in example for signed cookies

2017-09-23 Thread Benjamin Peterson

Benjamin Peterson added the comment:


New changeset 5614487378863d14cdbe730b00d6803523abb7ac by Benjamin Peterson 
(Miss Islington (bot)) in branch '3.6':
[3.6] Docs: correct hashlib.blake2 keyed hashing example (bpo-31560)
https://github.com/python/cpython/commit/5614487378863d14cdbe730b00d6803523abb7ac


--

___
Python tracker 

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



[issue31560] hashlib.blake2: error in example for signed cookies

2017-09-23 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue31159] Doc: Language switch can't switch on specific cases

2017-09-23 Thread Julien Palard

Changes by Julien Palard :


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



[issue31562] snakebite.net is not available

2017-09-23 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The testConnectTimeout in test_timeout is skipped since network resources it 
uses are not available.

$ ./python -m test -vuall test_timeout
...
testConnectTimeout (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 
'blackhole.snakebite.net' is not available"

$ host blackhole.snakebite.net
;; connection timed out; no servers could be reached
$ host whitehole.snakebite.net
;; connection timed out; no servers could be reached
$ host snakebite.net
;; connection timed out; no servers could be reached

Is it temporary or permanent issue?

--
components: Tests
messages: 302793
nosy: serhiy.storchaka, trent
priority: normal
severity: normal
status: open
title: snakebite.net is not available
type: behavior

___
Python tracker 

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



[issue31459] IDLE: Rename Class Browser as Module Browser

2017-09-23 Thread Terry J. Reedy

Changes 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



[issue31461] IDLE: Enhance module browser

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I was sitting down to write a patch for #31459, when I discovered yours.  If 
you want to write more module brower patches, such as for #31460  I will do 
something else.

--
dependencies: +IDLE: remove noisy icons from class (module) browser

___
Python tracker 

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



[issue25359] io.open() fails to open ascii file if LANG env not set

2017-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There are few issues here.

1. Missed "goto error" after setting an exception in TextIOWrapper constructor. 
This leads to raising wrong and less informative exception (and maybe worse in 
Python 3, but this is harder to reproduce).

2. getpreferredencoding() can return None in rare circumferences. But no code 
using it (except TextIOWrapper) expects this. What is better, fail or fallback 
to ASCII?

--

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-23 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +davin, tim.peters

___
Python tracker 

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



[issue31461] IDLE: Enhance module browser

2017-09-23 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Sorry about that.  You can do 31460 if you want.  I haven't started it.

--

___
Python tracker 

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



[issue31565] open() doesn't use locale.getpreferredencoding()

2017-09-23 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue20825] containment test for "ip_network in ip_network"

2017-09-23 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Hello Michel,

Would you be able to convert your patch to a Github pull request?  It seemed 
like there was interest in merging this at some point, so maybe a PR would get 
it moving towards that again.

--
nosy: +csabella

___
Python tracker 

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



[issue31563] Change repr of dict_keys, dict_values, and dict_items to use curly braces

2017-09-23 Thread Dan Snider

New submission from Dan Snider:

They behave like sets yet their repr looks like a list: dict_keys([0, 1, 3, 
4]). It should be dict_keys({0, 1, 2, 3, 4}). Ditto for 
odict_keys/odict_values. Maybe this is a holdover from when the repr of sets 
was Set([0, 1, 2, ...])?

The reason I bring this up is that they behave like sets was one of the last 
things I learned. I learned about stuff like abcs, metaclasses (including stuff 
like __prepare__ and __init_subclass__) and memorized practically all of the 
standard library long before I realized this.

I don't think it would break anything to do this and it could help dummies like 
me realize their set-like behavior sooner.

It might also be nice to give them the explicit `symmetric_difference`, 
`union`, and `intersection` methods in addition to the respective `__xor__`, 
`__or__`, and `__and__` methods.

--
messages: 302803
nosy: bup
priority: normal
severity: normal
status: open
title: Change repr of dict_keys, dict_values, and dict_items to use curly braces
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



[issue31460] IDLE: Revise ModuleBrowser API

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I meant .py?, as in .py, .pyw, .pyo, not .p?

--
nosy: +csabella

___
Python tracker 

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



[issue31563] Change repr of dict_keys, dict_values, and dict_items to use curly braces

2017-09-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Some of these were Guido's design decisions made over a decade ago.  He 
explicitly choose not have the spelled-out method names (both here in the 
concrete class and in the corresponding abstract base classes).  It usually 
isn't a good idea to second guess his long standing decisions which have worked 
out well in practice.

>From my own point-of-view, I prefer not to use the set curly brace notation in 
>the repr for several reasons.

1) Ideally, the reprs for the keys(), values(), and items() should all have a 
similar look.   The list notation is equally applicable to all of three, but 
the set notation isn't applicable to the values() which can have duplicates and 
may have non-hashable values.

2) The keys(), values(), and items() are guaranteed to be in the same order.  
The list notation reinforces this fact while the set notation does not.

3) There may be unforeseen usability issues (perhaps the change might falsely 
imply that there is an underlying set rather than a view of the dict, or 
perhaps it would imply that the full set() API is supported which it is not).

4) In Python 2, all three methods actually returned lists even though it would 
have been possible to return a set() for the keys.  Though it isn't required, I 
do like the continuity in thought between the versions.

--
components: +Interpreter Core
nosy: +rhettinger

___
Python tracker 

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



[issue31559] IDLE: test_browser is failed when run twice

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 99167f85b7373c8082b30a74211f009627bdedfa by Terry Jan Reedy in 
branch 'master':
bpo-31559: Remove test order dependence in idle_test.test_browser. (#3708)
https://github.com/python/cpython/commit/99167f85b7373c8082b30a74211f009627bdedfa


--

___
Python tracker 

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



[issue31559] IDLE: test_browser is failed when run twice

2017-09-23 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3695
stage:  -> patch review

___
Python tracker 

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



[issue25041] document AF_PACKET socket address format

2017-09-23 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Hello Camilla,

Would you like to create a Github pull request for your patch?

--
nosy: +csabella

___
Python tracker 

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



[issue31559] IDLE: test_browser is failed when run twice

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 429b3b1188cfac654677e8aeed494bb6067c475f by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31559: Remove test order dependence in idle_test.test_browser. 
(GH-3708) (#3709)
https://github.com/python/cpython/commit/429b3b1188cfac654677e8aeed494bb6067c475f


--

___
Python tracker 

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



[issue31562] snakebite.net is not available

2017-09-23 Thread Trent Nelson

Trent Nelson added the comment:

H, I'll investigate when I get home tomorrow.

Sent from my iPhone

> On Sep 23, 2017, at 13:46, Serhiy Storchaka  wrote:
> 
> 
> New submission from Serhiy Storchaka:
> 
> The testConnectTimeout in test_timeout is skipped since network resources it 
> uses are not available.
> 
> $ ./python -m test -vuall test_timeout
> ...
> testConnectTimeout (test.test_timeout.TCPTimeoutTestCase) ... skipped 
> "Resource 'blackhole.snakebite.net' is not available"
> 
> $ host blackhole.snakebite.net
> ;; connection timed out; no servers could be reached
> $ host whitehole.snakebite.net
> ;; connection timed out; no servers could be reached
> $ host snakebite.net
> ;; connection timed out; no servers could be reached
> 
> Is it temporary or permanent issue?
> 
> --
> components: Tests
> messages: 302793
> nosy: serhiy.storchaka, trent
> priority: normal
> severity: normal
> status: open
> title: snakebite.net is not available
> type: behavior
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue2504] Add gettext.pgettext() and variants support

2017-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks like a nice feature. Éric, could you please create a PR on GitHub?

I think that new l*gettext functions are not needed. They are rather useless in 
Python 3 (see issue29755).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31559] IDLE: test_browser is failed when run twice

2017-09-23 Thread Terry J. Reedy

Changes 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



[issue31459] IDLE: Rename Class Browser as Module Browser

2017-09-23 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3696

___
Python tracker 

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



[issue1612262] IDLE: Include nested functions and classes in module browser

2017-09-23 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: Class Browser doesn't show internal classes -> IDLE: Include nested 
functions and classes in module browser

___
Python tracker 

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



[issue31459] IDLE: Rename Class Browser as Module Browser

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset cd99e79dc74c9d9dea83a5551d657c334b2cc6c9 by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-31459: Rename IDLE's module browser from Class Browser to Module Browser. 
(#3704)
https://github.com/python/cpython/commit/cd99e79dc74c9d9dea83a5551d657c334b2cc6c9


--

___
Python tracker 

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



[issue31561] difflib pathological behavior with mixed line endings

2017-09-23 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +tim.peters

___
Python tracker 

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



[issue25359] io.open() fails to open ascii file if LANG env not set

2017-09-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31564] NewType can subclass NewType

2017-09-23 Thread Terji

New submission from Terji:

It has become possible to create a ``NewType`` from an existing  ``NewType``, 
see https://github.com/python/mypy/pull/3465 and 
https://github.com/python/peps/pull/271.

This is a small update to the documentation as a concequence of the above 
change.

--
assignee: docs@python
components: Documentation
messages: 302809
nosy: Petersen, docs@python
priority: normal
severity: normal
status: open
title: NewType can subclass NewType
type: enhancement
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



[issue31461] IDLE: Enhance module browser

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#25090 opened with a broad discussion of module broswer and code context, but I 
focused it on removing the folder and file icons misused for classes and 
functions in Module Browser.  Above, I suggested possibly changing pathbrowser, 
but I have decided against that.  The patch will be trivial, so I am going to 
do it and see what I think.

--

___
Python tracker 

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



[issue31563] Change repr of dict_keys, dict_values, and dict_items to use curly braces

2017-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I concur with Raymond.

As for supporting the full set() API I thought about making unbound method 
set.union() and friends accepting arbitrary Set objects (or even arbitrary 
iterables), not just set objects, as a first argument. But I didn't investigate 
how this will affect the performance of the set objects.

--
nosy: +serhiy.storchaka
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



[issue31355] Remove Travis CI macOS job: rely on buildbots

2017-09-23 Thread STINNER Victor

STINNER Victor added the comment:

Yeah, I consider that the issue can now be closed. If someone really wants 
runnings checks on macOS, we should wait until Travis CI solves their issues, 
or find a different CI provider.

https://blog.travis-ci.com/2017-09-22-macos-update

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



[issue31559] IDLE: test_browser is failed when run twice

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

> I don't know why test_browser fails first time,

On both buildbots, the initial rerun passes:
Ran 371 tests in 12.265s  OK (skipped=3) Gentoo
Ran 371 tests in 12.047s  OK (skipped=1) Windows8

--
stage: patch review -> 

___
Python tracker 

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



[issue12425] gettext breaks on empty plural-forms value

2017-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry, I don't see a value of issuing warning if the following line of the code 
is failed. Why not raise an exception instead?

A warning can be issued in the case of lacking nplurals= which is not used in 
Python implementation.

I think additional checks should be added in msgfmt.py. GNU msgfmt checks that 
plural= and nplurals= are specified if there are plural form translations.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31459] IDLE: Rename Class Browser as Module Browser

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset b650194652a591503f97c15f8f4c0b08c05058c5 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31459: Rename IDLE's module browser from Class Browser to Module 
Browser. (GH-3704) (#3710)
https://github.com/python/cpython/commit/b650194652a591503f97c15f8f4c0b08c05058c5


--

___
Python tracker 

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



[issue31564] NewType can subclass NewType

2017-09-23 Thread Roundup Robot

Changes by Roundup Robot :


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

___
Python tracker 

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



[issue31565] open() doesn't use locale.getpreferredencoding()

2017-09-23 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

It is documented that the default encoding for open() and io.TextIOWrapper() is 
locale.getpreferredencoding(). But actually the C implementation in Python 3 
uses _bootlocale.getpreferredencoding(). Monkey-patching 
locale.getpreferredencoding doesn't affect open().

--
components: IO
messages: 302812
nosy: benjamin.peterson, brett.cannon, eric.snow, ncoghlan, serhiy.storchaka, 
stutzbach
priority: normal
severity: normal
status: open
title: open() doesn't use locale.getpreferredencoding()
type: behavior
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



[issue30152] Reduce the number of imports for argparse

2017-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I have removed changes for which it was requested and addressed other comments. 
Can this PR be merged now?

--

___
Python tracker 

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



[issue25359] io.open() fails to open ascii file if LANG env not set

2017-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 7e32cee1a68a489c4f2e916ac7003004b51887de by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-25359: Add missed "goto error" after setting an exception. (GH-3712) 
(#3714)
https://github.com/python/cpython/commit/7e32cee1a68a489c4f2e916ac7003004b51887de


--

___
Python tracker 

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



[issue20827] IDLE : Display function argument list in ClassBrowser

2017-09-23 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Terry, 

I had an idea about this when I was working on the docstrings and the original 
patches.

I've attached a diff for the first step of my suggested patch.  I think you get 
the idea where I'm going with it, but I just call the same code that pyclbr 
uses to get the super class and reuse it functions.  Then I added a new value 
to Function called self.args, which is similar to self.super for Class.  I 
would still need to document it (obviously) and clean it up, but the new 
function _parse_args() is almost exactly the same as before, except that I've 
added a check for 'class' before seeing if it's already in the tree (line 298).

I've also modified _main(), so you can see the results from the command line.  
(python pyclbr.py)

If you like this approach, then I'll look at it more closely to make sure it's 
correct and I'll modify the tests.

--
nosy: +csabella
Added file: https://bugs.python.org/file47166/patch.txt

___
Python tracker 

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



[issue31461] IDLE: Enhance module browser

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Whoops, patching tree.py to not use icons is not trivial.  See new comment on 
#25090.

--

___
Python tracker 

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



[issue25359] io.open() fails to open ascii file if LANG env not set

2017-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset d6238a76c655e0feb13478505220dc9049f1682f by Serhiy Storchaka in 
branch 'master':
bpo-25359: Add missed "goto error" after setting an exception. (#3712)
https://github.com/python/cpython/commit/d6238a76c655e0feb13478505220dc9049f1682f


--

___
Python tracker 

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



[issue30152] Reduce the number of imports for argparse

2017-09-23 Thread STINNER Victor

STINNER Victor added the comment:

I reviewed your PR, see my questions.

Would you mind to run a new benchmark again, please?

--

___
Python tracker 

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



[issue25090] IDLE: remove noisy icons from class (module) browser

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I merged the nested functions and classes patch yesterday, so I really want to 
stop using file and folder icons for functions and classes.

However, this is not as easy as I was hoping.  By default, 
tree.TreeItem.GetIconName returns None.  tree.TreeNode then uses the default 
closed and open folder icons for contracted and expanded nodes.  There is no 
provision for 'no icon'.  The text print function hardcodes space for the icon. 
 The one thing I tried worked with module browser for at least a few node, but 
sent pathbrowser into a do-nothing state, probably a loop.

I decided to let this sit longer.  I hope to soon replace at least the low 
level part of tree (TreeNode) with ttk.Treeview, which does not require icons.

--

___
Python tracker 

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



[issue25359] io.open() fails to open ascii file if LANG env not set

2017-09-23 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3699

___
Python tracker 

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



[issue30152] Reduce the number of imports for argparse

2017-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

On my new laptop 100 runs are sped up from 2.357 sec to 2.094 sec (by 13%). Got 
rid of importing 6 modules: _struct, collections.abc, copy, struct, textwrap, 
warnings.

Getting rid of importing errno leads to rewriting of os._execvpe() which looks 
less trivial. I leave this for separate PR.

--

___
Python tracker 

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



[issue20827] IDLE : Display function argument list in ClassBrowser

2017-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Miscellaneous comments:

1. ClassBrowser.main, changed in Heblikar's  patch and referred to in the 
discussion, was the predecessor to the current browser._module_browser htest 
function.

I have not looked at the patch in detail, but it would have to be revised to be 
applied today.

2. pyclbr.Class and .Function look like public APIs (unlike _Object) and so I 
presume we must preserve back-compatibility by adding new args at the end of 
the arg list.

3. Changing pyclbr involves other core devs and possibly permissions and 
discussions.  If we do patch it, we should also use guaranteed ordered dicts. 
3.7.0b1 is expected early next January.

Pyclbr is outdated at least since 3.5 since it ignores 'async'.  (At least that 
does not cause a following def to be skipped.) It should really have an 
AFunction subclass or a marker on Function so Module Browser could then prefix 
'def' with 'async'. 

4. Bases and abstract arguments are both sequences between ()s.  But for pyclbr 
and browser, the analogy does not go much further.  Pyclbr tries to replace 
string names of bases with Class objects.  Browser uses this to prefix bases 
with paths prior to turning the sequence back to a string.  If it were not for 
that, having the stuff between ( and ) parsed would be a nuisance.  All browser 
currently needs is everything between ( and ) as a single string.  Actually, 
taking annotations into account, everything between ( and :, minus extraneous 
whitespace.

5. Pyclbr intentionally reads code but does not run it.  Must we keep that 
feature?  Or should be embrace and extend it?

Except for the current file, IDLE (currently) can only do completions and 
calltips for code that has been imported (and run) into the current user 
process.  Could it do as well or better without imports, perhaps by analyzing 
but not running other code in the IDLE process?

When pyclbr and IDLE were written, the only other no-run option was parsing to 
a barely readable concrete syntax tree.  Since a decade ago, ast has been 
available.  I believe that an ast tree contains all the information in a pyclbr 
tree.  That means that it should be possible to dump all the hand-crafted 
parsing in pyclbr and re-implement it by extracting the same info from an ast 
tree, using the ast node visitors.

What I am thinking is that IDLE might use ast for module browser, completions, 
and calltips.  If you are not familiar with ast, but want to learn, run 
something like

import ast
code = '''
import itertools as it
class a(it.count):
def __init__(self, n): pass
def extra(self, m:int) -> int: pass
'''
tree = ast.parse(code)
for node in ast.walk(tree):  
print(node)  # This produces same as ast.dump(tree)
print(node._fields)

and then skim the official doc and look at least this page of the resource 
recommended at the end.
https://greentreesnakes.readthedocs.io/en/latest/nodes.html#function-and-class-definitions

--
stage:  -> test needed
versions: +Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue31564] NewType can subclass NewType

2017-09-23 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 039b25d8fd21f8d5d9e3cb536402d952cf068dc1 by Mariatta (topper-123) 
in branch 'master':
bpo-31564: Update typing documentation (GH-3696)
https://github.com/python/cpython/commit/039b25d8fd21f8d5d9e3cb536402d952cf068dc1


--
nosy: +Mariatta

___
Python tracker 

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



[issue31564] NewType can subclass NewType

2017-09-23 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3700

___
Python tracker 

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



[issue31564] NewType can subclass NewType

2017-09-23 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 018e6b9f696311a65f47f33ea04b7baef3f3664f by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-31564: Update typing documentation (GH-3696) (GH-3715)
https://github.com/python/cpython/commit/018e6b9f696311a65f47f33ea04b7baef3f3664f


--

___
Python tracker 

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



[issue25041] document AF_PACKET socket address format

2017-09-23 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage: patch review -> needs patch
versions: +Python 3.7 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue31564] NewType can subclass NewType

2017-09-23 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks Terji!

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



[issue31561] difflib pathological behavior with mixed line endings

2017-09-23 Thread Tim Peters

Tim Peters added the comment:

I'm not familiar with `icdiff` - it's not part of the Python distribution, 
right?  If so, you should really talk to its author(s).

If two files have different line endings, then no pair of lines between them 
can be equal, and the difference engine will struggle mightily to find the 
"best matching" pair of lines between them, over & over & over ... again.  
That's expected, and is expensive (roughly cubic in the number of lines).

So "don't do that" is the obvious answer.  If you think it's something that 
comes up often enough that `icdiff` should do magic to worm around it, they 
could - with enough pain - normalize line endings to a canonical form, and then 
post-process the diff engine's output to say that some lines it thought were 
equal actually weren't.  Or you maybe you want them treated as equal despite 
that the line endings don't match?  Nobody can guess, so at best another option 
would need to be added to specify which.  That's messy all around, so they'll 
probably resist.

Just like I'd mightily resist mucking up difflib to do that itself ;-)  
Seriously, if you're messing with files containing a mix of line endings, 
you're begging for surprises from all sorts of tools.

--

___
Python tracker 

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