[issue18349] argparse usage should preserve () in metavars such as range(20)

2013-07-15 Thread paul j3

paul j3 added the comment:

This issue should also preserve a metavar like: '(one)two', i.e. '(' at the 
start.  

In http://bugs.python.org/issue10984 these _re replacements are applied to 
individual action strings as well as the whole usage line.  So if () are to be 
removed from '[-h] (-y)', they should also be removed from '(-y)'.

--

___
Python tracker 

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



[issue10042] functools.total_ordering fails to handle NotImplemented correctly

2013-07-15 Thread Katie Miller

Katie Miller added the comment:

Nick is correct; a logic bug was introduced during refactoring, which is fixed 
in the attached patch. The tests introduced with my original patch cover cases 
where an operation is not implemented, so it would be inappropriate to add a 
test case there that would have caught the aforementioned error. Instead I have 
added some extra cases to the existing total_ordering tests; these now fail 
when encountering this (now fixed) logic error.

--
Added file: http://bugs.python.org/file30923/10042_revised.patch

___
Python tracker 

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



[issue10042] functools.total_ordering fails to handle NotImplemented correctly

2013-07-15 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks Katie - Raymond, the patch is ready for review now

If you're happy with it, then the only other things it should need prior to 
commit are NEWS and ACKS entries (I think it's too esoteric a fix to mention in 
What's New).

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue18444] IDLE: Mac OS X pressing ctrl-A in Python shell moved cursor before the prompt, which then makes the keyboard unresponsive.

2013-07-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

IIRC the key bindings that are currently used on OSX basicly are partially 
based on the key bindings on "classic macos", and partially on using the CMD 
key instead of the ALT key.

It would be nice to have a clean set of key bindings for OSX that's based on 
the default key bindings for text widgets in Cocoa[1], with "logical" additions 
for IDLE-specific functionality.

It would also be nice if the key bindings for the various platforms could be 
kept in sync [2], that makes it easier to switch between platforms and is 
easier for educators. 

BTW. I don't think it using function keys for key bindings is necessarily a 
good idea on OSX. I'm pretty sure that the default keyboard settings on OSX 
require two key presses to use a function key on OSX laptops (the "fn" key and 
the actual function key) because the keys are used for their hardware control 
role without the "fn" key (that is, "fn" + "f8" is F8, while just "f8" is 
"play/pauze"). A number of function keys also have system-wide shortcuts (such 
as "show desktop"), I'm not sure if those shortcuts are still enabled by 
default on new installs.


[1] More or less documented here: 
,
 the file 
"/System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict" 
is a (binary) plist that contains the default keybinding.

[2] With the obvious differences, such as using the CMD key on OSX and ALT on 
Windows.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue18436] Add mapping of symbol to function to operator module

2013-07-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is a purpose of this feature? Why you need it?

--
nosy: +rhettinger

___
Python tracker 

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



[issue18305] [patch] Fast sum() for non-numbers

2013-07-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> On the contrary, it will reduce memory usage and creation time compared to 
> regular tuples, because in cases like:
>   c = a + b
> you do not have to spend time and memory for allocating and copying elements 
> of "a".

This is not a common case. A common case is creating short tuples and keeping a 
lot of tuples in memory.

> The only case when it could use more memory is if you explicitly delete "c" 
> after that operation. But this can be solved too, internal storage can be 
> resized to a smaller value when its tail elements are not used any more.

No. For fast += you need keep not only a size of tuple, but also a size of of 
allocated memory. It's a cause of sys.getsizeof([1, 2]) > sys.getsizeof((1, 2)).

For fast + you need even more complicated internal structure.

Tuples should be compact and fast. You shouldn't optimize a rare case at the 
cost of regression in common usage.

--

___
Python tracker 

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



[issue18305] [patch] Fast sum() for non-numbers

2013-07-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +rhettinger

___
Python tracker 

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



[issue18356] help(numpy) causes segfault on exit

2013-07-15 Thread Torim

Torim added the comment:

I would add even the linked solution from StackOverflow.com does not work 
reliably for me. Try to get at the end of numpy document - text vanishes and 
possibly lose chars displaying in terminal. Need to reset it.

Modified pydoc's pipepager method this way:
def pipepager(text, cmd):
"""Page through text by feeding it to another program."""
#pipe = os.popen(cmd, 'w')
import subprocess
pipep = subprocess.Popen(cmd, stdin=subprocess.PIPE, shell=True)
try:
#pipe.write(text)
#pipe.close()
pipep.communicate(text)
except IOError:
pass # Ignore broken pipes caused by quitting the pager program.


Works for me so far, although the exact cause of issue with the stock/default 
pydoc is still not known.

--
components: +Library (Lib)
nosy: +torim

___
Python tracker 

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



[issue18449] Demo 'ss1.py' crash in python3

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a7b5e9ca8eee by Serhiy Storchaka in branch '3.3':
Issue #18449: Make Tools/demo/ss1.py work again on Python 3.  Patch by
http://hg.python.org/cpython/rev/a7b5e9ca8eee

New changeset 34333dab3ac4 by Serhiy Storchaka in branch 'default':
Issue #18449: Make Tools/demo/ss1.py work again on Python 3.  Patch by
http://hg.python.org/cpython/rev/34333dab3ac4

--
nosy: +python-dev

___
Python tracker 

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



[issue18449] Demo 'ss1.py' crash in python3

2013-07-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your report and patch.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.3

___
Python tracker 

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



[issue17202] Add .bat line to .hgeol

2013-07-15 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Zachary: What Windows version do you use? Glen Linderman claims that at least 
Windows 7 should work fine with cmd files containing only LF, and suggested 
that this may also be the case on Windows XP.

Are you using a non-standard command interpreter by any chance?

--

___
Python tracker 

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



[issue17482] functools.update_wrapper mishandles __wrapped__

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 13b8fd71db46 by Nick Coghlan in branch 'default':
Close issue 17482: don't overwrite __wrapped__
http://hg.python.org/cpython/rev/13b8fd71db46

