[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2013-07-11 Thread paul j3

paul j3 added the comment:

One usage option is to make a subclass of HelpFormatter (the accepted way of 
customizing a formatter), and write a function that formats each group 
independently.  For the example case, the resulting format might be:

   usage: PROG [-h] [-b] [-a | -c] [-a | -d]

-h and -b are not part of any group.  These are followed by the two groups.  -a 
is repeated because it appears in both groups.

--

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Ivan Johansen

New submission from Ivan Johansen:

In Python/importdl.c around line 99 in the function 
_PyImport_LoadDynamicModule() you can find the code:
  def = PyModule_GetDef(m);
  def-m_base.m_init = p;

If the module m, which is returned from a newly imported extension, is not 
created by PyModule_Create() but in some other way then PyModule_GetDef(m) will 
return NULL. The next line will then dereference a NULL pointer and crash. 

I suggest a check for this is added:
  def = PyModule_GetDef(m);
  if(def != NULL) 
def-m_base.m_init = p;

--
messages: 192845
nosy: Padowan
priority: normal
severity: normal
status: open
title: Crash when extension does not use PyModule_Create()
type: crash
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18426
___
___
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-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

After more thought, I'm changing this to Py3.4 only.  For prior versions, I'm 
content to document that there is no support for NotImplemented, and if that is 
needed, then people should write-out all six rich comparisons without using the 
total ordering decorator.

I don't think it is a good idea to introduce the new behaviors into otherwise 
stable point releases.  This patch is somewhat complex and has potential for 
bugs, unexpected behaviors, misunderstandings, and intra-version compatability 
issues (like the problems that occurred when True and False were added in a 
point release many years ago).

--
versions: +Python 3.4 -Python 2.7, Python 3.2, Python 3.3

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



[issue18414] random.choices(seq, k)

2013-07-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with Antoine.  A list comprehension is the standard, obvious idiom for 
making a list from repeated function calls.  

Putting sampling without replacement in its own method makes the operation more 
opaque than a plain list comprehension (which doesn't need documentation to be 
clear about how many calls are made, what the output type is, its relationship 
to random.choice, whether k can be larger than the population, etc).

--

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



[issue11908] Weird `slice.stop or sys.maxint`

2013-07-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Closing for the reasons lists above.

--
resolution:  - rejected
status: open - closed

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



[issue18386] Better random number generator

2013-07-11 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
resolution:  - rejected
status: open - closed

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



[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2013-07-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Unassigning until another patch arrives that moves this forward.

The basic idea is well established:  Get the structseq API to match the named 
tuple API as much as possible.

--
assignee: rhettinger - 
components: +Extension Modules -Interpreter Core
priority: normal - low
stage:  - needs patch
versions: +Python 3.4 -Python 3.3

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



[issue11945] Adopt and document consistent semantics for handling NaN values in containers

2013-07-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I think this should be closed.  AFAICT it is of interest to a very tiny subset 
of the human species and as near as I can tell that subset doesn't include 
people in the numeric and statistics community (the ones who actually use NaNs 
as placeholders for missing values).

So much code (and human reasoning) assumes that identity-implies-equality, that 
is would be easier to document the exception to expectation than to try to find 
every place in every module where the assumption is present (implicitly or 
explicitly).  Instead, it would be better to document that distinct 
float('NaN') objects are never equal to one another and that identical 
float('NaN') objects may or may not compare equal in various implementation 
dependent circumstances.

--

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



[issue6742] Embedding python into shared library crash on AIX

2013-07-11 Thread Sébastien Sablé

Sébastien Sablé added the comment:

This issue has been fixed as part of issue 941346 and should be closed in my 
opinion.

--

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4343dfaca8e2 by Christian Heimes in branch '3.3':
Issue #18426: Fix NULL pointer dereference in C extension import when
http://hg.python.org/cpython/rev/4343dfaca8e2

New changeset 9fb3656b178a by Christian Heimes in branch 'default':
Issue #18426: Fix NULL pointer dereference in C extension import when
http://hg.python.org/cpython/rev/9fb3656b178a

--
nosy: +python-dev

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Christian Heimes

Christian Heimes added the comment:

I used a slightly different patch:

if (def == NULL)
goto error;

--
nosy: +christian.heimes
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions:  -Python 3.1, Python 3.2, Python 3.5

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

I'm not sure the fix is correct: PyModule_GetDef() can return NULL without 
setting an error, for example when the init function returns a regular Python 
module.

I'm OK to require the init function to return a module created with 
PyModule_Create(), and fail when it's not the case. But an exception should be 
set.
(and a unit test would help...)

--
nosy: +amaury.forgeotdarc

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc amaur...@gmail.com:


--
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18426
___
___
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-11 Thread Tobias Marschall

New submission from Tobias Marschall:

Running the following two lines of code causes a segfault:

s = 'A' * 3142044943 
t = s.replace('\n','')

My setup:
Python 2.7.5 (default, Jul 11 2013, 11:17:50) 
[GCC 4.6.3] on linux2
Linux 3.2.0-45-generic #70-Ubuntu SMP Wed May 29 20:12:06 UTC 2013 x86_64 
x86_64 x86_64 GNU/Linux

I could reproduce this behavior on Python 2.6.8 and 2.5.6.

Please let me know if I can provide additional information.

--
components: Interpreter Core
messages: 192855
nosy: tobiasmarschall
priority: normal
severity: normal
status: open
title: str.replace causes segfault for long strings
type: crash
versions: Python 2.7

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Christian Heimes

Christian Heimes added the comment:

In theory you are right. m-md_def could be NULL, too. But in practice it's 
only going to happen when you have a faulty C extension. The code tries to load 
a dynamic module (ELF shared library, Windows DLL, ...) with 
_PyImport_GetDynLoadFunc() a couple of lines before PyModule_GetDef(). Any 
invalid file is rejected:

 imp.load_dynamic(os, Lib/os.py)
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: Lib/os.py: invalid ELF header

But an extra check doesn't hurt. How do you like this?

def = PyModule_GetDef(m);
if (def == NULL) {
if (!PyErr_Occured()) {
/* m-md_def == NULL */
PyErr_BadArgument();
}
goto error;
}

--

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
assignee:  - christian.heimes
resolution: fixed - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18426
___
___
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-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

I was thinking of a message similar to the one above.
The eventual exception set by PyModule_GetDef(m) is less explicit.

if (def == NULL) {
PyErr_Format(PyExc_SystemError,
initialization of %s did not return an extension module,
shortname);
goto error;
}

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18426
___
___
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-11 Thread Christian Heimes

Christian Heimes added the comment:

#0  memchr () at ../sysdeps/x86_64/memchr.S:155
#1  0x00467ca4 in countchar (maxcount=optimized out, c=10 '\n', 
target_len=-1152922353, target=0x7fff3b196034 'A' repeats 200 times...)
at Objects/stringobject.c:2341
#2  replace_delete_single_character (maxcount=optimized out, from_c=10 '\n', 
self=0x7fff3b196010) at Objects/stringobject.c:2427
#3  replace (maxcount=optimized out, to_len=optimized out, to_s=optimized 
out, from_len=1, from_s=optimized out, self=0x7fff3b196010)
at Objects/stringobject.c:2780
#4  string_replace (self=0x7fff3b196010, args=optimized out) at 
Objects/stringobject.c:2854

