[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I thought that more verbose but straightforward code would be more acceptable. 
Well, here is smaller and clever patch. Tests are the same.

--
Added file: http://bugs.python.org/file36886/collections_pos_only_params2.patch

___
Python tracker 

___diff -r f592a4073672 Lib/collections/__init__.py
--- a/Lib/collections/__init__.py   Sat Oct 11 01:43:35 2014 -0500
+++ b/Lib/collections/__init__.py   Sat Oct 11 22:30:05 2014 +0300
@@ -16,6 +16,19 @@ from _weakref import proxy as _proxy
 from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
 from reprlib import recursive_repr as _recursive_repr
 
+def _wrap_dict_update(wrapped):
+# Can't use functools.wraps due to circular import
+def wrapper(*args, **kwds):
+if kwds:
+wrapped(*args, kwds=kwds)
+else:
+wrapped(*args)
+for attr in ('__module__', '__name__', '__qualname__', '__doc__',
+ '__annotations__'):
+setattr(wrapper, attr, getattr(wrapped, attr))
+del attr
+return wrapper
+
 

 ### OrderedDict
 

@@ -55,14 +68,13 @@ class OrderedDict(dict):
 # Individual links are kept alive by the hard reference in self.__map.
 # Those hard references disappear when a key is deleted from an 
OrderedDict.
 
-def __init__(self, *args, **kwds):
+@_wrap_dict_update
+def __init__(self, *args, kwds={}):
 '''Initialize an ordered dictionary.  The signature is the same as
 regular dictionaries, but keyword arguments are not recommended because
 their insertion order is arbitrary.
 
 '''
-if len(args) > 1:
-raise TypeError('expected at most 1 arguments, got %d' % len(args))
 try:
 self.__root
 except AttributeError:
@@ -479,7 +491,8 @@ class Counter(dict):
 #   http://code.activestate.com/recipes/259174/
 #   Knuth, TAOCP Vol. II section 4.6.3
 
-def __init__(self, iterable=None, **kwds):
+@_wrap_dict_update
+def __init__(self, iterable=None, *, kwds={}):
 '''Create a new, empty Counter object.  And if given, count elements
 from an input iterable.  Or, initialize the count from another mapping
 of elements to their counts.
@@ -542,7 +555,8 @@ class Counter(dict):
 raise NotImplementedError(
 'Counter.fromkeys() is undefined.  Use Counter(iterable) instead.')
 
-def update(self, iterable=None, **kwds):
+@_wrap_dict_update
+def update(self, iterable=None, *, kwds=None):
 '''Like dict.update() but add counts instead of replacing them.
 
 Source can be an iterable, a dictionary, or another Counter instance.
@@ -575,7 +589,8 @@ class Counter(dict):
 if kwds:
 self.update(kwds)
 
-def subtract(self, iterable=None, **kwds):
+@_wrap_dict_update
+def subtract(self, iterable=None, *, kwds=None):
 '''Like dict.update() but subtracts counts instead of replacing them.
 Counts can be reduced below zero.  Both the inputs and outputs are
 allowed to contain zero and negative counts.
@@ -898,12 +913,13 @@ class ChainMap(MutableMapping):
 class UserDict(MutableMapping):
 
 # Start by filling-out the abstract methods
-def __init__(self, dict=None, **kwargs):
+@_wrap_dict_update
+def __init__(self, dict=None, *, kwds=None):
 self.data = {}
 if dict is not None:
 self.update(dict)
-if len(kwargs):
-self.update(kwargs)
+if kwds:
+self.update(kwds)
 def __len__(self): return len(self.data)
 def __getitem__(self, key):
 if key in self.data:
diff -r f592a4073672 Lib/test/test_collections.py
--- a/Lib/test/test_collections.py  Sat Oct 11 01:43:35 2014 -0500
+++ b/Lib/test/test_collections.py  Sat Oct 11 22:30:05 2014 +0300
@@ -1137,6 +1137,28 @@ class TestCounter(unittest.TestCase):
 self.assertEqual(c.setdefault('e', 5), 5)
 self.assertEqual(c['e'], 5)
 
+def test_init(self):
+self.assertEqual(list(Counter(self=42).items()), [('self', 42)])
+self.assertEqual(list(Counter(iterable=42).items()), [('iterable', 
42)])
+self.assertEqual(list(Counter(iterable=None).items()), [('iterable', 
None)])
+self.assertRaises(TypeError, Counter, 42)
+self.assertRaises(TypeError, Counter, (), ())
+self.assertRaises(TypeError, Counter.__init__)
+
+def test_update(self):
+c = Counter()
+c.update(self=42)
+self.assertEqual(list(c.items()), [('self', 42)])
+c = Counter()
+c.update(iterable=42)
+self.assertEqual(list(c.items()), [('itera

[issue22568] Use of "utime" as variable name in Modules/posixmodule.c causes errors

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 922526816b25 by Georg Brandl in branch '3.4':
Closes #22568: fix UTIME_TO_* macros in posixmodule for rare cases.
https://hg.python.org/cpython/rev/922526816b25

New changeset 0b2c7ea86d96 by Georg Brandl in branch 'default':
#22568: merge with 3.4
https://hg.python.org/cpython/rev/0b2c7ea86d96

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-10-11 Thread Ned Deily

Ned Deily added the comment:

A comment on Vinay's comment: "and this cannot be obtained from sys.executable 
because that is pointing to a framework executable".  That *was* true prior to 
3.3 and is still true at the moment for 2.7.x but it is not true for 3.3+.  
Ronald's change (b79d276041a8) in Issue15307 for venv framework support changed 
the stub launcher to no longer do a realpath() on the executable name which 
means that sys.executable contains the path to the Python stub launcher whether 
or not in a venv:

$ ls -l /usr/local/bin/python2.7
lrwxr-xr-x  1 root  admin  71 Jul  3 01:21 /usr/local/bin/python2.7 -> 
../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
$ /usr/local/bin/python2.7 -c 'import sys;print(sys.executable)'
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

$ ls -l /usr/local/bin/python3.4
lrwxr-xr-x  1 root  wheel  71 Oct  6 16:53 /usr/local/bin/python3.4 -> 
../../../Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4
$ /usr/local/bin/python3.4 -c 'import sys;print(sys.executable)'
/usr/local/bin/python3.4

--

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

After some thought, I think we have to fix this.

I'll go through the patch in careful detail this weekend.

Ethan, if you would like to help, it would be great to have a third pair of 
eyes looking at the patch to make sure it correct it every detail.

--
priority: low -> normal

___
Python tracker 

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



[issue21603] IDLE SaveAs drops the extension in the prompted filename

2014-10-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree that having .py not visible but written would be obnoxious.  Hoever, 
without more information, I am inclined to close this as a 3rd parth (OS) 
issue.  Saimadhav, can you quickly try Save As with x.py on Linux?

--
nosy: +sahutd

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2014-10-11 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-11 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue22571] Remove import * recommendations and examples in doc?

2014-10-11 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue14105] Breakpoints in debug lost if line is inserted; IDLE

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 71fe5e336d5b by Terry Jan Reedy in branch '2.7':
Issue #14105: Change comment to reflect fix.  Patch by Saimadhav Heblikar.
https://hg.python.org/cpython/rev/71fe5e336d5b

New changeset f33b4770a078 by Terry Jan Reedy in branch '3.4':
Issue #14105: Change comment to reflect fix.  Patch by Saimadhav Heblikar.
https://hg.python.org/cpython/rev/f33b4770a078

New changeset 558d7fb48d74 by Terry Jan Reedy in branch 'default':
Issue #14105: Merge with 3.4
https://hg.python.org/cpython/rev/558d7fb48d74

--

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-10-11 Thread Tim Smith

Tim Smith added the comment:

Er, because the test has been modified by taking Vinay's suggestion to test 
that the directories are physically identical instead of doing a string 
comparison.

--

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-10-11 Thread Tim Smith

Tim Smith added the comment:

I'm attaching an updated patch; it passes tests for me locally with a framework 
build.

--
Added file: http://bugs.python.org/file36885/dont-realpath-venv-dirname.diff-1

___
Python tracker 

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



[issue22615] "make clinic" doesn't work

2014-10-11 Thread Larry Hastings

Larry Hastings added the comment:

Patch attached.  Brett was using a feature that didn't exist, so I'm not sure 
how it could have worked for him.  But it was a reasonable implicit feature 
request, and easy to implement, so here we are.

I'm not sure what's causing the churn in "bytesobject.c" here.  It looks like 
someone changed the Clinic block in a way that it produces the same output, but 
didn't bother to run Clinic on it and check it in.

--
keywords: +patch
Added file: 
http://bugs.python.org/file36884/larry.add.type.to.int.converter.1.diff

___
Python tracker 

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



[issue22613] Several minor doc issues

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7659f06a3648 by Berker Peksag in branch '3.4':
Issue #22613: Fix reprlib.Repr subclass example on Python 3.
https://hg.python.org/cpython/rev/7659f06a3648

New changeset 7394e5f85284 by Berker Peksag in branch 'default':
Issue #22613: Fix reprlib.Repr subclass example on Python 3.
https://hg.python.org/cpython/rev/7394e5f85284

--
nosy: +python-dev

___
Python tracker 

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



[issue22613] Several minor doc issues

2014-10-11 Thread Berker Peksag

Berker Peksag added the comment:

> Repr.repr_TYPE()

This is already fixed in issue 14824.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue10496] Python startup should not require passwd entry

2014-10-11 Thread Graham Dumpleton

Changes by Graham Dumpleton :


--
nosy: +grahamd

___
Python tracker 

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



[issue21061] Is contextlib.redirect_stdout reentrant or not?

2014-10-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks folks - the outdated cross reference has been updated as Berker 
suggested.

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

___
Python tracker 

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



[issue22389] Add contextlib.redirect_stderr()

2014-10-11 Thread Nick Coghlan

Nick Coghlan added the comment:

I just pushed the docs fix for issue #21061, so the docs part of the patch may 
need tweaking in order to apply automatically.

--

___
Python tracker 

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



[issue21061] Is contextlib.redirect_stdout reentrant or not?

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dafbd78ac15b by Nick Coghlan in branch '3.4':
Issue #21061: correctly note redirect_stdout is reentrant
https://hg.python.org/cpython/rev/dafbd78ac15b

New changeset 83540d7b7366 by Nick Coghlan in branch 'default':
Merge issue #21061 fix from 3.4
https://hg.python.org/cpython/rev/83540d7b7366

--
nosy: +python-dev

___
Python tracker 

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



[issue22615] "make clinic" doesn't work

2014-10-11 Thread Antoine Pitrou

New submission from Antoine Pitrou:

This is on the default branch.

$ make clinic
./python -E ./Tools/clinic/clinic.py --make
Error in file "./Modules/arraymodule.c" on line 1943:
Exception raised during parsing:
Traceback (most recent call last):
  File "./Tools/clinic/clinic.py", line 1626, in parse
parser.parse(block)
  File "./Tools/clinic/clinic.py", line 3178, in parse
self.state(line)
  File "./Tools/clinic/clinic.py", line 3660, in state_parameter
converter = dict[name](c_name or parameter_name, parameter_name, 
self.function, value, **kwargs)
  File "./Tools/clinic/clinic.py", line 2200, in __init__
self.converter_init(**kwargs)
TypeError: converter_init() got an unexpected keyword argument 'type'
make: *** [clinic] Erreur 255

--
components: Build
messages: 229107
nosy: brett.cannon, larry, pitrou
priority: critical
severity: normal
status: open
title: "make clinic" doesn't work
versions: Python 3.5

___
Python tracker 

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



[issue20167] Exception on IDLE closing

2014-10-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Serhiy, I responded to your report and followups on a new issue, #22614.
Tal, if you can, please test ./python -m idlelib.idle Lib/decimal.py on OSX and 
respond there.

--
resolution:  -> fixed
stage: test needed -> 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



[issue22614] Idle: problem in PyShellEditorWindow.color_breakpoint_text

2014-10-11 Thread Terry J. Reedy

New submission from Terry J. Reedy:

In Jan 2014 in the opening messages of #20167, msg207599, Serhiy Storchaka 
reported that
./python -m idlelib.idle Lib/decimal.py
opened the file on both 2.7 and 3.4 (beta) but that closing on 3.4 (but not 
2.7) caused 'application closed' errors in Multicall .__del__ methods. These 
have been fixed and recently refixed.

In msg228954, Serhiy reported a new problem, which I an transferring to this 
new issue, with 2.7 and 3.4 but not 3.5.

./python -m idlelib.idle Lib/decimal.py
Traceback (most recent call last):
  File "/home/serhiy/py/cpython-3.4/Lib/runpy.py", line 170, in 
_run_module_as_main
"__main__", mod_spec)
  File "/home/serhiy/py/cpython-3.4/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/idle.py", line 11, in 
idlelib.PyShell.main()
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/PyShell.py", line 1562, in main
if flist.open(filename) is None:
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/FileList.py", line 36, in open
edit = self.EditorWindow(self, filename, key)
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/PyShell.py", line 141, in 
__init__
self.color_breakpoint_text()
  File "/home/serhiy/py/cpython-3.4/Lib/idlelib/PyShell.py", line 159, in 
color_breakpoint_text
self.text.tag_config('BREAK', cfg)
AttributeError: 'NoneType' object has no attribute 'tag_config'

Serhiy, you did not specify the particular binaries you used. I will assume 
recent.

Versions: as far as I know, there are no idlelib code differences between 3.4 
and default (3.5).  I rechecked closed issues for patches pushed by someone 
else only to 3.5.  So any behavior difference between 3.4 and 3.5 must by due 
to a difference in tkinter, another stdlib module, or python itself.

What system? I do not reproduce on Win 7 with an Oct 9 build.

When?  If the command line worked for 2.7 in Jan and fails now, when did it 
start failing?  If the command worked for 3.4 after the Feb patches and fails 
now, same question.

How? You did not state, but in a later message implied that the file opened in 
the editor and the problem only happened when you closed, as with the January 
report.  However, the traceback says that the problem occurred during 
initialization.  According to Find in Files, the only call to 
color_breakpoint_text is that one __init__ call.  I therefore do not understand 
your msg228957 comment "The code runs up to self.text.update() in 
restore_file_breaks() and runs further only after windows closing."

restore_file_breaks is only called in two places. One is when file names are 
changed (which should not happen when closing an untouched file), the other is 
just before color_break during initialization.  Here is the last part of 
PyShellEditorWindow.__init__.

def filename_changed_hook(old_hook=self.io.filename_change_hook,
  self=self):
self.restore_file_breaks()
old_hook()
self.io.set_filename_change_hook(filename_changed_hook)
if self.io.filename:
self.restore_file_breaks()
self.color_breakpoint_text()

You msg228958 comment that changing .update to .update_idletasks also puzzles 
me. According to the tkinter docstrings, the difference is that the latter does 
less (assuming that .update also clears non-user callbacks, whatever they are)

update(self)
Enter event loop until all pending events have been processed by Tcl.

update_idletasks(self)
Enter event loop until all idle callbacks have been called. This
will update the display of windows but not process events caused by
the user.

During initialization, I would not expect there to be any user events.

--
messages: 229105
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle: problem in PyShellEditorWindow.color_breakpoint_text
type: behavior
versions: Python 2.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



[issue22613] Several minor doc issues

2014-10-11 Thread Zachary Ware

Changes by Zachary Ware :


--
stage:  -> needs patch

___
Python tracker 

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



[issue22613] Several minor doc issues

2014-10-11 Thread Zachary Ware

New submission from Zachary Ware:

>From docs@:

"""
Hello,

First, I want to thank you for the useful and clear documentation of Python.

Beeing a fanatic reader of it, sometimes I encounter some mistake (or it seems 
to me it is such). If this could bring some help, you will find in the attached 
file a list of points requiring attention.

All the comments concern the official standard documentation of Python 3.4.0.

With regards.

Jacques Ducasse
"""

--
assignee: docs@python
components: Documentation
files: PythonDocErreurs141010.pdf
keywords: easy
messages: 229104
nosy: docs@python, zach.ware
priority: normal
severity: normal
status: open
title: Several minor doc issues
type: enhancement
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36883/PythonDocErreurs141010.pdf

___
Python tracker 

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



[issue20569] IDLE : Add clipboard history feature

2014-10-11 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> rejected
stage: test needed -> resolved

___
Python tracker 

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



[issue22598] Add mUTF-7 codec (UTF-7 modified for IMAP)

2014-10-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

See http://tools.ietf.org/html/rfc3501#section-5.1.3
Note how detailed the specification of "modified utf-7" is :-)

--
nosy: +pitrou

___
Python tracker 

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



[issue9179] Lookback with group references incorrect (two issues?)

2014-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which fixes lookbacks with group references and with group 
conditionals. I have used Andrew's examples as the base for tests.

--
assignee:  -> serhiy.storchaka
components: +Regular Expressions
keywords: +patch
nosy: +ezio.melotti
stage:  -> patch review
versions: +Python 3.4, Python 3.5 -Python 2.6, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file36882/re_getwidth.patch

___
Python tracker 

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



[issue22612] Add block info to unicodedata

2014-10-11 Thread flying sheep

New submission from flying sheep:

See also #6331.

The repo https://github.com/nagisa/unicodeblocks contains pretty much the 
functionality i’d like to see: a way to get access to information about all 
blocks, and a way to get the block name a char is in.

I propose to include something very similar to those two APIs in unicodedata:

unicodedata.Block: class with start, end, and name property.

its __contains__ should work for single-char-strings (which tests if that char 
is in the block) and for ints (which tests if the codepoint is in the block)

maybe make it iterable over its chars?

unicodedata.blocks: OrderedDict of str (block name) → Block object mappings 
ordered by Block.start.

then blocks.keys() would yield the names in order, and blocks.values() the 
block objects in order.

unicodedata.block_of(chr, name_only=False): returns the Block object for which 
“chr in block” is True, or its name.

---

alternative: make the Block class an unfancy namedtuple without __contains__ 
method.

---

Together with #18234, fixing this bug will complete UnicodeData support in 
python, i guess.

--
messages: 229101
nosy: flying sheep
priority: normal
severity: normal
status: open
title: Add block info to unicodedata
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue18234] Unicodedata module should provide access to codepoint aliases

2014-10-11 Thread flying sheep

flying sheep added the comment:

IDK if it came with unicode 7.0, but there is clarification:

# Note that currently the only instances of multiple aliases of the same
# type for a single code point are either of type "control" or "abbreviation".
# An alias of type "abbreviation" can, in principle, be added for any code
# point, although currently aliases of type "correction" do not have
# any additional aliases of type "abbreviation". Such relationships
# are not enforced by stability policies.

it says “currently”, so it isn’t guaranteed to stay that way, and other types 
could also be specified multiple times in the future.

so as much as i’d like it if we could follow Alexander’s proposal, i think we 
shouldn’t extend the function that way if it would either return a name string, 
a default value, a list of aliases, or raise an exception: too complex.

i think we should create:

unicodedata.aliases(chr, 
type=(None|'correction'|'control'|'alternate'|'figment'|'abbreviation'))

and make

aliases(chr) return a dict with all aliases for the character, and make
aliases(chr, type) return a list of aliases for that type (possibly empty)

examples:

aliases('\b') == {'control': ['BACKSPACE'], 'abbreviation': ['BS']}
aliases('\b', 'control') == ['BACKSPACE']
aliases('b') == {}
aliases('b', 'control') == []

---

alternative: when specifying a type, it’ll raise an error if no alias of this 
type exists. but because of the sparse nature of aliases i’m against that.

--
nosy: +flying sheep

___
Python tracker 

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



[issue21061] Is contextlib.redirect_stdout reentrant or not?

2014-10-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> ncoghlan

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread Georg Brandl

Georg Brandl added the comment:

> Sorry for not being more explicit and for being lazy doing a copy paste from 
> msg 229022:

I see, this was split off another issue (which was already closed).  I agree 
that a bit more verbosity in the initial description would have prevented 
confusion :)

--

___
Python tracker 

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



[issue21061] Is contextlib.redirect_stdout reentrant or not?

2014-10-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'll spend some time taking this one under consideration.

Keyword arguments for dicts and dict-like classes are already somewhat limited 
(only non-keyword identifiers) that why Guido resisted adding them in the first 
place.   And, in the context of OrderedDicts, they aren't really useful at all 
(because the order gets scrambled).

I'm reluctant to make the number of changes required in order to support this 
corner case.  The ship for Python 2.7 sailed a long time ago and it is risky to 
make changes like this.  After the patch, the code is less readable, harder to 
get right, harder to maintain, and not as performant.

On the other hand, adding "self" would be a nice-to-have, so it is worth 
thinking about.

--
priority: normal -> low

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread Georg Brandl

Georg Brandl added the comment:

> You seem to be confusing the feature itself with the implementation.

> The fact that there is an acceptable implementation is another matter
> (and subtest_in_range.diff is not an implementation).

You yourself were calling it a "solution".

A feature proposal should either have a description of the new feature, or a 
patch.  Since there is no feature description, I reviewed the patch as being an 
implementation of the desired feature.

> This feature is generally useful.

As described in the issue, I disagree.  If the intended feature is more 
comprehensive, please supply an adequate description or a patch that implements 
it.

--

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread Xavier de Gaye

Xavier de Gaye added the comment:

@ Georg Brandl
> I don't think this feature is generally useful enough to be included.
>
> * Since you need to modify the test code anyway (adding the try-except), it 
> is probably just as much work to do the selection there.


You seem to be confusing the feature itself with the implementation.
This feature is generally useful.
The fact that there is an acceptable implementation is another matter (and 
subtest_in_range.diff is not an implementation).

--

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> With the attached patch (the patch does reintroduce the bug in 
> 'test_incref_decref_API' of issue 22588 for testing purposes)

Sorry for not being more explicit and for being lazy doing a copy paste from 
msg 229022:

* this is not a patch, obviously a patch would not attempt to reintroduce a bug 
(as stated above), this is an experiment that you must 'patch' in order to test 
it (I did mention 'testing purposes' in this messagei, see above)
* this was witten in msg 229022 in answer to "Does anyone know how to 
automatize the dichotomy process ?" from Victor
* it only deals with subsets as a partial attempt to answer this question 
mostly because this is were most of the time is spent when investigating issue 
22588

--

___
Python tracker 

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



[issue22611] pip needs ctypes

2014-10-11 Thread Donald Stufft

Donald Stufft added the comment:

This is no longer the case in the next version of pip.

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

___
Python tracker 

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



[issue22611] pip needs ctypes

2014-10-11 Thread Antoine Pitrou

New submission from Antoine Pitrou:

I think a bit weird that pip needs ctypes inconditionally. Note the following 
traceback is on an Unix platform and ctypes seems imported by a... win32 shell 
coloring library!

==
FAIL: test_with_pip (test.test_venv.EnsurePipTest)
--
Traceback (most recent call last):
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/test/test_venv.py",
 line 356, in test_with_pip
with_pip=True)
subprocess.CalledProcessError: Command '['/tmp/tmppsirrkh8/bin/python', '-Im', 
'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/test/test_venv.py",
 line 362, in test_with_pip
self.fail(msg.format(exc, details))
AssertionError: Command '['/tmp/tmppsirrkh8/bin/python', '-Im', 'ensurepip', 
'--upgrade', '--default-pip']' returned non-zero exit status 1

**Subprocess Output**
Traceback (most recent call last):
  File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/runpy.py", 
line 170, in _run_module_as_main
"__main__", mod_spec)
  File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/runpy.py", 
line 85, in _run_code
exec(code, run_globals)
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__main__.py",
 line 4, in 
ensurepip._main()
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__init__.py",
 line 209, in _main
default_pip=args.default_pip,
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__init__.py",
 line 116, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__init__.py",
 line 40, in _run_pip
import pip
  File "/tmp/tmpvhf7jjwp/pip-1.5.6-py2.py3-none-any.whl/pip/__init__.py", line 
9, in 
  File "/tmp/tmpvhf7jjwp/pip-1.5.6-py2.py3-none-any.whl/pip/log.py", line 9, in 

  File 
"/tmp/tmpvhf7jjwp/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/__init__.py",
 line 2, in 
  File 
"/tmp/tmpvhf7jjwp/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/initialise.py",
 line 5, in 
  File 
"/tmp/tmpvhf7jjwp/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/ansitowin32.py",
 line 6, in 
  File 
"/tmp/tmpvhf7jjwp/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/winterm.py",
 line 2, in 
  File 
"/tmp/tmpvhf7jjwp/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/colorama/win32.py",
 line 7, in 
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ctypes/__init__.py",
 line 7, in 
from _ctypes import Union, Structure, Array
ImportError: No module named '_ctypes'


(from 
http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/8753/steps/test/logs/stdio)

--
components: Demos and Tools, Library (Lib)
messages: 229093
nosy: Marcus.Smith, dstufft, ncoghlan, pitrou, pmoore
priority: normal
severity: normal
status: open
title: pip needs ctypes
versions: 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



[issue22608] test_socket fails with sem_init: Too many open files

2014-10-11 Thread R. David Murray

R. David Murray added the comment:

I think this is a consequence of issue 11798.  Since Events use filesystem 
based semaphores on FreeBSD (I think?), it seems reasonable to "fix" this in 
test_socket specifically in 2.7.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue15569] Doc doc: incorrect description of some roles as format-only

2014-10-11 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: needs patch -> resolved

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2014-10-11 Thread Berker Peksag

Changes by Berker Peksag :


--
stage:  -> needs patch

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2014-10-11 Thread Ezio Melotti

Ezio Melotti added the comment:

+1

--

___
Python tracker 

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



[issue18643] add a fallback socketpair() implementation in test.support

2014-10-11 Thread STINNER Victor

STINNER Victor added the comment:

> In this case, socketpair-4.diff looks good to me. You can commit your
patch in Python 3.5.

Hey Charles-François, can you commit your patch? I forgot that you did commited 
it yet, and I expected socket.socketpair() to be available on all platforms.

--

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
keywords: +patch
nosy: +rhettinger, serhiy.storchaka
stage:  -> patch review
versions: +Python 2.7, Python 3.5
Added file: http://bugs.python.org/file36881/collections_pos_only_params.patch

___
Python tracker 

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



[issue12916] Add inspect.splitdoc

2014-10-11 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi all,

Here is the last version of this patch for a review, the tests are ok.

Thank you in advance for the time.

Stephane

--
Added file: http://bugs.python.org/file36880/issue12916-3.patch

___
Python tracker 

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



[issue21687] Py_SetPath: Path components separated by colons

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2d150c01bf7e by Georg Brandl in branch '3.4':
Closes #21687: delimiter in Py_SetPath is platform dependent
https://hg.python.org/cpython/rev/2d150c01bf7e

--
nosy: +python-dev
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



[issue18959] Create a "Superseded modules" section in standard library ToC

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7276bc0b0318 by Georg Brandl in branch '3.4':
Closes #18959: move optparse and imp to new "superseded modules" chapter
https://hg.python.org/cpython/rev/7276bc0b0318

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> 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



[issue21675] Library - Introduction - paragraph 5 - wrong ordering

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 52b9d79f6bfa by Georg Brandl in branch '3.4':
Closes #21675: fix ordering of description in library intro
https://hg.python.org/cpython/rev/52b9d79f6bfa

--
nosy: +python-dev
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



[issue21189] Broken link to patch

2014-10-11 Thread Georg Brandl

Georg Brandl added the comment:

Ping?

--

___
Python tracker 

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



[issue15569] Doc doc: incorrect description of some roles as format-only

2014-10-11 Thread Georg Brandl

Changes by Georg Brandl :


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

___
Python tracker 

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



[issue18959] Create a "Superseded modules" section in standard library ToC

2014-10-11 Thread Georg Brandl

Georg Brandl added the comment:

Thanks for the patch.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue15569] Doc doc: incorrect description of some roles as format-only

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bef3ddfe5d09 by Georg Brandl in branch 'default':
Closes #15569: some roles do create more than formatting
https://hg.python.org/devguide/rev/bef3ddfe5d09

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> 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



[issue15569] Doc doc: incorrect description of some roles as format-only

2014-10-11 Thread Georg Brandl

Georg Brandl added the comment:

Thanks!

--
nosy: +georg.brandl
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue22480] SystemExit out of run_until_complete causes AttributeError when using python3 -m

2014-10-11 Thread STINNER Victor

Changes by STINNER Victor :


--
status: open -> closed

___
Python tracker 

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



[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-11 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fb65b9ed8023 by Victor Stinner in branch '3.4':
Issue #22601: run_forever() now consumes BaseException of the temporary task
https://hg.python.org/cpython/rev/fb65b9ed8023

New changeset 8437e2bfe7a9 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #22601: run_forever() now consumes BaseException of the
https://hg.python.org/cpython/rev/8437e2bfe7a9

--
nosy: +python-dev

___
Python tracker 

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



[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-11 Thread STINNER Victor

STINNER Victor added the comment:

I pushed the commit to Tulip: changeset e610f1408243.

--

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-11 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

2014-10-11 Thread STINNER Victor

STINNER Victor added the comment:

I tried to reply to Guido on Rietveld but I got an HTTP error 500.

Guido wrote:
> LGTM.

Cool, I will commit my change to Tulip & Python.

> In the long run I think we'll need to revisit the decision to not catch
> BaseException in a few places. There are quite a few issues around these, if 
> the
> app *does* catch them and keeps going there may be some confused states.

There is at least another issue: #22429.

--

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-11 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue22610] test_ftplib fails with sem_init: Too many open files

2014-10-11 Thread Urs Traber

New submission from Urs Traber:

same issue as http://bugs.python.org/issue22608

e.g.

test_sanitize (__main__.TestTLS_FTPClassMixin) ... sem_init: Too many open files
ERROR

Fixed by setting the allocated Event objects to None when not needed anymore.

--
components: Tests
files: test_ftplib.patch
keywords: patch
messages: 229077
nosy: Urs.Traber
priority: normal
severity: normal
status: open
title: test_ftplib fails with sem_init: Too many open files
type: resource usage
versions: Python 2.7
Added file: http://bugs.python.org/file36879/test_ftplib.patch

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-11 Thread Evgeny Kapun

New submission from Evgeny Kapun:

>>> import collections
>>> collections.Counter(self=1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() got multiple values for argument 'self'
>>> collections.OrderedDict(self="test")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() got multiple values for argument 'self'
>>> collections.UserDict(self="test")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() got multiple values for argument 'self'

Python surely should have positional-only parameters.

--
components: Library (Lib)
messages: 229076
nosy: abacabadabacaba
priority: normal
severity: normal
status: open
title: Constructors of some mapping classes don't accept `self` keyword argument
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue22608] test_socket fails with sem_init: Too many open files

2014-10-11 Thread Urs Traber

New submission from Urs Traber:

test_socke.py does not clean up its event objects used for synchronization. 
This may cause multiple such ERRORs (*):

testLinebufferedWrite (__main__.LineBufferedFileObjectClassTestCase) ... 
sem_init: Too many open files
ERROR

Fixed by setting the allocated Event objects to None at the end of a test (see 
patch attached).



*) e.g. on Digital UNIX with a default of maximal 4096 open files per process

--
components: Tests
files: test_socket.patch
keywords: patch
messages: 229075
nosy: Urs.Traber
priority: normal
severity: normal
status: open
title: test_socket fails with sem_init: Too many open files
type: resource usage
versions: Python 2.7
Added file: http://bugs.python.org/file36878/test_socket.patch

___
Python tracker 

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



[issue21061] Is contextlib.redirect_stdout reentrant or not?

2014-10-11 Thread Berker Peksag

Berker Peksag added the comment:

Here is a simple patch to correct the redirect_stdout documentation.

--
keywords: +patch
nosy: +berker.peksag
stage:  -> patch review
Added file: http://bugs.python.org/file36877/issue21061.diff

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread Georg Brandl

Georg Brandl added the comment:

> I requested the feature because I regulary need bisect (once a month, or 
> maybe two months).

Always within subtests?

--

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread STINNER Victor

STINNER Victor added the comment:

I requested the feature because I regulary need bisect (once a month, or
maybe two months).

--

___
Python tracker 

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



[issue22218] Fix more compiler warnings "comparison between signed and unsigned integers"

2014-10-11 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi Victor,

Here is a small patch for the unicodeobject.c file.

I am not sure if it's the correct solution to this problem, but for me, the 
size parameter should be a unsigned long and not a signed.

--
nosy: +matrixise
Added file: http://bugs.python.org/file36876/fix_warning_unicodeobject.diff

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread Georg Brandl

Georg Brandl added the comment:

I don't think this feature is generally useful enough to be included.  

* Since you need to modify the test code anyway (adding the try-except), it is 
probably just as much work to do the selection there.

* Why only add selection of subtests, and not of all tests?

In addition, the patch would have to be reworked: eval()ing an environment 
variable is not acceptable.

BTW, I think the commonly used term for this is "bisection".

--
nosy: +georg.brandl, michael.foord

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread Xavier de Gaye

Xavier de Gaye added the comment:

With the attached patch (the patch does reintroduce the bug in 
'test_incref_decref_API' of issue 22588 for testing purposes), it is possible 
to find the failing subtest rapidly:

After identifying the failing test, print the list of subtests in this test and 
their number (35 subsets):
$ export SUBTEST_RANGE="[]"
$ ./python -m test -m test__testcapi test_capi

Then run:
$ ./python -m test -m test__testcapi -R 23:23 test_capi

after modifying, each time, the range of subtests to execute, with:
$ export SUBTEST_RANGE="range(1,18)"# tests 1-17   result: fail
$ export SUBTEST_RANGE="range(1,9)" # tests 1-8result: pass
$ export SUBTEST_RANGE="range(9,13)"# tests 9-12   result: fail
$ export SUBTEST_RANGE="range(9,11)"# tests 9-10   result: fail
$ export SUBTEST_RANGE="[9]"# so it must be test #9, check it now

The strong limitation with this solution is that the subTest context manager 
must now be enclosed in a 'try except unittest.SkipTest' clause and that the 
context manager is used more than 100 times in the test suite.

--
keywords: +patch
Added file: http://bugs.python.org/file36875/subtest_in_range.diff

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread Xavier de Gaye

Xavier de Gaye added the comment:

See msg 228968 for the rationale.

--

___
Python tracker 

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



[issue22607] find by dichotomy the failing test

2014-10-11 Thread Xavier de Gaye

New submission from Xavier de Gaye:

This issue stems from issue 22588.

See message 228968 for the rationale:
Automatize the dichotomy process used to to identify memory leaks, crash, 
reference leak, resource leak, etc. in a failing test.

--
components: Tests
messages: 229067
nosy: haypo, xdegaye
priority: normal
severity: normal
status: open
title: find by dichotomy the failing test
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue22001] containers "same" does not always mean "__eq__".

2014-10-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Ah... "be the same object or compare equal" sounds much better.

Yes, the plain language is clear and reads nicely.

> We can't say "will normally", since we don't know about 
> the infinite  number of possible container types that people 
> might create. The most we can say is that *builtin* container 
> types will [assuming that this is  the intent] or that general 
> containers *may*.

"general containers may" is most accurate.  

> Several suggested changes:

Jim, can you propose a much more minimal edit?

As you pointed-out, the underlying logic is "containers are permitted to (and 
generally do) read "same as" as "is or __eq__".   I don't think we should say 
much more than that in the section on expressions.

Any notes on NaNs should probably be in a section talking about the float type. 
 The weirdness of NaNs is a feature of the NaNs, not a feature of the entire 
language.  We definitely don't want a NaN note added to the documentation of 
every container.

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I suggest implementing `Counter.__lt__` which will be a 
> partial order, similarly to `set.__lt__`.

This would be reasonable if the counter were a strict stand-alone multiset or 
bag; however, the core design is much looser than that (supporting negative 
counts for example).

It would be more accurate to think about the Counter as a dict that returns 0 
for missing keys and has few extra methods that can be handy in the content of 
counting things.

Accordingly, a partial ordering operator wouldn't be well-defined for some of 
the intended use cases. 

The addition of subset/superset operations was considered and rejected during 
the original design phase (the omission was intentional).  It is better to 
leave this to the user to decide what they want to do and how they intend to do 
so.  After all, it is as easily to work with as a regular dict.  You can access 
it directly or subclass it to fit your own needs.

The starting point for this class (when first proposed and endorsed by Guido) 
was:

   class Counter(dict):
   def __missing__(self, key):
   return 0

That core idea is dirt simple and it is not hard to build your own variants if 
the one in collections doesn't meet your needs.

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

___
Python tracker 

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



[issue22533] Counter with no keys does not compare equal to Counter with keys which zero value

2014-10-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> It is my thought that a Counter with all its keys set to zero 
> is as empty as a Counter with no keys

If the counter were a stand-alone multiset or bag class, this might be a 
reasonable thing to do.

However, for better or for worse, the design of the counter is primarily "a 
dict with a __missing__ that returns 0 and adds some handy methods useful in 
the context of dicts being used for counting".   This gives it flexibility, 
simplicity, speed, and makes it more or less substitutable for regular dicts in 
functions that expect regular dicts.  IIRC, this is the basic design that Guido 
endorsed when the idea of a counter was first proposed.

> I agree it's sort of weird, but I feel like fixing it will 
> just break a ton of existing code.

It is sort of weird, but that was the intended behavior (trying to keep the 
counter as dict-like as possible), and you're correct that changing it now 
would risk either breaking or substantially slowing code existing code.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue22080] Add windows_helper module helper

2014-10-11 Thread Zachary Ware

Zachary Ware added the comment:

eryksun: You commented on my review comment; does Claudiu's latest patch look 
good to you?

--
nosy: +eryksun

___
Python tracker 

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