--
nosy: +python-dev
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue17482] functools.update_wrapper mishandles __wrapped__

2013-07-15 Thread Nick Coghlan

Nick Coghlan added the comment:

I decided I can live with the risk of this biting someone in 3.3 - the 
combination of using multiple levels of wrapping *and* using __wrapped__ for 
more than merely introspection seems remote enough to make being conservative 
with the behavioural change the better course.

--
versions:  -Python 3.3

___
Python tracker 

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



[issue18443] Misc/Readme still documents TextMate

2013-07-15 Thread Févry Thibault

Févry Thibault added the comment:

The issue with Vim files has been fixed but not this one.
Adding a patch in case it is faster for anyone, as well as properly triaging 
the bug report. This also fixes the list to put in back in alphabetical order.

--
assignee:  -> docs@python
components: +Documentation
keywords: +patch
nosy: +docs@python, eric.araujo, ezio.melotti, georg.brandl
type:  -> enhancement
versions: +Python 3.4
Added file: http://bugs.python.org/file30924/readme.patch

___
Python tracker 

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



[issue18457] Fix and cleanup the ss1.py demo

2013-07-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a patch which fixes some bugs in Tools/demo/ss1.py:

* Saving formulas containing & and < symbols.
* Saving complex numbers.

Also it a little cleanups the code:

* Using xml.sax.saxutils.escape instead of html.escape.
* Using the with statement for file I/O.
* Removed out-of-dated and redundant code.

On Python 2 the ss1.py demo is totally broken due to using out-of-dated rexec 
module.

--
assignee: serhiy.storchaka
components: Demos and Tools
files: demo_ss1.patch
keywords: patch
messages: 193089
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Fix and cleanup the ss1.py demo
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30925/demo_ss1.patch

___
Python tracker 

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



[issue18458] libedit history offset workaround

2013-07-15 Thread Ronald Oussoren

New submission from Ronald Oussoren:

Modules/readline.c contains a workaround for a bug in the readline emulation of 
libedit: that emulation uses a different starting offset for the history than 
the real readline.

In more recent versions of libedit (such as the one you can now download from 
) the bug has been fixed and the workaround 
causes problems.

The attached patch dynamicly detects if the workaround is necessary.

NOTE: Actually using the trysoee.dk libedit requires a patch to setup.py, that 
version of libedit does not install libreadline.dylib, only libedit.dylib.

--
assignee: ronaldoussoren
files: dynamic_editline_workaround_detection.txt
messages: 193090
nosy: ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: libedit history offset workaround
versions: Python 2.7, Python 3.3, Python 3.4
Added file: 
http://bugs.python.org/file30926/dynamic_editline_workaround_detection.txt

___
Python tracker 

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



[issue18458] libedit history offset workaround

2013-07-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

(set as "crash" because the current workaround causes a crash with recent 
versions of libedit)

--
keywords: +needs review, patch
stage:  -> patch review
type:  -> crash

___
Python tracker 

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



[issue18459] readline: libedit support on non-apple platforms

2013-07-15 Thread Ronald Oussoren

New submission from Ronald Oussoren:

Modules/readline.c contains some code that improves interop with the readline 
emulation in libedit. That interop code is currently guarded by '#ifdef 
__APPLE__' preprocessor tests.

This should be replaced by '#if HAVE_LIBEDIT' to make it possible to use the 
same interop code on other platforms with libedit (such as BSD systems). 

A patch should have two parts:

1) Detect in either configure or setup.py if libedit's readline emulation
   will/should be used.

2) Change the __APPLE__ guards by HAVE_LIBEDIT guards.

--
messages: 193092
nosy: ronaldoussoren
priority: normal
severity: normal
stage: needs patch
status: open
title: readline: libedit support on non-apple platforms
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue13631] readline fails to parse some forms of .editrc under editline (libedit) emulation on Mac OS X

2013-07-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I can confirm the problem and that the patch fixes the issue.

I'll try to commit a fix later this week.

--
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue18457] Fix and cleanup the ss1.py demo

2013-07-15 Thread Févry Thibault

Févry Thibault added the comment:

These are some nice improvements, but there is still a crash if you type 
=1000**5000 .

--
nosy: +iwontbecreative

___
Python tracker 

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



[issue13266] Add inspect.unwrap(f) to easily unravel "__wrapped__" chains

2013-07-15 Thread Nick Coghlan

Nick Coghlan added the comment:

Added a version that allows the iteration to be terminated early if certain 
criteria are met, which is needed for a robust implementation of 
inspect.signature.

However, I'm thinking the callback based approach in this version isn't 
especially Pythonic, so I'm thinking it may be better to change the API to a 
generator function. That way the iterator can still take care of the wrapper 
loop detection, without needing the clumsy predicate API for early termination.

Instead, you would just use an ordinary search loop, and if you wanted the 
innermost function unconditionally you could do something like:

for f in functools.unwrap(original): pass
# f is now the innermost function

--
Added file: http://bugs.python.org/file30927/issue13266_inspect_unwrap_4.diff

___
Python tracker 

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



[issue18460] .chm documentation files advertised in download.html but not there.

2013-07-15 Thread Févry Thibault

New submission from Févry Thibault:

Just like it happenned with 2.7.3, the .chm help files are not present in the 
download pages.

The download page (e.g : http://docs.python.org/3/download.html) advertises the 
presence of .chm files but they are not there. 

I am unsure whether or not these files are still built, but as this as happend 
for all 3.* versions and there is no previous bug report, it might be worth 
looking at simply removing support for these files.

--
assignee: docs@python
components: Documentation
messages: 193096
nosy: docs@python, iwontbecreative
priority: normal
severity: normal
status: open
title: .chm documentation files advertised in download.html but not there.
type: enhancement
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue18461] X Error in tkinter

2013-07-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

When run Tools/demo/ss1.py under Linux and enter the formula "='0'*0x1000", the 
application will crash with the following message:

X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  53 (X_CreatePixmap)
  Serial number of failed request:  1025
  Current serial number in output stream:  1100