target_len=-1152922353 looks fishy. I think countchar()'s target_len argument 
has a wrong argument type. It should be Py_ssize_t instead of int.

-countchar(const char *target, int target_len, char c, Py_ssize_t maxcount)
+countchar(const char *target, Py_ssize_t target_len, char c, Py_ssize_t 
maxcount)

--
nosy: +christian.heimes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
___
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-11 Thread Christian Heimes

Christian Heimes added the comment:

PS: The test case no longer segfaults with Py_ssize_t.

--

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



[issue18414] random.choices(seq, k)

2013-07-11 Thread Christian Heimes

Christian Heimes added the comment:

You have convinced me. It's not worth yet another API method.

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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18414
___
___
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-11 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I agree: target_len should have type Py_ssize_t.

It's probably worthwhile to check other functions as well.

--
nosy: +ronaldoussoren

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
___
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-11 Thread Ronald Oussoren

Ronald Oussoren added the comment:

There is also this one in string_print:

fwrite(data, 1, (int)size, fp);

size is a Py_ssize_t variable with the length of the string, and is casted to 
int which looses information. The exected argument to fwrite is size_t...

These two appear to be the only suspect uses of 'int' in stringobject.h.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
___
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-11 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The attached patch should fix both issues (but doesn't contain a test, not sure 
if its worthwhile to add a testcase that uses more than 4 GByte of memory)

FWIW: the corresponding code in Objects/bytesobject.c in the 3.3 and default 
branches is already correct.

--
keywords: +needs review, patch
stage:  - patch review
Added file: http://bugs.python.org/file30886/issue-18427-py27.txt

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fce581643cb6 by Christian Heimes in branch '3.3':
Issue #18426: improve exception message. Courtesy of Amaury
http://hg.python.org/cpython/rev/fce581643cb6

New changeset 7a50d3c0aa61 by Christian Heimes in branch 'default':
Issue #18426: improve exception message. Courtesy of Amaury
http://hg.python.org/cpython/rev/7a50d3c0aa61

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18426
___
___
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-11 Thread Christian Heimes

Christian Heimes added the comment:

LGTM!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
___
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-11 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Great. I'll apply after running the full testsuite, and after rebooting my 
machine as it doesn't really like using that much additional memory and pushed 
some applications to disk :-(

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
___
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-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2921f6c2009e by Ronald Oussoren in branch '2.7':
Issue #18427: str.replace could crash the interpreter with huge strings.
http://hg.python.org/cpython/rev/2921f6c2009e

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18427
___
___
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-11 Thread Ronald Oussoren

Changes by Ronald Oussoren ronaldousso...@mac.com:


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

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



[issue18428] IDLE startup error

2013-07-11 Thread Mike

New submission from Mike:

Python used to run smoothly on my macbook, but since I opened the debugger 
yesterday, the IDLE window cannot be opened anymore. It shows an error message 
IDLE's subprocess didn't make connection. 

I tried to uninstall everything and download it again from the website, but the 
problem is unsolved. I am using the latest OS X Mountain Lion, and installed 
Python 3.3.2 and the latest Tcl/Tk. Please advice me how to fix the problem.

--
components: IDLE
messages: 192868
nosy: mwei11
priority: normal
severity: normal
status: open
title: IDLE startup error
type: crash
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18428
___
___
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-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Agreed.

I had actually assumed this would be 3.4 only, otherwise I wouldn't have
suggested using the new subtest feature in the test case.

--

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Ivan Johansen

Ivan Johansen added the comment:

If possible it would be nice if any module could be returned from a C 
extension. Specifically I was trying to subclass module (PyModule_Type) and use 
that.

But an error message is better than a crash.

--

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



[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2013-07-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Returning another kind of module can be dangerous here, because extension 
modules are handled specially (see _PyImport_FixupExtensionObject),
and it's not obvious what this does to normal modules.

But I agree that _imp.load_dynamic() could be extended to plain modules.
A bit like class/type unification.

--

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



[issue18352] collections.Counter with added attributes are not deepcopied properly.

2013-07-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is an updated patch. It includes a fix for OrderedDict.copy(). Counter's 
copy() and __reduce__() are simplified. Added tests for OrderedDict which 
checks that OrderedDict copying and pickling preserves dynamic attributes.

--
Added file: http://bugs.python.org/file30887/counter_copy_attrs_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18352
___
___
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-11 Thread Oscar Benjamin

Oscar Benjamin added the comment:

This optimisation is a semantic change. It breaks backward compatibility in 
cases where a = a + b and a += b do not result in the name a having the same 
value. In particular this breaks backward compatibility for numpy users.

Numpy arrays treat += differently from + in the sense that a += b coerces b to 
the same dtype as a and then adds in place whereas a + b uses Python style type 
promotion. This behaviour is by design and it is useful. It is also entirely 
appropriate (unlike e.g. summing lists) that someone would use sum() to add 
numpy arrays.

An example where + and += give different results:

 from numpy import array
 a1 = array([1, 2, 3], dtype=int)
 a1
array([1, 2, 3])
 a2 = array([.5, .5, .5], dtype=float)
 a2
array([ 0.5,  0.5,  0.5])
 a1 + a2
array([ 1.5,  2.5,  3.5])
 a1 += a2
 a1
array([1, 2, 3])

--
nosy: +oscarbenjamin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18305
___
___
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-11 Thread Ethan Furman

Ethan Furman added the comment:

So making this a speed-up for generic objects using __iadd__ is out.

The only question remaining is: is it worth special casing a few specific 
objects (list, tuple, str) to optimise performance?

The str question has already been answered:  it's special cased to raise an 
error.

--

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



[issue18336] codecs: Link to readline module (history) instead of fd.readline()

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7e186bb1642c by Serhiy Storchaka in branch '2.7':
Issue #18336. Fix a link to StreamReader's read() method.
http://hg.python.org/cpython/rev/7e186bb1642c

New changeset 8dd67c20cab7 by Serhiy Storchaka in branch '3.3':
Issue #18336. Fix a link to StreamReader's read() method.
http://hg.python.org/cpython/rev/8dd67c20cab7

New changeset a53ac166fa58 by Serhiy Storchaka in branch 'default':
Issue #18336. Fix a link to StreamReader's read() method.
http://hg.python.org/cpython/rev/a53ac166fa58

--
nosy: +python-dev

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



[issue18336] codecs: Link to readline module (history) instead of fd.readline()

2013-07-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Actually it should be a link to the read() method.

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

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



[issue12641] Remove -mno-cygwin from distutils

2013-07-11 Thread Oscar Benjamin

Oscar Benjamin added the comment:

I'm attaching three new patches following on from Eric and Christian's
suggestions:

check_mno_cywin_py27_1.patch (for Python 2.7)
check_mno_cywin_py3_1.patch (for Python 3.2 and 3.3)
check_mno_cywin_py34_1.patch (for Python 3.4)

The py27 patch now uses os.popen to avoid importing subprocess as
suggested by Eric. The other two patches are changed to use
check_output as suggested by Christian (subprocess is already imported
in 3.x).

I've retested the patches using the same setup as before and the
results are unchanged for all gcc and Python versions tested.

--
Added file: http://bugs.python.org/file30888/check_mno_cywin_py34_1.patch
Added file: http://bugs.python.org/file30889/check_mno_cywin_py3_1.patch
Added file: http://bugs.python.org/file30890/check_mno_cywin_py27_1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12641
___diff -r 7aab60b70f90 Lib/distutils/cygwinccompiler.py
--- a/Lib/distutils/cygwinccompiler.py  Sun Jun 23 15:47:03 2013 -0700
+++ b/Lib/distutils/cygwinccompiler.py  Thu Jul 11 16:59:27 2013 +0100
@@ -48,13 +48,14 @@
 import os
 import sys
 import copy
-from subprocess import Popen, PIPE
+from subprocess import Popen, PIPE, check_output
 import re
 
 from distutils.ccompiler import gen_preprocess_options, gen_lib_options
 from distutils.unixccompiler import UnixCCompiler
 from distutils.file_util import write_file
-from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
+from distutils.errors import (DistutilsExecError, CCompilerError,
+CompileError, UnknownFileError)
 from distutils import log
 from distutils.version import LooseVersion
 from distutils.spawn import find_executable
@@ -294,11 +295,15 @@
 else:
 entry_point = ''
 
-self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
- compiler_so='gcc -mno-cygwin -mdll -O -Wall',
- compiler_cxx='g++ -mno-cygwin -O -Wall',
- linker_exe='gcc -mno-cygwin',
- linker_so='%s -mno-cygwin %s %s'
+if is_cygwingcc():
+raise CCompilerError(
+'Cygwin gcc cannot be used with --compiler=mingw32')
+
+self.set_executables(compiler='gcc -O -Wall',
+ compiler_so='gcc -mdll -O -Wall',
+ compiler_cxx='g++ -O -Wall',
+ linker_exe='gcc',
+ linker_so='%s %s %s'
 % (self.linker_dll, shared_option,
entry_point))
 # Maybe we should also append -mthreads, but then the finished
@@ -393,3 +398,8 @@
 
 commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version']
 return tuple([_find_exe_version(cmd) for cmd in commands])
+
+def is_cygwingcc():
+'''Try to determine if the gcc that would be used is from cygwin.'''
+out_string = check_output(['gcc', '-dumpmachine'])
+return out_string.strip().endswith(b'cygwin')
diff -r 0762f2419494 Lib/distutils/cygwinccompiler.py
--- a/Lib/distutils/cygwinccompiler.py  Sun Jun 23 23:51:44 2013 +0200
+++ b/Lib/distutils/cygwinccompiler.py  Thu Jul 11 17:05:05 2013 +0100
@@ -48,7 +48,7 @@
 import os
 import sys
 import copy
-from subprocess import Popen, PIPE
+from subprocess import Popen, PIPE, check_output
 import re
 
 from distutils.ccompiler import gen_preprocess_options, gen_lib_options
@@ -294,13 +294,18 @@
 else:
 entry_point = ''
 
-self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
- compiler_so='gcc -mno-cygwin -mdll -O -Wall',
- compiler_cxx='g++ -mno-cygwin -O -Wall',
- linker_exe='gcc -mno-cygwin',
- linker_so='%s -mno-cygwin %s %s'
-% (self.linker_dll, shared_option,
-   entry_point))
+if self.gcc_version  '4' or is_cygwingcc():
+no_cygwin = ' -mno-cygwin'
+else:
+no_cygwin = ''
+
+self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
+ compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
+ compiler_cxx='g++%s -O -Wall' % no_cygwin,
+ linker_exe='gcc%s' % no_cygwin,
+ linker_so='%s%s %s %s'
+% (self.linker_dll, no_cygwin,
+   shared_option, entry_point))
 # Maybe we should also append -mthreads, but then the finished
 # dlls need another dll (mingwm10.dll see Mingw32 docs)
 # (-mthreads: Support thread-safe exception handling on `Mingw32')