Any multiplier between 0x1000 and 0x1fff crashes. With multipliers >= 0x2000 
only the number of zeros over 0x2000 is displayed. Multiplier between 0x3000 
and 0x3fff crashes again.

Hint: The width of '0' in the used font is  8 pixels. 0x2000 * 8 = 2**16. If 
the width of cell is a 16-bit signed integer, it is negative for the number of 
zeros between 0x1000 and 0x1fff and wrapped after 0x2000 zeros.

It may be a bug either in Tkinter, in Tk, or in X Window.

--
components: Tkinter
messages: 193097
nosy: gpolo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: X Error in tkinter
type: crash

___
Python tracker 

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



[issue18457] Fix and cleanup the ss1.py demo

2013-07-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for report. This is a separated issue #18461.

--

___
Python tracker 

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



[issue18461] X Error in tkinter

2013-07-15 Thread Févry Thibault

Changes by Févry Thibault :


--
nosy: +iwontbecreative

___
Python tracker 

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



[issue17202] Add .bat line to .hgeol

2013-07-15 Thread Zachary Ware

Zachary Ware added the comment:

I'm on 32 bit Windows 7 Pro, SP1, and have also reproduced the issue on 64 bit 
Windows 7 Home Premium, SP1. I use the standard Command Prompt (cmd.exe) on 
both.

--

___
Python tracker 

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



[issue18181] super vs. someclass.__getattribute__

2013-07-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

There now is a PEP for this issue: .

The current version of the PEP describes a different API than documented by the 
attached proposal and the prove of concept code. I'm working on an updated 
implementation.

--

___
Python tracker 

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



[issue18462] Download > Other documentation page contains a link to a french poker site

2013-07-15 Thread Févry Thibault

New submission from Févry Thibault:

The python for PSP (http://python-psp.net/trac) now redirects to python-psp.net 
which is a poker site.

--
assignee: docs@python
components: Documentation
messages: 193101
nosy: docs@python, iwontbecreative
priority: normal
severity: normal
status: open
title: Download > Other documentation page contains a link to a french poker 
site
type: enhancement

___
Python tracker 

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



[issue18463] Download > Other documentation page outdated/dead links

2013-07-15 Thread Févry Thibault

New submission from Févry Thibault:

See issue 18462 and
The link to the series-60 nokia page directs to an empty page : 
http://www.developer.nokia.com/Community/Wiki/Nokia_Open_Source/ with comments 
in history : 
09:15, 24 April 2013 hamishwillee (Talk | contribs) deleted page Nokia Open 
Source/ (Stop creating htis page or you will be banned.)
04:20, 12 March 2013 hamishwillee (Talk | contribs) deleted page Nokia Open 
Source/ (There is no point to this topic. No content)
05:37, 4 March 2013 hamishwillee (Talk | contribs) deleted page Nokia Open 
Source/ (Appears to have been created by accident)

- The download are leak for python for VMS is dead : 
http://www.pi-net.dyndns.org/anonymous/kits/

--
assignee: docs@python
components: Documentation
messages: 193102
nosy: docs@python, iwontbecreative
priority: normal
severity: normal
status: open
title: Download > Other documentation page outdated/dead links
type: enhancement

___
Python tracker 

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



[issue12944] Accept arbitrary files for packaging's upload command

2013-07-15 Thread Éric Araujo

Éric Araujo added the comment:

With the lift of the feature freeze decided at PyCon 2013, this feature request 
could be done for 3.4.

--
components: +Distutils -Distutils2
versions: +Python 3.4 -3rd party

___
Python tracker 

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



[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread A. Jesse Jiryu Davis

A. Jesse Jiryu Davis added the comment:

Charles-François, I agree that many guarantees are impossible to enforce in a 
multithreaded application that calls fork().

But the threading module does try to guarantee, after a fork, that isAlive() is 
False for all threads but one. I claim that it can more reliably provide this 
guarantee with my patch applied.

--

___
Python tracker 

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



[issue11122] bdist_rpm should use rpmbuild, not rpm

2013-07-15 Thread James Bennet

James Bennet added the comment:

I have observed this bug under CentOS 5.9 using the version of 
python-setuptools from the official CentOS repository. -ba is not a valid 
option for that version of RPM. I am able to get further by installing the 
rpm-build package.

--
nosy: +James.Bennet

___
Python tracker 

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



[issue18436] Add mapping of symbol to function to operator module

2013-07-15 Thread Zachary Ware

Zachary Ware added the comment:

The purpose is to make usage of the operator module more readable, particularly 
for some of the more exotic operators.  For instance, I find 
``operator.get_op(">>=")`` to be a lot more obvious about what's going to 
happen than ``operator.irshift``.

Also, I think it is helpful to have available a listing of all the operators 
that Python supports.  If we're going to have such a listing, why not make it a 
mapping of op to function?  And once we have such a mapping, it would be nice 
to have a nice interface to it.

Having this available would make it easy to implement the kind of function that 
Nick mentioned in the python-ideas thread, that takes an operator string 
instead of only a function.

I will admit that the need is not great, and obviously this isn't something 
that someone who needs it couldn't do themselves.  But I think the convenience 
of it makes it at least worth consideration.

--

___
Python tracker 

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



[issue18436] Add mapping of symbol to function to operator module

2013-07-15 Thread Nick Coghlan

Nick Coghlan added the comment:

I liked Ron's suggestion of using it to improve the output of help() (by 
getting access to the docstrings of the operator functions, and then enhancing 
those to be a bit more informative)

--

___
Python tracker 

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



[issue18461] X Error in tkinter

2013-07-15 Thread Zachary Ware

Zachary Ware added the comment:

I've done a small amount of testing on Windows (both with the issue18457 patch 
applied and without), and there is no such crash there.  Output isn't what is 
expected (the cell is lengthened, but nothing is shown), but no crash.

--
nosy: +zach.ware

___
Python tracker 

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



[issue12944] Accept arbitrary files for packaging's upload command

2013-07-15 Thread Aaron Meurer

Changes by Aaron Meurer :


--
nosy: +Aaron.Meurer

___
Python tracker 

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