@@ -393,3 +398,8 

[issue5308] cannot marshal objects with more than 2**31 elements

2013-07-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - fixed
stage: needs patch - commit review
status: open - pending
versions:  -Python 3.2

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



[issue5308] cannot marshal objects with more than 2**31 elements

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1cf2c42af815 by Serhiy Storchaka in branch '2.7':
Fix reference leaks introduced by the patch for issue #5308.
http://hg.python.org/cpython/rev/1cf2c42af815

New changeset 8b99f2224c3a by Serhiy Storchaka in branch '3.3':
Fix reference leaks introduced by the patch for issue #5308.
http://hg.python.org/cpython/rev/8b99f2224c3a

New changeset 19ed630d8d75 by Serhiy Storchaka in branch 'default':
Fix reference leaks introduced by the patch for issue #5308.
http://hg.python.org/cpython/rev/19ed630d8d75

--

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



[issue17987] test.support.captured_stderr, captured_stdin not documented

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af2416c2e27c by R David Murray in branch '3.3':
#17987: properly document support.captured_xxx.
http://hg.python.org/cpython/rev/af2416c2e27c

New changeset d0f7f1996001 by R David Murray in branch 'default':
Merge #17987: properly document support.captured_xxx.
http://hg.python.org/cpython/rev/d0f7f1996001

--
nosy: +python-dev

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



[issue17987] test.support.captured_stderr, captured_stdin not documented

2013-07-11 Thread R. David Murray

R. David Murray added the comment:

Thanks, Dmi.

--
nosy: +r.david.murray
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue18338] python --version should send output to STDOUT

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e6384b8b2325 by Serhiy Storchaka in branch 'default':
Issue #18338: `python --version` now prints version string to stdout, and
http://hg.python.org/cpython/rev/e6384b8b2325

--
nosy: +python-dev

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



[issue18338] python --version should send output to STDOUT

2013-07-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue18101] Tk.split() doesn't work with nested Unicode strings

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f53cdd4e2689 by Serhiy Storchaka in branch '2.7':
Issue #18101: Tcl.split() now process Unicode strings nested in a tuple as it
http://hg.python.org/cpython/rev/f53cdd4e2689

New changeset 9486c07929a1 by Serhiy Storchaka in branch '3.3':
Issue #18101: Tcl.split() now process strings nested in a tuple as it
http://hg.python.org/cpython/rev/9486c07929a1

New changeset 16c48d553ddb by Serhiy Storchaka in branch 'default':
Issue #18101: Tcl.split() now process strings nested in a tuple as it
http://hg.python.org/cpython/rev/16c48d553ddb

--
nosy: +python-dev

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



[issue18101] Tk.split() doesn't work with nested Unicode strings

2013-07-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


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

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



[issue18429] IDLE: Format Paragraph doesn't function with comment blocks

2013-07-11 Thread Todd Rovito

New submission from Todd Rovito:

While working on a test case for Format Paragraph 
(http://bugs.python.org/issue18226) I noted that format paragraph doesn't work 
with comment blocks when a comment block is selected.  The fix is very simple 
by changing one line:
if first and last:
data = text.get(first, last)
comment_header = get_comment_header(data)
else:

The comment_header line was changed from comment_header = ''.  This forces the 
format paragraph extension to always do just a normal text format.  Attached 
is a patch but I would like to explore the bug in more detail and make sure all 
cases are covered.

--
messages: 192883
nosy: Todd.Rovito
priority: normal
severity: normal
status: open
title: IDLE: Format Paragraph doesn't function with comment blocks
type: behavior
versions: Python 3.4

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



[issue18429] IDLE: Format Paragraph doesn't function with comment blocks

2013-07-11 Thread Todd Rovito

Changes by Todd Rovito rovit...@gmail.com:


--
keywords: +patch
nosy: +JayKrish, philwebster, roger.serwy, terry.reedy
Added file: http://bugs.python.org/file30891/18429FormatParagraphFor3.4.patch

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



[issue18389] document that os.path.relpath does not interrogate the file system

2013-07-11 Thread Madison May

Madison May added the comment:

Patch for 3.4 added.  I tried to keep things short and sweet.

--
Added file: http://bugs.python.org/file30892/Issue18389_3-4.patch

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



[issue18085] Verifying refcounts.dat

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ffe24e3e7a2a by Serhiy Storchaka in branch '3.3':
Issue #18085: Add missed const modifier for some entries in refcounts.dat.
http://hg.python.org/cpython/rev/ffe24e3e7a2a

New changeset 6587fd3d89ae by Serhiy Storchaka in branch 'default':
Issue #18085: Add missed const modifier for some entries in refcounts.dat.
http://hg.python.org/cpython/rev/6587fd3d89ae

--

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



[issue17944] Refactor test_zipfile

2013-07-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'm going to commit the patch soon.

--

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



[issue18415] Normalize single/double quote usage in importlib

2013-07-11 Thread Madison May

Madison May added the comment:

Patch using all single quotes for string literals, except for 3 cases of double 
quoted strings that contain single quotes (I thought it was probably preferable 
to escaping the single quotes).

--
keywords: +patch
nosy: +madison.may
Added file: http://bugs.python.org/file30893/all_single_quotes.patch

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



[issue18415] Normalize single/double quote usage in importlib

2013-07-11 Thread Madison May

Madison May added the comment:

Patch using all double quotes. Take your pick :)

--
Added file: http://bugs.python.org/file30894/all_double_quotes.patch

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



[issue17872] Crash in marshal.load() with bad reader

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fc7bab8a8618 by Serhiy Storchaka in branch '3.3':
Issue #17872: Fix a segfault in marshal.load() when input stream returns
http://hg.python.org/cpython/rev/fc7bab8a8618

New changeset 5fa793ae36cc by Serhiy Storchaka in branch 'default':
Issue #17872: Fix a segfault in marshal.load() when input stream returns
http://hg.python.org/cpython/rev/5fa793ae36cc

--
nosy: +python-dev

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread Nick Bargnesi

New submission from Nick Bargnesi:

Using existing file objects as arguments to the open functions in the gzip, 
bz2, and lzma libraries can cause the underlying fileobj position to get 
changed - and not quite in ways one would expect.

Calling peek against the returned file objects -- gzip.GzipFile, bz2.BZ2File, 
and lzma.LZMAFile will in one scenario advance the position of the supplied 
file object:

 import bz2
 fileobj = open('test.bz2', mode='rb')
 bzfile = bz2.open(fileobj)

 # file positions at 0
 assert fileobj.tell() == 0, bzfile.tell() == 0

 bzfile.peek()
b'Test file.\n'
 fileobj.tell()
52

If after the initial peek, we rewind the underlying fileobj and peek again, the 
behavior changes:

 fileobj.seek(0)
0
 bzfile.peek()
b'Test file.\n'
 fileobj.tell()
0

The second scenario serves to complicate things a bit with the change in 
behavior.

I would be less surprised if the module documentation simply stated the affect 
on file position of the file object being used. Though it would be beautiful if 
the underlying file object didn't change at all. The latter seems possible 
since the three modules know whether the file object is seekable.