[issue18181] super vs. someclass.__getattribute__

2013-07-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

issue18181-locallookup-only-super.txt implements the current version of PEP 
447, but only for the super object. In this version of the  patch normal 
attribute lookup (object.__getattribute__ and PyObject_GenericGetAttr) are not 
yet affected.

Another open issue: the documentation for the super object itself does not yet 
mention __locallookup__; it probably should but I don't know yet how to cleanly 
add it there.

--
Added file: 
http://bugs.python.org/file30928/issue18181-locallookup-only-super.txt

___
Python tracker 

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



[issue18344] _bufferedreader_read_all() may leak reference to data

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9ce863993a38 by Richard Oudkerk in branch '3.3':
Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
http://hg.python.org/cpython/rev/9ce863993a38

New changeset 9b041f44cb63 by Richard Oudkerk in branch 'default':
Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
http://hg.python.org/cpython/rev/9b041f44cb63

--
nosy: +python-dev

___
Python tracker 

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



[issue18464] Typo in the name of function in test__encoded_words.py

2013-07-15 Thread Vajrasky Kok

New submission from Vajrasky Kok:

There is a typo in the name of function in test__encoded_words.py.

Python 3.4, Lib/test/test_email/test__encoded_words.py, line 78:

def test_q_escpaed_bytes_preserved(self):

It is supposed to be (I guess):

def test_q_escaped_bytes_preserved(self):

--
components: Tests
messages: 193111
nosy: r.david.murray, vajrasky
priority: normal
severity: normal
status: open
title: Typo in the name of function in test__encoded_words.py
versions: Python 3.4

___
Python tracker 

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



[issue11874] argparse assertion failure with brackets in metavars

2013-07-15 Thread Vajrasky Kok

Vajrasky Kok added the comment:

paul j3, thanks for reviewing my patch and giving me credit in your patch for 
another ticket.

Yeah, as you could see, the reason I return arg_parts and text is because the 
text still needs to undergo the cleanup process. You solved it by putting 
cleaning up in inner function.

I am thinking whether it is best to do "assert ' '.join(opt_parts) == 
opt_usage" inside _format_actions_usage helper function.

In that way, we can avoid returning the text. We can return only the arg_parts.

Anyway, my patch still got some unused variables, notably part_regexp and 
inner. My bad.

Let me check the code more deeply. See whether I can architect my patch in a 
better way. Maybe we can avoid building separate list inside 
_format_actions_usage.

Beside of that, this bug is not introduced solely by bracket character. It 
needs another non-space character on the right side of it.

This line is fine:
parser.add_argument ('--b', metavar="[innerpart] outerpart")

This line will fail the assertion:
parser.add_argument ('--b', metavar="[innerpart]outerpart")

--

___
Python tracker 

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



[issue18465] There are unused variables and unused import in Lib/test/test_minidom.py

2013-07-15 Thread Vajrasky Kok

New submission from Vajrasky Kok:

The unit test file imports verbose from test.support, but it never used it.

The child2 variable inside testRemoveAttributeNode is not used.

The doc variable inside testHasChildNodes is not used.

Attached the menial fix for this unit test.

--
components: Tests
files: fix_for_unused_variables_and_unused_import_in_test_minidom.txt
messages: 193113
nosy: vajrasky
priority: normal
severity: normal
status: open
title: There are unused variables and unused import in Lib/test/test_minidom.py
versions: Python 3.4
Added file: 
http://bugs.python.org/file30929/fix_for_unused_variables_and_unused_import_in_test_minidom.txt

___
Python tracker 

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



[issue18464] Typo in the name of function in test__encoded_words.py

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6a6ca7c49c2a by R David Murray in branch '3.3':
Closes #18464: fix typo in test name.
http://hg.python.org/cpython/rev/6a6ca7c49c2a

New changeset 47a659bc11c4 by R David Murray in branch 'default':
Merge: Closes #18464: fix typo in test name.
http://hg.python.org/cpython/rev/47a659bc11c4

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18387] Add 'symbols' link to pydoc's html menu bar.

2013-07-15 Thread Zachary Ware

Zachary Ware added the comment:

Aside from '<>' still being present, the patch looks good to me.  There are a 
couple of issues with content, but those are separate from this issue.  (For 
instance, '~', '>>', and '<<' direct to the BITWISE page, which doesn't mention 
any of them at all.)

--
type:  -> enhancement

___
Python tracker 

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



[issue18393] Gestalt() is deprecated on OSX 10.8, remove support?

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ccbaf6762b54 by Ronald Oussoren in branch 'default':
Issue #18393: Remove use of deprecated API on OSX
http://hg.python.org/cpython/rev/ccbaf6762b54

--
nosy: +python-dev

___
Python tracker 

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



[issue18427] str.replace causes segfault for long strings

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 06d9f106c57e by Ronald Oussoren in branch '2.7':
Move entry from #18427 to the right section in the NEWS file
http://hg.python.org/cpython/rev/06d9f106c57e

--

___
Python tracker 

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



[issue18427] str.replace causes segfault for long strings

2013-07-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Serhiy: you're right. I've moved the message to the correct section.

--

___
Python tracker 

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



[issue18393] Gestalt() is deprecated on OSX 10.8, remove support?

2013-07-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I won't backport to 3.3 or 2.7, it is highly unlikely that the API will 
actually be removed anytime soon.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18344] _bufferedreader_read_all() may leak reference to data

2013-07-15 Thread Richard Oudkerk

Changes by Richard Oudkerk :


--
status: open -> closed

___
Python tracker 

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



[issue18466] Spelling mistakes in various code comments.

2013-07-15 Thread Févry Thibault

New submission from Févry Thibault:

The attached patch fixes spelling mistakes found on various comments, mainly in 
/Lib/. I choose not to correct things like 'everytime' since the main goal was 
to improve readability and not turn useful technical comments into English 
litterature. I hope this is fine.


[These were found using a script, if anyone wants I could post it somewhere 
after I polish it].

--
files: spelling.patch
keywords: patch
messages: 193120
nosy: iwontbecreative
priority: normal
severity: normal
status: open
title: Spelling mistakes in various code comments.
type: enhancement
Added file: http://bugs.python.org/file30930/spelling.patch

___
Python tracker 

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



[issue18455] Multiprocessing connection SocketClient retries connection on socket

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 542a317d4351 by Richard Oudkerk in branch '2.7':
Issue #18455: multiprocessing should not retry connect() with same socket.
http://hg.python.org/cpython/rev/542a317d4351

--
nosy: +python-dev

___
Python tracker 

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



[issue18344] _bufferedreader_read_all() may leak reference to data

2013-07-15 Thread Richard Oudkerk

Changes by Richard Oudkerk :


--
resolution:  -> fixed
stage: needs patch -> committed/rejected

___
Python tracker 

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



[issue18387] Add 'symbols' link to pydoc's html menu bar.

2013-07-15 Thread Ron Adam

Changes by Ron Adam :


Removed file: http://bugs.python.org/file30922/pdoc_symbols.diff

___
Python tracker 

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



[issue18387] Add 'symbols' link to pydoc's html menu bar.

2013-07-15 Thread Ron Adam

Ron Adam added the comment:

Patch update: "<>" removed from pydoc symbols table.

--
Added file: http://bugs.python.org/file30931/pdoc_symbols.diff

___
Python tracker 

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



[issue18460] .chm documentation files advertised in download.html but not there.

2013-07-15 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +georg.brandl, loewis

___
Python tracker 

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



[issue18387] Add 'symbols' link to pydoc's html menu bar.

2013-07-15 Thread Ron Adam

Ron Adam added the comment:

I agree the specific content for each symbol are separate issues.  Those are 
probably best addressed individually or a few at a time when they are closely 
related.

--

___
Python tracker 

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



[issue18440] hash() and __hash__() do not document their size constraints

2013-07-15 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
versions:  -Python 3.2

___
Python tracker 

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