The gzip and lzma modules exhibit similar behavior - gzip for example:

 import gzip
 fileobj = open('test.gz', mode='rb')
 gzfile = gzip.open(fileobj)

 # file positions at 0
 assert fileobj.tell() == 0 and gzfile.tell() == 0

 gzfile.peek(1)
b'Test file.\n'
 fileobj.tell()
36

 # rewind, and do it again
 fileobj.seek(0)

 gzfile.peek(1)
b'Test file.\n'
 fileobj.tell()
0

--
components: Library (Lib)
messages: 192890
nosy: nbargnesi
priority: normal
severity: normal
status: open
title: gzip, bz2, lzma: peek advances file position of existing file object
type: enhancement
versions: Python 3.3

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



[issue17872] Crash in marshal.load() with bad reader

2013-07-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - fixed
stage: patch review - commit review
status: open - pending

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



[issue18415] Normalize single/double quote usage in importlib

2013-07-11 Thread Brett Cannon

Brett Cannon added the comment:

I prefer single quotes (easier to type =) and yes, using double quotes instead 
of escaping is preferred.

When I have a chance I will take a look at the patch.

--
stage: needs patch - commit review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18415
___
___
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-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think NEWS entry for this issue should be in the Core and Builtins section.

--

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I guess this issue can't be fixed.

--
nosy: +nadeem.vawda, serhiy.storchaka

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



[issue18044] Email headers do not properly decode to unicode.

2013-07-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4acb822f4c43 by R David Murray in branch '3.3':
#18044: Fix parsing of encoded words of the form =?utf8?q?=XX...?=
http://hg.python.org/cpython/rev/4acb822f4c43

New changeset 32c6cfffbddd by R David Murray in branch 'default':
Merge: #18044: Fix parsing of encoded words of the form =?utf8?q?=XX...?=
http://hg.python.org/cpython/rev/32c6cfffbddd

--
nosy: +python-dev

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



[issue18044] Email headers do not properly decode to unicode.

2013-07-11 Thread R. David Murray

R. David Murray added the comment:

This is actually two separate bugs, both a bit embarrassing.  The first one 
(that I just fixed) is that when parsing an encoded word I was only checking 
for decimal digits after an '=' (instead of the correct hex digits) when trying 
to do robust detection of encoded word limits.  

The second (the address one) is due to the fact that somewhere between stopping 
my full time work on the email project and actually committing the code, I lost 
track of the fact that I never implemented encoded word parsing for anything 
other than unstructured headers.  The infrastructure is there, I just need to 
write tests and hook it up.  

I'm going to open a separate issue for that.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 3.4

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread Madison May

Madison May added the comment:

Why would something like the following work?

#At the beginning of peek()
#keep track of prior offset
position = self.fileobj.tell()

#immediately before return statement
#restore previous fileobj offset
self.fileobj.seek(position)

--
nosy: +madison.may

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread Madison May

Madison May added the comment:

*wouldn't

--

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



[issue18431] Encoded words in structured headers are not decoded by the new parser.

2013-07-11 Thread R. David Murray

New submission from R. David Murray:

The subject says it all, but here is an example (from issue 18044):

msg = message_from_string('To: =?utf-8?q?Eric?= f...@example.com\n\n', 
policy=default)
msg['To']
   '=?utf-8?q?Eric?= f...@example.com'

--
components: email
messages: 192897
nosy: Tim.Rawlinson, barry, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: Encoded words in structured headers are not decoded by the new parser.
type: behavior
versions: Python 3.3, Python 3.4

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



[issue18044] Email headers do not properly decode to unicode.

2013-07-11 Thread R. David Murray

R. David Murray added the comment:

The issue for the second bug is issue 18431.

--

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread R. David Murray

R. David Murray added the comment:

Regardless of whether or not it *can* be fixed, I personally would not expect 
the file position to be either unchanged or predictable.  The file object is 
being passed to something that is going to read and/or write from it, after 
all.  If the calling application needs the file to be in a particular seek 
position, it should save it and reset it, I think.

--
nosy: +r.david.murray

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



[issue17944] Refactor test_zipfile

2013-07-11 Thread Zachary Ware

Zachary Ware added the comment:

No complaints here.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17944
___
___
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-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 01a46dc00fc8 by Victor Stinner in branch 'default':
Issue #18408: slot_tp_str() must not fallback on slot_tp_repr() on error
http://hg.python.org/cpython/rev/01a46dc00fc8

--

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



[issue17987] test.support.captured_stderr, captured_stdin not documented

2013-07-11 Thread Dmi Baranov

Dmi Baranov added the comment:

Yeah, my first patch applied :) thanks, David

--

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread Nick Bargnesi

Nick Bargnesi added the comment:

In that the underlying file position is not deterministic when used like this, 
I'm inclined to agree.

Though faced with documentation stating it does not advance the file 
position, it certainly is less than explicit about it.

--

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



[issue18428] IDLE startup error

2013-07-11 Thread Ned Deily

Ned Deily added the comment:

To help see what the problem is open a Terminal shell window and type:
cd $HOME
ls -l .idlerc/*
cat .idlerc/*

Then try typing:
/usr/local/bin/idle3.3

If that fails, try:
/usr/local/bin/idle3.3 -n

For all of the above, please update this issue with a copy and paste of the 
resulting outputs.

--
nosy: +ned.deily

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread R. David Murray

R. David Murray added the comment:

Hmm, yes.  Perhaps it should say does not advance the gzip read position?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18430
___
___
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-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 39eb1ce5f377 by Victor Stinner in branch 'default':
Issue #18408: ste_new() initialize all attributes before handling error
http://hg.python.org/cpython/rev/39eb1ce5f377

New changeset aaa6e8b8a5c9 by Victor Stinner in branch 'default':
Issue #18408: Fix compiler_import() to handle PyUnicode_Substring() failure 
properly
http://hg.python.org/cpython/rev/aaa6e8b8a5c9

New changeset ff93930a53c0 by Victor Stinner in branch 'default':
Issue #18408: parsetok() must not write into stderr on memory allocation error
http://hg.python.org/cpython/rev/ff93930a53c0

New changeset 1a1869baec4c by Victor Stinner in branch 'default':
Issue #18408: Fix _Pickler_New() and _Unpickler_New(): initialize all
http://hg.python.org/cpython/rev/1a1869baec4c

New changeset e11121b9bd09 by Victor Stinner in branch 'default':
Issue #18408: _elementtree.c now handles create_extra() failure
http://hg.python.org/cpython/rev/e11121b9bd09

New changeset 0877e17fa25e by Victor Stinner in branch 'default':
Issue #18408: Different fixes in _elementtree.c to handle correctly MemoryError
http://hg.python.org/cpython/rev/0877e17fa25e

--

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



[issue15968] Incorporate Tcl/Tk/Tix into the Windows build process

2013-07-11 Thread Zachary Ware

Zachary Ware added the comment:

I'm not sure that moving the tcltk output dir into PCbuild is the right way to 
go about making different versions of Tcl/Tk available to different Python 
versions.  For one, because it's not true if you're working out of a single 
checkout for multiple versions.  I think I'd rather see 'tcltk'/'tcltk64' stay 
where they are, but grow extensions to denote different 
builds--'tcltk-Win32-py34' and 'tcltk-x64-py35', for example.  Also, 
PCbuild/rt.bat needs to be updated if tcltk[64] is changed.

I can't comment much on buildlib.py as I haven't had the time to learn 
everything I'd need to to understand it all, but it seems to work well doing 
what it is meant to do.  However, it does seem like substantial overkill for 
what the comment at the top says it is for :P

Barring the issues I've raised so far, I really like the general idea and 
direction of the patch.  I really hope this can make it to inclusion before too 
long.

--

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



[issue17911] Extracting tracebacks does too much work

2013-07-11 Thread Björn Sandberg Lynch

Björn Sandberg Lynch added the comment:

After thinking about it, I decided to defer instead of suppress line fetching. 
Suppressing would still give a traceback later, but not the same as the 
original.

extract_exception is where the meat is. There's a slight quirk in how context 
works - if cause is set to something else than the actual exception, context 
still gets set even though it won't be printed. This is to enable later 
analysis. However, if you explicitly 'raise Exception from None' neither of 
them will be set - the formatting code would have issues otherwise.

I'm not too happy about the code duplication between the format_exception 
method and the formatting that works on exceptions directly, but there are 
plenty of tests to ensure that the output is identical.

Feel free to dispute my naming choices. I'm admittedly influenced by twisted.

--
keywords: +patch
Added file: http://bugs.python.org/file30895/traceback.patch

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread Nick Bargnesi

Nick Bargnesi added the comment:

That's an improvement.

Using wording similar to the constructor's:

Calling a GzipFile object’s peek() method does not advance its position, but 
the fileobj may be affected. The caller may wish to save the fileobj position 
prior to calling peek() and resetting it upon return.

--

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread Madison May

Madison May added the comment:

Sounds good to me.

--

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



[issue18365] Idle: mock Text class and test thereof

2013-07-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Upon further review and tests, I notice that ._decode
* is a partial implementation of Text.index,
* so it should be renamed index and tested against Text.index,
* and it currently returns the wrong values for 'end' and high out-of-bounds 
indexes.

Tests with 'end' only pass now because the tested methods ignore the buggy 
decode for 'end' and special-case it instead. When I added tests with out of 
bounds indexes, they failed. I am working now on fixing all this.

Spaces are supposed to follow arg-separating commas in function calls. The 
initial patch lacked them and I have added them. I need them because they make 
code easier for *me* to read and review, which is an example of why PEP-8 
requires them.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18365
___
___
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-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 51eddca9dd6f by Victor Stinner in branch 'default':
Issue #18408: parsetok() must not write into stderr on memory allocation error
http://hg.python.org/cpython/rev/51eddca9dd6f

New changeset 5e50f1a0c985 by Victor Stinner in branch 'default':
Issue #18408: In debug mode, PyCFunction_Call() now checks if an exception was
http://hg.python.org/cpython/rev/5e50f1a0c985

--

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



[issue18430] gzip, bz2, lzma: peek advances file position of existing file object

2013-07-11 Thread Nick Bargnesi

Nick Bargnesi added the comment:

Proposed documentation change to gzip, bz2, and lzma modules, in patch form.

--
keywords: +patch
Added file: http://bugs.python.org/file30896/issue18430.patch

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



[issue18365] Idle: mock Text class and test thereof

2013-07-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Whoops, I got that partly wrong in that index returns a 'r.c' string after 
doing what _decode is supposed to do, which is to decode the input according to 
the current text. The mock index should just return '%s.%s' % 
_decode(position). There is still the point that index and _decode now give 
different coordinates for 'end' and that _decode should be tested by testing 
mock index, which wraps it, against tk index.

Since tk.Text args can be passed by name, the mock methods should use the same 
parameter names.

--

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



[issue18365] Idle: mock Text class and test thereof

2013-07-11 Thread Phil Webster

Phil Webster added the comment:

Thanks Terry, I will start PEP8-checking my code before I submit (as well as 
testing more thoroughly). I was thinking the same thing about the logic behind 
_decode and index functions needing to be combined.

How would you recommend adding functionality to the decode function to handle 
expressions like 1.2 +5 chars or 1.0 lineend-5c? AutoComplete.py (#18409) 
uses this kind of index, so it will be needed soon. I'm thinking that splitting 
off the base index then parsing the remaining modifier expressions is the way 
to go.

I was also thinking that a _checkIndex method would be good to have especially 
when using the +/-line and +/-char expressions.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18365
___
___
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-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4975bcd67aa7 by Victor Stinner in branch 'default':
Issue #18408: normalizestring() now raises MemoryError on memory allocation 
failure
http://hg.python.org/cpython/rev/4975bcd67aa7

New changeset 1eac89af9acf by Victor Stinner in branch 'default':
Issue #18408: Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroy
http://hg.python.org/cpython/rev/1eac89af9acf

New changeset d9446c2a2fd4 by Victor Stinner in branch 'default':
Issue #18408: ceval.c: in debug mode, convert the PyErr_Occurred() check on
http://hg.python.org/cpython/rev/d9446c2a2fd4

New changeset 2f7c4df5cc46 by Victor Stinner in branch 'default':
Issue #18408: errors.c: in debug mode, calling PyErr_BadInternalCall() now
http://hg.python.org/cpython/rev/2f7c4df5cc46

New changeset affb87b1d7ec by Victor Stinner in branch 'default':
Issue #18408: pmerge() help of mro_implementation() now raises MemoryError on
http://hg.python.org/cpython/rev/affb87b1d7ec

New changeset f85fcbbbe8de by Victor Stinner in branch 'default':
Issue #18408: _PyMemoTable_ResizeTable() now restores the old table if
http://hg.python.org/cpython/rev/f85fcbbbe8de

New changeset bb5da6e795a1 by Victor Stinner in branch 'default':
Issue #18408: _pickle.c: Add missing PyErr_NoMemory() on memory allocation 
failures
http://hg.python.org/cpython/rev/bb5da6e795a1

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18408
___
___
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-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 89c6495d1ff2 by Victor Stinner in branch 'default':
Issue #18408: Fix parser.sequence2st() and parser.tuple2st(): raise MemoryError
http://hg.python.org/cpython/rev/89c6495d1ff2

New changeset c80a9705803a by Victor Stinner in branch 'default':
Issue #18408: parser module: fix error handling in node2tuple()
http://hg.python.org/cpython/rev/c80a9705803a

--

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



[issue6926] socket module missing IPPROTO_IPV6, IPPROTO_IPV4

2013-07-11 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6926
___
___
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-11 Thread Sergey

Sergey added the comment:

Steven D'Aprano noticed that there's an obscure case of:

 class A(list):
... def __add__(self, other):
... return A(super(A,self).__add__(other))
... def __radd__(self, other):
... return A(other) + self
...

Where:
 type( [1] + A([2]) )
class '__main__.A'

Is different from:

 type( [1].__add__(A([2])) )
class 'list'

To keep such an undefined behavior unchanged I updated the 
fastsum-special-tuplesandlists.patch to have a more strict type check.

In case somebody would like to test it, the patch is attached. It should work 
for both Python 2.7 and Python 3.3, and should introduce no behavior change.

--
Added file: 
http://bugs.python.org/file30897/fastsum-special-tuplesandlists.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18305
___
___
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-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 60b1d7967ef8 by Victor Stinner in branch 'default':
Issue #18408: Fix create_extra() of _elementtree.c, raise MemoryError on memory
http://hg.python.org/cpython/rev/60b1d7967ef8

New changeset 1e0afd558ba3 by Victor Stinner in branch 'default':
Issue #18408: Fix constructors of _elementtree.c
http://hg.python.org/cpython/rev/1e0afd558ba3

--

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



[issue18365] Idle: mock Text class and test thereof

2013-07-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The real problem with 'end' and 'big.m' is that there are three proper 
decodings, depending on the method asking. I think this patch mostly solves the 
problems mentioned before. All tests, including many new ones, pass.

--
Added file: http://bugs.python.org/file30898/mock_text5.diff

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