[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread Gregory P. Smith

Gregory P. Smith added the comment:

This patch makes sense to me.  I've gone over the code and I cannot spot any 
adverse effects.  I was wondering in particular if anything would be surprised 
to find a non-started thread in _active within the short window where that will 
be true but nothing appears to care about that.

You should add a comment to the code mentioning this issue and why the .set() 
is done after the _active insertion.  After that, I'd say commit it.

If you want a consistent reproducible test case for this I believe you will 
need to replace the Thread object's __started with a test wrapper who's set() 
method blocks waiting for for the fork to have happened before doing the actual 
set().  That is a bit tricky and may not be worth it.

--

___
Python tracker 

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



[issue18440] hash() and __hash__() do not document their size constraints

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8fe13940b033 by Barry Warsaw in branch '3.3':
- Issue #18440: Clarify that `hash()` can truncate the value returned from an
http://hg.python.org/cpython/rev/8fe13940b033

New changeset f01f0c9cbcc8 by Barry Warsaw in branch 'default':
- Issue #18440: Clarify that `hash()` can truncate the value returned from an
http://hg.python.org/cpython/rev/f01f0c9cbcc8

--
nosy: +python-dev

___
Python tracker 

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



[issue18440] hash() and __hash__() do not document their size constraints

2013-07-15 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


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

___
Python tracker 

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



[issue18455] Multiprocessing connection SocketClient retries connection on socket

2013-07-15 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Thanks for the report.

This should be fixed now in 2.7.  (3.1 and 3.2 only get security fixes.)

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread Charles-François Natali

Charles-François Natali added the comment:

> If you want a consistent reproducible test case for this I believe you will 
> need to replace the Thread object's __started with a test wrapper who's set() 
> method blocks waiting for for the fork to have happened before doing the 
> actual set().  That is a bit tricky and may not be worth it.

Actually, setting sys.setswitchinterval(1e-6) makes it fairly easy to reproduce.

--

___
Python tracker 

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



[issue18444] IDLE: Mac OS X pressing ctrl-A in Python shell moved cursor before the prompt, which then makes the keyboard unresponsive.

2013-07-15 Thread Ned Deily

Ned Deily added the comment:

I think that those two requirements, i.e. (1) a set of key bindings compatible 
with standard Cocoa text key bindings and (2) a set of key bindings kept in 
sync across all IDLE platforms, would be desirable but probably unattainable.  
A good next step would be for someone to make a table of the IDLE key bindings 
across the various keysets and platforms.  That would make it easier to make 
informed design decisions.

The "Classic Unix" keyset is quite different, with emacs-like multiple key 
strokes (like Ctrl-X Ctrl-N for New Window).  I wonder how widely it is used. 
For OS X, we have the aforementioned conflicts with system accelerators and 
with the Cocoa Tk we have already had to disable some common accelerators (like 
Cmd-M for Open Module..) because of conflicts with Cocoa Tk's builtin 
accelerators and the as-yet-unresolved Ctrl-5 and Ctrl-6 crashes (Issue16023).  
The X11 situation is a mess with Option and Command being reversed and, yes, 
there are still users of Python with X11 Tk on OS X (for one, MacPorts provides 
it as the default option).  Perhaps the best solution for it is a separate OS X 
X11 keyset.

Re function keys: I created a new user account on a current OS X 10.8 (with a 
US keyboard on a MacBook Pro).  It seems that function keys are enabled by 
default.  This is controlled by a checkbox setting in the Keyboard panel of 
System Preferences.  With the box checked (the default), you have to press the 
fn modifier key to enable the hardware control functions.  Inspecting the 
default set of Keyboard Shortcuts in the panel, the only F(n) keys defined are 
F11, F12, Cmd-F5, Opt-Cmd-F5, and Ctrl-F1 through Ctrl-F7.  This conforms to 
the current OS X Human Interface Guidelines, Appendix A Keyboard Shortcuts, 
with the addition that the entire range F8 through F12 are marked as Apple 
reserved.  (Interestingly, the guidelines do not note that Ctrl-Left and 
Ctrl-Right are now used by Mission Control by default.)

That said, it would be great if IDLE could more closely follow the OS X Human 
Interface Guidelines, including the accessibility guidelines for Universal 
Access.  Of course, IDLE is very much dependent on Tk in these matters.  So 
trying to improve things will require a fair amount of research and 
experimentation with the Apple docs, Tk code, and IDLE itself.  It would be a 
good project for someone interested in practical User Experience design.

Additional references:

https://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/KeyboardShortcuts/KeyboardShortcuts.html

https://developer.apple.com/library/mac/#documentation/Accessibility/Conceptual/AccessibilityMacOSX/OSXAXIntro/OSXAXintro.html

http://www.hcs.harvard.edu/~jrus/Site/System%20Bindings.html

--

___
Python tracker 

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



[issue12014] str.format parses replacement field incorrectly

2013-07-15 Thread Ben Wolfson

Ben Wolfson added the comment:

Ping.

--

___
Python tracker 

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-15 Thread STINNER Victor

STINNER Victor added the comment:

listpop.patch: list_ass_slice() now handles listresize() failure when items are 
deleted.

--
Added file: http://bugs.python.org/file30932/listpop.patch

___
Python tracker 

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-15 Thread STINNER Victor

STINNER Victor added the comment:

frame_fasttolocals.patch: Add a new PyFrame_FastToLocalsWithError() function, 
same than PyFrame_FastToLocals(), except that errors are reported.

This function is not atomic: if an error occurs in the middle of map_to_dict(), 
the frame can enter an inconsistent state. Is it worse than not reporting the 
failure?

--
Added file: http://bugs.python.org/file30933/frame_fasttolocals.patch

___
Python tracker 

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 735e3c43e61c by Victor Stinner in branch 'default':
Issue #18408: Fix pyexpat.ParserCreate()
http://hg.python.org/cpython/rev/735e3c43e61c

New changeset 27f8ccce687d by Victor Stinner in branch 'default':
Issue #18408: Fix CJK decoders, raise MemoryError on memory allocation failure
http://hg.python.org/cpython/rev/27f8ccce687d

New changeset 82b2ee140994 by Victor Stinner in branch 'default':
Issue #18408: PyObject_Call() now fails with an assertion error in debug mode
http://hg.python.org/cpython/rev/82b2ee140994

New changeset ef0dbe00760e by Victor Stinner in branch 'default':
Issue #18408: Don't check unicode consistency in _PyUnicode_HAS_UTF8_MEMORY()
http://hg.python.org/cpython/rev/ef0dbe00760e

New changeset c676fc74d779 by Victor Stinner in branch 'default':
Issue #18408: type_new() and PyType_FromSpecWithBases() now raise MemoryError
http://hg.python.org/cpython/rev/c676fc74d779

New changeset 9244e79c6e14 by Victor Stinner in branch 'default':
Issue #18408: random_seed() now raises a MemoryError on memory allocation
http://hg.python.org/cpython/rev/9244e79c6e14

New changeset 71a572a516f9 by Victor Stinner in branch 'default':
Issue #18408: Fix PyEval_EvalFrameEx() for MemoryError
http://hg.python.org/cpython/rev/71a572a516f9

--

___
Python tracker 

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



[issue18462] Download > Other documentation page contains a link to a french poker site

2013-07-15 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report. Since there doesn't seem to be an obvious replacement 
web page, I've removed the reference to this port.

--
nosy: +ned.deily
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type: enhancement -> 

___
Python tracker 

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



[issue18463] Download > Other documentation page outdated/dead links

2013-07-15 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report. The S60 section now links to a Wikipedia page which 
gives a better overview and to the Sourceforge download link for the original 
project.  I've removed the dead link to the other VMS project.

--
nosy: +ned.deily
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type: enhancement -> 

___
Python tracker 

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



[issue18467] argparse - problematic 'default' behavior

2013-07-15 Thread Matěj Týč

New submission from Matěj Týč:

I have an issue with passing default values to arguments.
Basically, I would like to have a 'choices' argument (indicating something 
using capital letters) and perform custom action (adding boolean values to the 
args namespace).
See the bottom of this post for rationale.

According to the documentation ( 
http://docs.python.org/2.7/library/argparse.html#default ),
...
If the default value is a string, the parser parses the value as if it were a 
command-line argument.
...

If this was true, I could implement a custom action. However, even if the 
default value is a string (as the documentation suggests), the action is 
bypassed.

My goal is simple - I want to allow short choice-type argument (such as 
something.py --algorithm Q, the help would say --algorithhm Q|S, Q is quick, S 
is slow). Since the implementation shouldn't know about the mean one is 
communicating with the user, I would like to have the 'args' namespace either 
like (type='Q', quick=True, slow=False) or (type='quick') without giving up 
usage of the 'choices' pattern.

If I change my mind and add a 'type' function that would expand capital letters 
abbreviations to full names, I will be OK with default values.
However, if I pass the argument on the command-line, the type() call is 
performed first and the query whether the result is in the choices list fails.

I consider the current behavior as a bug, IMO the action shouldn't be bypassed 
if the "default" is string.

--
components: Library (Lib)
messages: 193135
nosy: matej.tyc
priority: normal
severity: normal
status: open
title: argparse - problematic 'default' behavior
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue18468] re.group() should never return a bytearray

2013-07-15 Thread Guido van Rossum

New submission from Guido van Rossum:

I discovered that the Python 3 version of
the re module's Match object behaves subtly different from the Python
2 version when the target string (i.e. the haystack, not the needle)
is a buffer object.

In Python 2, the type of the return value of group() is always either
a Unicode string or an 8-bit string, and the type is determined by
looking at the target string -- if the target is unicode, group()
returns a unicode string, otherwise, group() returns an 8-bit string.
In particular, if the target is a buffer object, group() returns an
8-bit string. I think this is the appropriate behavior: otherwise
using regular expression matching to extract a small substring from a
large target string would unnecessarily keep the large target string
alive as long as the substring is alive.

But in Python 3, the behavior of group() has changed so that its
return type always matches that of the target string. I think this is
bad -- apart from the lifetime concern, it means that if your target
happens to be a bytearray, the return value isn't even hashable!

Proper behavior should be that .group() returned a bytes object if the input 
was binary data and a str object if the input was unicode data (str) regardless 
of specific types containing the input target data.

Probably not much, if anything, would be depending on getting a bytearray out 
of that. Fix this in 3.4? 3.3 and earlier users are stuck with an extra bytes() 
call and data copy in these cases.

[Further discussion at 
http://mail.python.org/pipermail/python-dev/2013-July/127332.html]

--
components: Library (Lib)
messages: 193136
nosy: gvanrossum
priority: normal
severity: normal
stage: needs patch
status: open
title: re.group() should never return a bytearray
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread A. Jesse Jiryu Davis

A. Jesse Jiryu Davis added the comment:

Patch #2:

* Add comment before .set() as requested.

* setcheckinterval(0) and try 20 times to repro the bug, inspired by 
test_enumerate_after_join. This reliably repros in 2.7.5.

--
Added file: http://bugs.python.org/file30934/fix_is_alive_and_fork_2.patch

___
Python tracker 

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2e42c0a39321 by Victor Stinner in branch 'default':
Issue #18408: Fix _Py_DisplaySourceLine()
http://hg.python.org/cpython/rev/2e42c0a39321

New changeset 92a9ccb2a521 by Victor Stinner in branch 'default':
Issue #18408: add more assertions on PyErr_Occurred() in ceval.c to detect bugs
http://hg.python.org/cpython/rev/92a9ccb2a521

New changeset 9213313b1a6f by Victor Stinner in branch 'default':
Issue #18408: Fix show_warning(), clear also the exception raised by
http://hg.python.org/cpython/rev/9213313b1a6f

--

___
Python tracker 

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



[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread A. Jesse Jiryu Davis

Changes by A. Jesse Jiryu Davis :


Added file: 
http://bugs.python.org/file30935/fix_is_alive_and_fork_python_33.patch

___
Python tracker 

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



[issue18469] PyStructSequence does not handle exceptions correctly

2013-07-15 Thread STINNER Victor

New submission from STINNER Victor:

Using pyfailmalloc (*) (see issue #18408), I found bugs in the PyStructSequence 
API.

The following macros in Objects/structseq.c does not check for exceptions:

#define VISIBLE_SIZE(op) Py_SIZE(op)
#define VISIBLE_SIZE_TP(tp) PyLong_AsLong( \
  PyDict_GetItemString((tp)->tp_dict, visible_length_key))

#define REAL_SIZE_TP(tp) PyLong_AsLong( \
  PyDict_GetItemString((tp)->tp_dict, real_length_key))
#define REAL_SIZE(op) REAL_SIZE_TP(Py_TYPE(op))

#define UNNAMED_FIELDS_TP(tp) PyLong_AsLong( \
  PyDict_GetItemString((tp)->tp_dict, unnamed_fields_key))
#define UNNAMED_FIELDS(op) UNNAMED_FIELDS_TP(Py_TYPE(op))

Exceptions in PyDict_GetItemString() and PyLong_AsLong() are "unlikely" (the 
request key always exist, except in a newly developed module, which is not the 
case here), but become very likely using pyfailmalloc: PyDict_GetItemString() 
allocates a temporary string, and the memory allocation can fail.

In my opinion, the PyStructSequence structure should store the number of 
visible, real and unnamed fields. The problem is that it would require a design 
of the structure: data cannot be added between tuple items and the tuple 
header. PyStructSequence is currently defined as:

typedef PyTupleObject PyStructSequence;

Another option is to detect and handle correctly exceptions where these macros 
are used. But how should we handle exceptions in structseq_dealloc() ???

static void
structseq_dealloc(PyStructSequence *obj)
{
Py_ssize_t i, size;

size = REAL_SIZE(obj);
for (i = 0; i < size; ++i) {
Py_XDECREF(obj->ob_item[i]);
}
PyObject_GC_Del(obj);
}

By the way, structseq_dealloc() might restore the original size ("Py_SIZE(obj) 
= REAL_SIZE(obj);") before calling the tuple destructor (even if tupledealloc() 
only keeps real tuple in its free list).

(*) https://pypi.python.org/pypi/pyfailmalloc

--
messages: 193139
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: PyStructSequence does not handle exceptions correctly
versions: Python 3.4

___
Python tracker 

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-15 Thread STINNER Victor

STINNER Victor added the comment:

I created the issue #18469: "PyStructSequence does not handle exceptions 
correctly".

--

___
Python tracker 

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



[issue18469] PyStructSequence does not handle exceptions correctly

2013-07-15 Thread STINNER Victor

STINNER Victor added the comment:

This issue is common in test_datetime and test_import tests using failmalloc, 
especially if _PyErr_BadInternalCall() fails immedialy with an assertion error.

--

___
Python tracker 

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-15 Thread STINNER Victor

STINNER Victor added the comment:

import_init() calls Py_FatalError() at any error. This is not kind for 
Py_NewInterpreter() which calls import_init(): Py_NewInterpreter() exits Python 
with a fatal error, instead of returning NULL, on import_init() failure.

--

___
Python tracker 

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



[issue18470] tokenizer.c does not handle new_string() failure

2013-07-15 Thread STINNER Victor

New submission from STINNER Victor:

Callers of the new_string() function do not check if the function succeed or 
not. Python does crash if the function failed, for example in get_coding_spec():

char* r = new_string(begin, t - begin);
char* q = get_normal_name(r);

Using pytracemalloc tool, it's easy to tricker this issue (ex: using 
test_future or test_parser): see issue #18408.

--
messages: 193143
nosy: haypo
priority: normal
severity: normal
status: open
title: tokenizer.c does not handle new_string() failure
versions: Python 3.4

___
Python tracker 

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-15 Thread STINNER Victor

STINNER Victor added the comment:

New issue #18470: "tokenizer.c does not handle new_string() failure".

--

___
Python tracker 

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



[issue18470] tokenizer.c does not handle new_string() failure

2013-07-15 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue18471] Typo in heapq documentation

2013-07-15 Thread François Pinard

New submission from François Pinard:

Within http://docs.python.org/3/library/heapq.html#theory, a sentence begins 
with "When an event schedule" while it should be spelled "When an event 
schedules".  The same may be observed in Python 2 documentation.

--
assignee: docs@python
components: Documentation
messages: 193145
nosy: docs@python, icule
priority: normal
severity: normal
status: open
title: Typo in heapq documentation
versions: Python 3.3

___
Python tracker 

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



[issue18305] [patch] Fast sum() for non-numbers

2013-07-15 Thread Sergey

Sergey added the comment:

> This is not a common case. A common case is creating short tuples and keeping 
> a lot of tuples in memory.

> For fast += you need keep not only a size of tuple, but also a size of 
> allocated memory. It's a cause of sys.getsizeof([1, 2]) > sys.getsizeof((1, 
> 2)).

Agree. But is it worth worrying about? How much RAM could be taken by it? E.g. 
python test uses ~3 tuples in peak. So if we add e.g. 32 bytes to tuple 
then python test would use 106MB of RAM instead of 105MB. 1%? ;)

> You shouldn't optimize a rare case at the cost of regression in common usage.

This could optimize many cases, like instant tuple copy, or instant conversions 
of lists to tuples and back, if this idea is extended to lists. It may also 
work for strings.

--

___
Python tracker 

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



[issue18471] Typo in heapq documentation

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 236e6b995300 by Ned Deily in branch '2.7':
Issue #18471: Fix typo in heapq documentation (reported by François Pinard).
http://hg.python.org/cpython/rev/236e6b995300

New changeset e22dd5fda5a8 by Ned Deily in branch '3.3':
Issue #18471: Fix typo in heapq documentation (reported by François Pinard).
http://hg.python.org/cpython/rev/e22dd5fda5a8

New changeset 8a078bf3cf14 by Ned Deily in branch 'default':
Closes #18471: Fix typo in heapq documentation (reported by François Pinard).
http://hg.python.org/cpython/rev/8a078bf3cf14

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18471] Typo in heapq documentation

2013-07-15 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report.

--
nosy: +ned.deily
versions: +Python 2.7, Python 3.4

___
Python tracker 

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



[issue18441] Idle: Make test.support.requires('gui') skip when it should.

2013-07-15 Thread Todd Rovito

Changes by Todd Rovito :


--
nosy: +Todd.Rovito

___
Python tracker 

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



[issue18441] Idle: Make test.support.requires('gui') skip when it should.

2013-07-15 Thread Todd Rovito

Changes by Todd Rovito :


--
nosy: +JayKrish

___
Python tracker 

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



[issue18441] Idle: Make test.support.requires('gui') skip when it should.

2013-07-15 Thread Todd Rovito

Changes by Todd Rovito :


--
nosy: +philwebster

___
Python tracker 

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



[issue18470] tokenizer.c does not handle new_string() failure

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c3a510b22218 by Benjamin Peterson in branch '3.3':
check the return value of new_string() (closes #18470)
http://hg.python.org/cpython/rev/c3a510b22218

New changeset 8889c9b5dd3a by Benjamin Peterson in branch '3.3':
merge 3.3 (#18470)
http://hg.python.org/cpython/rev/8889c9b5dd3a

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18470] tokenizer.c does not handle new_string() failure

2013-07-15 Thread STINNER Victor

STINNER Victor added the comment:

The fix has not been merged into default.

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

___
Python tracker 

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



[issue18448] Tools/demo/eiffel.py fails to run tests.

2013-07-15 Thread Févry Thibault

Févry Thibault added the comment:

Interessting update : The test does *not* fail all the time. It succeeds about 
1/3 times on my computer.

--

___
Python tracker 

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



[issue18470] tokenizer.c does not handle new_string() failure

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2650127ce034 by Benjamin Peterson in branch 'default':
merge 3.3 (closes #18470)
http://hg.python.org/cpython/rev/2650127ce034

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

___
Python tracker 

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



[issue18425] IDLE Unit test for IdleHistory.py

2013-07-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As I said on one of the other issues, which I hope you read, we have the option 
of gui tests when mocking becomes too complicated. So at least for now, put the 
test that requires marks in a separate test case with requires('gui') in 
setUPClass.

The problem with a full implementation of marks is that they change position 
when text is inserted or deleted before their position. Also, some mark 
functions are easier if they are stored in a dict, while one function and the 
movement operations are easier if they are stored in a sorted list. A partial 
implementation that allowed only 1 or 2 marks would be easier that a full 
implementation allowing any number. Mock marks that do not move (and don't need 
to because of no inserts or deletes between definition and use) would also be 
easy. So I want to see how marks need to be used for testing before doing 
anything.

Even when a mock is used, we can temporarily use the tk version to verify that 
the mock is working right. I did that in the patch for #18279. See the 
commented out code in
http://hg.python.org/cpython/rev/22ce68d98345.

--

___
Python tracker 

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



[issue18444] IDLE: Mac OS X pressing ctrl-A in Python shell moved cursor before the prompt, which then makes the keyboard unresponsive.

2013-07-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> BTW. I don't think it using function keys for key bindings is 
> necessarily a good idea on OSX. I'm pretty sure that the default
> keyboard settings on OSX require two key presses to use a function
> key on OSX laptops

On Mac laptops, there is separate "fn" key that enables the function keys.  
Users press "fn" and "F5" to run a script from IDLE.

I teach Python classes to Mac users and they are are no problems at all with 
the function keys.

--
nosy: +rhettinger

___
Python tracker 

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



[issue18444] IDLE: Mac OS X pressing ctrl-A in Python shell moved cursor before the prompt, which then makes the keyboard unresponsive.

2013-07-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Raymond: good to hear that using fn+F5 is not a problem for new users

--

___
Python tracker 

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



[issue18393] Gestalt() is deprecated on OSX 10.8, remove support?

2013-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7272ef213b7c by Ronald Oussoren in branch 'default':
Also remove a (broken) leaker test for the code removed in issue #18393.
http://hg.python.org/cpython/rev/7272ef213b7c

--

___
Python tracker 

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