[issue19958] Assignment success despite TypeError exception

2013-12-12 Thread Dmitrii Dimandt

New submission from Dmitrii Dimandt:

Observed behaviour:

Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
>>> a = (1, [2,3])
>>> a[1] += [4,5]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'tuple' object does not support item assignment
>>> a
(1, [2, 3, 4, 5])


Expected behaviour: tuple remains unchanged

--
components: Interpreter Core
messages: 205945
nosy: Dmitrii.Dimandt
priority: normal
severity: normal
status: open
title: Assignment success despite TypeError exception
versions: Python 2.7

___
Python tracker 

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



[issue19958] Assignment success despite TypeError exception

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

Oh, this behaviour is really weird. It can probably be explained by the fact 
that the INPLACE_ADD operator is used. See the bytecode for an explanation.

I don't know if it's possible to workaround this issue.

$ python3
Python 3.3.2 (default, Nov  8 2013, 13:38:57) 
[GCC 4.8.2 20131017 (Red Hat 4.8.2-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a=(1,[])
>>> a[1].append(2)
>>> a
(1, [2])
>>> a[1]+=[3]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'tuple' object does not support item assignment
>>> a
(1, [2, 3])
>>> def bug(a):
...  a[1] += [4]
... 
>>> import dis
>>> dis.dis(bug)
  2   0 LOAD_FAST0 (a) 
  3 LOAD_CONST   1 (1) 
  6 DUP_TOP_TWO  
  7 BINARY_SUBSCR
  8 LOAD_CONST   2 (4) 
 11 BUILD_LIST   1 
 14 INPLACE_ADD  
 15 ROT_THREE
 16 STORE_SUBSCR 
 17 LOAD_CONST   0 (None) 
 20 RETURN_VALUE 
>>> a
(1, [2, 3])
>>> bug(a)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in bug
TypeError: 'tuple' object does not support item assignment
>>> a
(1, [2, 3, 4])

--
nosy: +haypo, rhettinger, serhiy.storchaka
versions: +Python 3.3, Python 3.4

___
Python tracker 

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



[issue19958] Assignment success despite TypeError exception

2013-12-12 Thread Ezio Melotti

Ezio Melotti added the comment:

http://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works

--
nosy: +ezio.melotti
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2013-12-12 Thread Vajrasky Kok

Vajrasky Kok added the comment:

FYI, if you change:

setattr(b, 'say', types.MethodType(f.say, b))

to:

setattr(b, 'say', types.MethodType(Foo.say, b))

it will print the source correctly.

--
nosy: +vajrasky

___
Python tracker 

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



[issue19959] argparse.FileType does not expand tilde "~"

2013-12-12 Thread Garth Bushell

New submission from Garth Bushell:

argparse.FileType does not expand tilde "~". 

This would be useful to take file parameters beginning with "~" and use 
os.path.expanduser to expand this.

--
components: Library (Lib)
messages: 205949
nosy: garthy
priority: normal
severity: normal
status: open
title: argparse.FileType does not expand tilde "~"
versions: Python 3.5

___
Python tracker 

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



[issue19959] argparse.FileType does not expand tilde "~"

2013-12-12 Thread Garth Bushell

Garth Bushell added the comment:

Add patch to add an option to argparse.FileType to enable expanduser.

--
keywords: +patch
Added file: 
http://bugs.python.org/file33100/19959-argparse_filetype_expanduser.patch

___
Python tracker 

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



[issue19959] argparse.FileType does not expand tilde "~"

2013-12-12 Thread Garth Bushell

Changes by Garth Bushell :


--
type:  -> enhancement

___
Python tracker 

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



[issue5305] imaplib should support international mailbox names

2013-12-12 Thread Daniël van Eeden

Changes by Daniël van Eeden :


--
nosy: +dveeden

___
Python tracker 

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



[issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used

2013-12-12 Thread Wim

Wim added the comment:

FWIW: I noticed that my patch has a bug due to sharing the cache dict between 
element names and attribute names, although I think this is unlikely to crop up 
very often in practice. I'll submit a better patch if/when I get the time to 
put one together.

--

___
Python tracker 

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



[issue19960] MacOSX: Building 2.7 without the xcode command line tools installed

2013-12-12 Thread Ronald Oussoren

New submission from Ronald Oussoren:

When you build python 2.7 on an OSX 10.9 machine with Xcode but without the 
command-line tools installed that build mostly succeeds, but doesn't detect a 
number of dependencies (in particular zlib).

The attached patch teaches "add_dir_to_list" about the SDK sysroot on OSX and 
with that the build succeeds.

Aside: I also noticed problems with build tinter, with 2.7 but also with 3.3 
and 3.4. I'll file a separate issue about that.

--
assignee: ronaldoussoren
components: Build
files: python2.7-alternative-sdk.txt
keywords: needs review, patch
messages: 205952
nosy: hynek, ned.deily, ronaldoussoren
priority: normal
severity: normal
stage: patch review
status: open
title: MacOSX: Building 2.7 without the xcode command line  tools installed
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file33101/python2.7-alternative-sdk.txt

___
Python tracker 

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



[issue19961] MacOSX: Tkinter build failure when building without command-line tools

2013-12-12 Thread Ronald Oussoren

New submission from Ronald Oussoren:

When you build python on an OSX 10.9 machine with Xcode but without the 
command-line tools installed that build mostly succeeds, but Tkinter fails to 
build.

The following error message is from a 2.7 build, but the same problem occurs 
when building 3.3 and 3.4:

clang -fno-strict-aliasing -fno-common -dynamic -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
 -fexceptions -g -O0 -Wall -Wstrict-prototypes -DWITH_APPINIT=1 
-I/System/Library/Frameworks/Tcl.framework/Headers 
-I/System/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders 
-I/System/Library/Frameworks/Tk.framework/Headers 
-I/System/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders 
-I/usr/X11R6/include -I/Users/ronald/Projects/python/rw/2.7/Mac/Include -I. 
-IInclude -I../Include -I/Users/ronald/Projects/python/rw/2.7/Include 
-I/Users/ronald/Projects/python/rw/2.7/build -c 
/Users/ronald/Projects/python/rw/2.7/Modules/_tkinter.c -o 
build/temp.macosx-10.8-intel-2.7-pydebug/Users/ronald/Projects/python/rw/2.7/Modules/_tkinter.o
 -framework Tk -arch x86_64 -arch i386
clang: warning: -framework Tk: 'linker' input unused
In file included from 
/Users/ronald/Projects/python/rw/2.7/Modules/_tkinter.c:71:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/tk.h:78:11:
 fatal error: 
  'X11/Xlib.h' file not found
#   include 
^
1 error generated.


NOTE: I haven't tried building with the command-line tools for xcode installed, 
I have a freshly installed system and want to try to live without these tools 
because that makes it easier to upgrade xcode.

--
components: Build
messages: 205953
nosy: hynek, ned.deily, ronaldoussoren
priority: normal
severity: normal
stage: needs patch
status: open
title: MacOSX: Tkinter build failure when building without command-line tools
type: compile error
versions: Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue19959] argparse.FileType does not expand tilde "~"

2013-12-12 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue19959] argparse.FileType does not expand tilde "~"

2013-12-12 Thread Garth Bushell

Garth Bushell added the comment:

Update patch to include docs.

--
Added file: 
http://bugs.python.org/file33102/19959-argparse_filetype_expanduser_plus_doc.patch

___
Python tracker 

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



[issue12836] ctypes.cast() creates circular reference in original object

2013-12-12 Thread Mark Dickinson

Mark Dickinson added the comment:

> Possibly, the result's b_objects needs to be a copy of the src's b_objects

That sounds right to me.  I can't really believe that the current behaviour is 
intentional.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue19957] Minor refactor of Lib/email/encoders.py

2013-12-12 Thread R. David Murray

R. David Murray added the comment:

Good point, thanks for the patch.

--

___
Python tracker 

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



[issue19962] Create a 'python.bat' script to invoke interpreter from source root

2013-12-12 Thread Zachary Ware

New submission from Zachary Ware:

The attached patch adds a CustomBuildStep to python.vcxproj which creates a 
'python.bat' script in the root of the source tree for quicker and easier 
invocation for testing purposes, and to make the Windows Python developer 
experience a little closer to the UNIX experience.  Sample output:

"""
C:\path\to\cpython>type python.bat
@rem This script invokes the most recently built Python with all arguments
@rem passed through to the interpreter.  This file is generated by the
@rem build process and any changes *will* be thrown away by the next
@rem rebuild.
@rem This is only meant as a convenience for developing CPython
@rem and using it outside of that context is ill-advised.
@echo Running Debug^|Win32 interpreter...
@"C:\path\to\cpython\PCbuild\python_d.exe" %*

C:\path\to\cpython>python -c "import sys;print(sys.version)"
Running Debug|Win32 interpreter...
3.4.0b1 (default:6864abd8e83a+, Dec 12 2013, 08:35:32) [MSC v.1600 32 bit (Intel
)]
"""

As the commentary (which can likely be improved) states, the script is 
re-created by every rebuild, so it always points to the most recently built 
interpreter.  Also, being a CustomBuildStep, it is cleaned up automatically by 
the Clean build target.

I'm not sure whether echoing the interpreter configuration is the best idea, 
but I personally prefer that over echoing the full command which has the 
potential to be very long.  I think that the Configuration/Platform should be 
displayed somehow to reduce confusion since there could be up to 8 different 
interpreters living together in PCbuild (not to mention PC/VS10.0, when it 
exists someday) and python.bat will only point to one of them.

Note that the x64 changes are done by hand and untested; I don't have the 
ability to do so just yet.

--
assignee: zach.ware
components: Build, Windows
files: python.bat.diff
keywords: patch
messages: 205957
nosy: brian.curtin, loewis, tim.golden, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Create a 'python.bat' script to invoke interpreter from source root
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file33103/python.bat.diff

___
Python tracker 

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



[issue19963] Update docs for importlib.import_module()

2013-12-12 Thread Brett Cannon

New submission from Brett Cannon:

The docs for importlib.import_module() say that you need to import parent 
packages first, but this is actually no longer the case (thankfully):

Python 3.4.0b1 (default:a3bdbe220f8a, Dec 10 2013, 11:07:04) 
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> 'test' in sys.modules
False
>>> import importlib
>>> importlib.import_module('test.test_importlib.source')



Also need to check if this is false in Python 3.3 (or wherever the change 
occurred) to update the docs there and to add a versionchanged flag.

--
assignee: brett.cannon
components: Documentation
messages: 205958
nosy: brett.cannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Update docs for importlib.import_module()
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue19957] Minor refactor of Lib/email/encoders.py

2013-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Then special case for iso-2022-* is not needed too.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue19572] Report more silently skipped tests as skipped

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1ad2ff119356 by Zachary Ware in branch '3.3':
Avoid UnicodeEncodeError by only printing ASCII.
http://hg.python.org/cpython/rev/1ad2ff119356

--

___
Python tracker 

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



[issue12836] ctypes.cast() creates circular reference in original object

2013-12-12 Thread Vinay Sajip

Vinay Sajip added the comment:

Adding Thomas Heller to nosy to see if he can shed any light on this.

--
nosy: +theller

___
Python tracker 

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



[issue19964] '?' is always non-greedy

2013-12-12 Thread Sworddragon

New submission from Sworddragon:

>From the documentation: "The '*', '+', and '?' qualifiers are all greedy;"

But this is not the case for '?'. In the attachments is an example which shows 
this: re.search(r'1?', '01') should find '1' but it doesn't find anything.

--
components: Library (Lib)
files: test.py
messages: 205962
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: '?' is always non-greedy
type: behavior
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file33104/test.py

___
Python tracker 

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



[issue19954] test_tk floating point exception on my gentoo box running tk 8.6.1

2013-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Does separated test crash?

./python -m test -v -uall -m test_indicatoron test_tk

--

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2013-12-12 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis:

A user reported this error with `make -j${high_value}`:


x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/_warnings.o Python/_warnings.c
/bin/mkdir -p Include
python3.3 ./Parser/asdl_c.py -h Include ./Parser/Python.asdl
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/asdl.o Python/asdl.c
make Parser/pgen
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/bltinmodule.o Python/bltinmodule.c
make[1]: Entering directory 
'/var/tmp/portage/dev-lang/python-3.3.3-r1000/work/Python-3.3.3'
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/dynamic_annotations.o Python/dynamic_annotations.c
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/mysnprintf.o Python/mysnprintf.c
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/ceval.o Python/ceval.c
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/pyctype.o Python/pyctype.c
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Parser/tokenizer_pgen.o Parser/tokenizer_pgen.c
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/codecs.o Python/codecs.c
Python/bltinmodule.c:4:24: warning: Include/Python-ast.h is shorter than 
expected [enabled by default]
 #include "Python-ast.h"
^
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/errors.o Python/errors.c
In file included from Python/bltinmodule.c:10:0:
Include/ast.h:7:1: warning: parameter names (without types) in function 
declaration [enabled by default]
 PyAPI_FUNC(int) PyAST_Validate(mod_ty);
 ^
In file included from Include/Python.h:50:0,
 from Python/bltinmodule.c:3:
Include/ast.h:8:12: error: unknown type name ‘mod_ty’
 PyAPI_FUNC(mod_ty) PyAST_FromNode(
^
Include/pyport.h:777:34: note: in definition of macro ‘PyAPI_FUNC’
 #   define PyAPI_FUNC(RTYPE) RTYPE
  ^
Python/bltinmodule.c: In function ‘builtin_compile’:
Python/bltinmodule.c:641:13: error: unknown type name ‘mod_ty’
 mod_ty mod;
 ^
Python/bltinmodule.c:647:21: warning: comparison between pointer and integer 
[enabled by default]
 if (mod == NULL) {
 ^
Python/bltinmodule.c:656:49: warning: passing argument 1 of ‘PyAST_CompileEx’ 
makes pointer from integer without a cast [enabled by default]
 &cf, optimize, arena);
 ^
In file included from Include/Python.h:122:0,
 from Python/bltinmodule.c:3:
Include/compile.h:33:28: note: expected ‘struct _mod *’ but argument is of type 
‘int’
 PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx(
^
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Python/frozenmain.o Python/frozenmain.c
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Parser/printgrammar.o Parser/printgrammar.c
Makefile:1362: recipe for target 'Python/bltinmodule.o' failed
make: *** [Python/bltinmodule.o] Error 1
make: *** Waiting for unfinished jobs
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Parser/parsetok_pgen.o Parser/parsetok_pgen.c
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG  -O2 
-march=atom -pipe -fwrapv-I. -IInclude -I./Include   -fPIC -DPy_BUILD_CORE 
-o Parser/pgenmain.o Parser/pgenmain.c
x86_64-pc-linux-gnu-gcc -pthread -DNDEBUG  -Wl,-O1 -Wl,--sort-common 
-Wl,--as-needed  Parser/acceler.o Parser/grammar1.o Parser/listnode.o 
Parser/node.o Parser/parser.o Parser/bitset.o Parser/metagrammar.o 
Parser/firstsets.o Parser/grammar.o Parser/pgen.o Objects/obmalloc.o 
Python/dynamic_annotations.o

[issue19964] '?' is always non-greedy

2013-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't think the documentation is wrong. re.search() returns first match, and 
this is empty string at position 0.

>>> import re
>>> re.search('1?', '01')
<_sre.SRE_Match object; span=(0, 0), match=''>

All matches:

>>> list(re.findall('1?', '01'))
['', '1', '']
>>> list(re.finditer('1?', '01'))
[<_sre.SRE_Match object; span=(0, 0), match=''>, <_sre.SRE_Match object; 
span=(1, 2), match='1'>, <_sre.SRE_Match object; span=(2, 2), match=''>]

--
nosy: +ezio.melotti, pitrou, serhiy.storchaka
resolution:  -> invalid

___
Python tracker 

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



[issue19964] '?' is always non-greedy

2013-12-12 Thread Tim Peters

Changes by Tim Peters :


--
stage:  -> committed/rejected

___
Python tracker 

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



[issue19964] '?' is always non-greedy

2013-12-12 Thread Tim Peters

Tim Peters added the comment:

It's working fine.  `.search()` always finds the leftmost position at which the 
pattern matches.  In your example, the pattern '1?' does match at index 0:  it 
first tries to match `1' at index 0.  That's the greedy part.  The attempt 
fails, so it next tries to match the empty string at index 0.  That succeeds, 
which you can see by printing search.span(0) (which displays (0, 0)).

Of course you'd get exactly the same result if you tried matching `1*` instead. 
 But you'd get a different result from matching '1+', because that pattern does 
_not_ match at index 0.  In that case the engine has to move to index 1 to get 
a match.

And if you search the string '11' with the pattern '1?`, you'll see that it 
does match the slice 0:1.  If, as you claimed, ? were not greedy, it would 
match the empty string 0:0 instead.

--
nosy: +tim.peters

___
Python tracker 

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



[issue19964] '?' is always non-greedy

2013-12-12 Thread Tim Peters

Changes by Tim Peters :


--
status: open -> closed

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2013-12-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, serhiy.storchaka

___
Python tracker 

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



[issue19966] Wrong mtimes of files in 3.3.3 tarballs

2013-12-12 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis:

This bug is present in 3.3.3 tarballs (Python-3.3.3.tar.bz2, 
Python-3.3.3.tar.xz, Python-3.3.3.tgz). This bug is absent in 3.3.2 tarballs.

In unpacked 3.3.2:

$ ./configure
...
$ make Include/Python-ast.h
make: 'Include/Python-ast.h' is up to date.
$ make Python/Python-ast.c
make: 'Python/Python-ast.c' is up to date.


In unpacked 3.3.3:

$ ./configure
...
$ make Include/Python-ast.h
/bin/mkdir -p Include
python3.3 ./Parser/asdl_c.py -h Include ./Parser/Python.asdl
$ make Python/Python-ast.c
/bin/mkdir -p Python
python3.3 ./Parser/asdl_c.py -c Python ./Parser/Python.asdl


At least please fix the script used to generate tarballs, to ensure that this 
bug will not occur with future tarballs.

--
components: Build
messages: 205967
nosy: Arfrever, georg.brandl
priority: normal
severity: normal
status: open
title: Wrong mtimes of files in 3.3.3 tarballs
versions: Python 3.3

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2013-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think os.replace() should be used instead os.rename(). Or pair 
os.unlink()/os.rename().

And perhaps for decreasing chance of race between creating .c and .h files, 
both renames should be done after writing both files.

--

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2013-12-12 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

'p' variable in one part of code has different value than in other part.

--

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2013-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We can save them in a list of created files.

--

___
Python tracker 

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



[issue19957] Minor refactor of Lib/email/encoders.py

2013-12-12 Thread R. David Murray

R. David Murray added the comment:

Yes, in theory that should be true at this point.

--

___
Python tracker 

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



[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2013-12-12 Thread Muhammad Tauqir Ahmad

Muhammad Tauqir Ahmad added the comment:

Yes I understand your change and other possible changes will fix the 
reproducer. I am already using a different workaround in my code.

The issue is about `inspect.getsource()` having incorrect behavior (or at least 
inaccurate error message) and MethodType able to be constructed from another 
method leading to strange undocumented behavior (as far as I can tell).

I do not know what the correct resolution is to this issue which is why I 
posted this here so someone can suggest/approve a resolution and I can submit a 
patch once something is decided.

--

___
Python tracker 

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



[issue19954] test_tk floating point exception on my gentoo box running tk 8.6.1

2013-12-12 Thread R. David Murray

R. David Murray added the comment:

rdmurray@hey:~/python/p34>./python -m test -v -uall -m test_indicatoron test_tk
== CPython 3.4.0b1 (default:59fb79d0411e, Dec 11 2013, 16:39:28) [GCC 4.7.2]
==   
Linux-3.10.6-gentoo-i686-Intel-R-_Core-TM-_i5_CPU_M_450_@_2.40GHz-with-gentoo-2.2
 little-endian
==   hash algorithm: siphash24 32bit
==   /home/rdmurray/python/p34/build/test_python_4151
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_tk
patchlevel = 8.6.1
test_indicatoron (tkinter.test.test_tkinter.test_widgets.CheckbuttonTest) ... ok
test_indicatoron (tkinter.test.test_tkinter.test_widgets.MenubuttonTest) ... 
Fatal Python error: Floating point exception

Current thread 0xb74f76c0 (most recent call first):
  File "/home/rdmurray/python/p34/Lib/tkinter/__init__.py", line 1254 in 
_configure
  File "/home/rdmurray/python/p34/Lib/tkinter/__init__.py", line 1263 in 
configure
  File "/home/rdmurray/python/p34/Lib/tkinter/__init__.py", line 1270 in 
__setitem__
  File "/home/rdmurray/python/p34/Lib/tkinter/test/widget_tests.py", line 47 in 
checkParam
  File "/home/rdmurray/python/p34/Lib/tkinter/test/widget_tests.py", line 116 
in checkBooleanParam
  File "/home/rdmurray/python/p34/Lib/tkinter/test/widget_tests.py", line 422 
in test_indicatoron
  File "/home/rdmurray/python/p34/Lib/unittest/case.py", line 574 in run
  File "/home/rdmurray/python/p34/Lib/unittest/case.py", line 622 in __call__
  File "/home/rdmurray/python/p34/Lib/unittest/suite.py", line 117 in run
  File "/home/rdmurray/python/p34/Lib/unittest/suite.py", line 79 in __call__
  File "/home/rdmurray/python/p34/Lib/unittest/suite.py", line 117 in run
  File "/home/rdmurray/python/p34/Lib/unittest/suite.py", line 79 in __call__
  File "/home/rdmurray/python/p34/Lib/unittest/runner.py", line 168 in run
  File "/home/rdmurray/python/p34/Lib/test/support/__init__.py", line 1685 in 
_run_suite
  File "/home/rdmurray/python/p34/Lib/test/support/__init__.py", line 1719 in 
run_unittest
  File "/home/rdmurray/python/p34/Lib/test/test_tk.py", line 22 in test_main
  File "/home/rdmurray/python/p34/Lib/test/regrtest.py", line 1278 in 
runtest_inner
  File "/home/rdmurray/python/p34/Lib/test/regrtest.py", line 978 in runtest
  File "/home/rdmurray/python/p34/Lib/test/regrtest.py", line 763 in main
  File "/home/rdmurray/python/p34/Lib/test/regrtest.py", line 1562 in 
main_in_temp_cwd
  File "/home/rdmurray/python/p34/Lib/test/__main__.py", line 3 in 
  File "/home/rdmurray/python/p34/Lib/runpy.py", line 73 in _run_code
  File "/home/rdmurray/python/p34/Lib/runpy.py", line 160 in _run_module_as_main
zsh: floating point exception  ./python -m test -v -uall -m test_indicatoron 
test_tk

--

___
Python tracker 

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



[issue19954] test_tk floating point exception on my gentoo box running tk 8.6.1

2013-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What if run following code?

import tkinter
root = tkinter.Tk()
widget = tkinter.Menubutton(root)
for value in (True, 1, 'true', 'yes', 'on'):
print(value, flush=True)
widget['indicatoron'] = value

--

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2013-12-12 Thread Charles-François Natali

Charles-François Natali added the comment:

Since the patch doesn't use O_EXCL for the temporary file, it suffers
from the exact same race condition as the current code. It should be
using the "x" open mode.

--
nosy: +neologix

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2013-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Since the patch doesn't use O_EXCL for the temporary file, it suffers
> from the exact same race condition as the current code.

This does not make race condition. Only one thread writes .tmp files.

The problem is that other threads can read *-ast.[ch] files while they are 
written.

--

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2013-12-12 Thread Charles-François Natali

Charles-François Natali added the comment:

>
>
> > Since the patch doesn't use O_EXCL for the temporary file, it suffers
> > from the exact same race condition as the current code.
>
> This does not make race condition. Only one thread writes .tmp files.
>
> The problem is that other threads can read *-ast.[ch] files while they are
> written.
>

Ah, I thought it was written by several processes. It's OK then.

--

___
Python tracker 

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



[issue19623] Support for writing aifc to unseekable file

2013-12-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue16669] Docstrings for namedtuple

2013-12-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

A few quick thoughts:

* Everyone can agree "docstrings are good".
* I disagree with Ned that the current docstrings
  are ugly or not useful.  The class docstring is
  shown by tooltips and is immediately useful to
  someone making a instance.  The attribute docstrings
  add value by indicating position (named tuples are
  fundamentally sequences, so the position matters).
* Unlike method docstrings, the attribute docstrings
  are only visible in help().  As TJR noted, most
  users will never see them or expect them.
* That said, tuples are like records in a database
  and it is common in the database world to have a
  data dictionary that provides more detail than 
  the field name.
* In general, I'm unsympathetic to "my automatically
  generated docs aren't pretty".  My experience with
  auto-generated docs suggests that you almost always
  have to manually make improvements.  The nature of
  auto-generated code or docs is that the output is
  usable but not pretty.
* I am very sympathetic to how difficult it is to add
  or modify property docstrings after the fact.  This
  isn't unique to named tuples but the problem is felt
  more acutely.
* The intended ways to extend named tuples is to either
  1) subclass the NT and change anything that doesn't
  suit your needs, or 2) use the generated source as
  a starting point and edit it directly.  In the case
  of a module docstring, either method works fine. In
  the case of attribute docstrings, the first method is
  a PITA because you have to recreate the whole property
  definition.
* To me, that is the only point in favor of the feature
  request.  Where the implementation currently makes
  something difficult, it would be nice to provide a
  smoother, standardized solution.
* That said, there are downsides to make the patch.
  It complicates the API, making named tuples harder
  to teach, to learn, or to remember.  The docs for
  named tuples are turning into a book.  Factories
  that provide too many options are harder to use.
  In addition, the patch further complicates the
  named tuple implementation.  And to the extent that
  users provide multi-line docstrings for the attributes,
  the visual appearance of the generated code gets ugly
  and the visual appearance of the call to named tuple
  factory becomes somewhat awkward.
* There is no question about whether the functionality
  might occassionally be useful and whether it is currently
  hard to implement using subclassing.  The question boils
  down to balancing aesthetics trade-offs (i.e. improving
  the aesthetic of automated generated docs versus hurting
  the aesthetics of 1) the factory function signature,
  2) the generated code (which is intende to be viewed,
  studied, cut-and-pasted, exec'ed, etc), and complexity
  of the collections module code for named tuples.
* Since 2.7 was long since released, the earliest anyone
  would see a change in Python 3.5.  The other ships have
  already sailed.
* One last thought.  I worry about over-parameterizing
  named tuples.  If I had it to do over again, I wouldn't
  have added the *rename* option.  The *verbose* option
  is no longer necessary because of the *_source* attribute.
  There is a *module* parameter being added that will only
  be used in rare cases.  There was a requests for a
  *type_specifiers* parameter to type check all of the 
  arguments (similar to the functionality in argparse).
  There was a request for *format_specfiers* to control
  how the named tuple display (this is mainly useful
  for printing a list of named tuples in the form of
  a table with nicely aligned columns).
* Individually, those parameter requests sound reasonable
  (i.e. they have legitimate use cases).  Collectively,
  they are an API train wreck.  It doesn't pay to try
  to please all of the people, all of the time.
* I'm inclined to say that most or of these aren't
  worth it and simply acknowledge that "once in a while
  some aspect of named tuples isn't a convenient as you
  would like, but that there are other compensating
  aesthetics."

--

___
Python tracker 

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



[issue18986] Add a case-insensitive case-preserving dict

2013-12-12 Thread Mark Dickinson

Mark Dickinson added the comment:

+1 for this (for Python 3.5, now, I guess). I've just found another place where 
I'd use it.

Looking at the implementation, one thing surprises me a bit:  I'd expect the 
KeyError from a 'del' or 'pop' operation to have the untransformed key rather 
than the transformed key in its .args.

How about '_keys' and '_values' for the slot names, in place of '_original' and 
'_data'?

--

___
Python tracker 

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



[issue19954] test_tk floating point exception on my gentoo box running tk 8.6.1

2013-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Please run following commands in wish:

$ wish
% menubutton .mb
.mb
% .mb configure -indicatoron 1

--

___
Python tracker 

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



[issue19954] test_tk floating point exception on my gentoo box running tk 8.6.1

2013-12-12 Thread R. David Murray

R. David Murray added the comment:

Ah.  That produces the floating point exception as well.

--

___
Python tracker 

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



[issue19847] Setting the default filesystem-encoding

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

See also the issue #19846.

--

___
Python tracker 

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



[issue19954] test_tk floating point exception on my gentoo box running tk 8.6.1

2013-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What with such example?

$ wish
% menubutton .mb -text "Test"
.mb
% pack .mb
% update
% .mb configure -indicatoron 1

Try also without pack and update.

--

___
Python tracker 

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



[issue19954] test_tk floating point exception on my gentoo box running tk 8.6.1

2013-12-12 Thread R. David Murray

R. David Murray added the comment:

floating point exception with or without the pack/update.

--

___
Python tracker 

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



[issue19787] tracemalloc: set_reentrant() should not have to call PyThread_delete_key()

2013-12-12 Thread STINNER Victor

Changes by STINNER Victor :


--
versions: +Python 3.4

___
Python tracker 

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



[issue19787] tracemalloc: set_reentrant() should not have to call PyThread_delete_key()

2013-12-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

On jeu., 2013-12-12 at 21:59 +, STINNER Victor wrote:
> So are you ok to apply the bugfix in Python 3.4?

I'm ok.

--

___
Python tracker 

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



[issue19787] tracemalloc: set_reentrant() should not have to call PyThread_delete_key()

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

If I understand correctly, there is probably only one application (mod_python) 
which might be broken by fix_set_key_value.patch.

If an application is broken by fix_set_key_value.patch, it can get the old 
behaviour using:

int
PyThread_set_key_value33(int key, void *value)
{
#if PY_VERSION_HEX >= 0x0304
void *oldValue = PyThread_get_key_value(key);
if (oldValue != NULL)
return 0;
#endif
return PyThread_set_key_value(key, value);
}

So are you ok to apply the bugfix in Python 3.4?

--

___
Python tracker 

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



[issue19751] test_sys: sys.hash_info.algorithm failure on SPARC Solaris buildbot

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7c116d7c6c65 by Victor Stinner in branch 'default':
Issue #19751: Fix typo in configuration option
http://hg.python.org/cpython/rev/7c116d7c6c65

New changeset c1a7ba57b4ff by Victor Stinner in branch 'default':
Issue #19751: Fix hash_info test of test_sys on SPARC Solaris
http://hg.python.org/cpython/rev/c1a7ba57b4ff

--
nosy: +python-dev

___
Python tracker 

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



[issue19967] asyncio: remove _TracebackLogger

2013-12-12 Thread STINNER Victor

New submission from STINNER Victor:

Thanks to the PEP 442 (Safe object finalization), _TracebackLogger helper of 
asyncio.Futures becomes useless.

Attached patch removes it.

--

If you agree to diverge code with Tulip project, the Python 3.3 code of 
WriteTransport.writelines can also be removed:

if not PY34:
# In Python 3.3, bytes.join() doesn't handle memoryview.
list_of_data = (
bytes(data) if isinstance(data, memoryview) else data
for data in list_of_data)

--
files: asyncio_log_traceback.patch
keywords: patch
messages: 205988
nosy: gvanrossum, haypo, pitrou
priority: normal
severity: normal
status: open
title: asyncio: remove _TracebackLogger
versions: Python 3.4
Added file: http://bugs.python.org/file33106/asyncio_log_traceback.patch

___
Python tracker 

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



[issue19750] test_asyncio.test_unix_events constructor failures on AIX

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

The initial test failure have been fixed, so I'm closing the issue.

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

___
Python tracker 

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



[issue19967] asyncio: remove _TracebackLogger

2013-12-12 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm sorry, I really don't want the asyncio code for 3.3 and 3.4 to diverge just 
yet. It would make keeping the two versions in sync just so much harder.

I'm happy with something that checks for the version and either adds the 
__del__ method (for 3.4) or uses the _TracebackLogger (for 3.3).

--

___
Python tracker 

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



[issue19636] Fix usage of MAX_PATH in posixmodule.c

2013-12-12 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed
versions: +Python 3.4

___
Python tracker 

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



[issue19635] asyncio should not depend on concurrent.futures, it is not always available

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

@Guido: If you write "issue #xxx" in your commit message, the changeset will be 
mentionned in the related issue.

---
changeset:   87237:0031ac40806a
user:Guido van Rossum 
date:Sun Nov 17 17:00:21 2013 -0800
files:   Lib/test/test_asyncio/__init__.py
description:
Skip test_asyncio if concurrent.futures can't be imported. Hopeful fix for 
issue 19645.
---

The changeset fixed the issue: the test is now skipped on "x86 FreeBSD 6.4 3.x" 
buildbot.

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

___
Python tracker 

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



[issue19968] Using DESTDIR breaks sys.path

2013-12-12 Thread Quanah Gibson-Mount

New submission from Quanah Gibson-Mount:

I found that when trying to use Python with the "stow" utility, that it 
incorrectly hard codes the full DESTDIR path into python, instead of the 
relative portion of the DESTDIR path.  As a result, DESTDIR usage is 
fundamentally broken in relation to all other software packages I've ever 
built.  For example:

make install DESTDIR=/usr/local/stow/python-3.3.2

results in a sys.path that includes /usr/local/stow/python-3.3.2, when instead 
what is desired is just "/usr/local", so you can properly stow the package:

[quanah@git Python-3.3.2]$ python3
Python 3.3.2 (default, Dec 12 2013, 17:18:31)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/usr/local/stow/python-3.3.2/lib/python33.zip', 
'/usr/local/stow/python-3.3.2/lib/python3.3', 
'/usr/local/stow/python-3.3.2/lib/python3.3/plat-linux', 
'/usr/local/stow/python-3.3.2/lib/python3.3/lib-dynload', 
'/usr/local/stow/python-3.3.2/lib/python3.3/site-packages']

Python itself was correctly built with --prefix=/usr/local, as that is the 
desired prefix.

--
components: Build
messages: 205993
nosy: mishikal
priority: normal
severity: normal
status: open
title: Using DESTDIR breaks sys.path
versions: Python 3.3

___
Python tracker 

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



[issue19967] asyncio: remove _TracebackLogger

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

> I'm happy with something that checks for the version and either adds the 
> __del__ method (for 3.4) or uses the _TracebackLogger (for 3.3).

Ok. Here is a patch. The class is still defined on Python 3.4. You may move the 
definition of the class in a "if not PY34:" class. I did not the change to have 
a shorter patch.

--
Added file: http://bugs.python.org/file33107/asyncio_log_traceback-2.patch

___
Python tracker 

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



[issue19968] Using DESTDIR breaks sys.path

2013-12-12 Thread Quanah Gibson-Mount

Quanah Gibson-Mount added the comment:

Or to summarize a bit differently --

the point of DESTDIR is to allow you to install your software in some location 
other than what was specified with --prefix, without losing the --prefix 
settings.

--

___
Python tracker 

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



[issue18986] Add a case-insensitive case-preserving dict

2013-12-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mark, what was the use case you found?

--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue19969] PyBytes_FromFormatV("%c") and PyString_FromFormatV("%c") don't check for character min/max value

2013-12-12 Thread STINNER Victor

New submission from STINNER Victor:

PyBytes_FromFormatV("%c") and PyString_FromFormatV("%c") overflow if the 
parameter is not in range [0; 255].

If nobody complained before, it's maybe not worth to fix the bug in Python 2.7 
or 3.3.

--
components: Interpreter Core
messages: 205996
nosy: haypo
priority: normal
severity: normal
status: open
title: PyBytes_FromFormatV("%c") and PyString_FromFormatV("%c") don't check for 
character min/max value

___
Python tracker 

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



[issue19969] PyBytes_FromFormatV("%c") and PyString_FromFormatV("%c") don't check for character min/max value

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

Here is a patch for Python 3.4.

--
keywords: +patch
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file33108/bytes_fromformat_c.patch

___
Python tracker 

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



[issue19579] test_asyncio: test__run_once timings should be relaxed

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

I didn't see the failure recently, thanks.

--
components: +Tests
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue19576] "Non-Python created threads" documentation doesn't mention PyEval_InitThreads()

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

So Antoine, what do you think of the fix?

--

___
Python tracker 

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



[issue19576] "Non-Python created threads" documentation doesn't mention PyEval_InitThreads()

2013-12-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Looks good to me.

--

___
Python tracker 

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



[issue19566] ERROR: test_close (test.test_asyncio.test_unix_events.FastChildWatcherTests)

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

I think the issue has been fixed, thanks.

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

___
Python tracker 

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



[issue19576] "Non-Python created threads" documentation doesn't mention PyEval_InitThreads()

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dc4e805ec68a by Victor Stinner in branch 'default':
Close #19576: PyGILState_Ensure() now initializes threads. At startup, Python
http://hg.python.org/cpython/rev/dc4e805ec68a

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

___
Python tracker 

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



[issue14432] Bug in generator if the generator in created in a temporary C thread

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d2560fd8a008 by Victor Stinner in branch 'default':
Issue #14432: Remove the thread state field from the frame structure. Fix a
http://hg.python.org/cpython/rev/d2560fd8a008

--
nosy: +python-dev

___
Python tracker 

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



[issue19968] Using DESTDIR breaks sys.path

2013-12-12 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +lemburg

___
Python tracker 

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



[issue14432] Bug in generator if the generator in created in a temporary C thread

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0875e5bbe5f0 by Victor Stinner in branch '3.3':
Issue #14432: Generator now clears the borrowed reference to the thread state
http://hg.python.org/cpython/rev/0875e5bbe5f0

New changeset 55dd094a2b01 by Victor Stinner in branch 'default':
Issue #14432: Null merge 3.3, Python 3.4 has a different fix
http://hg.python.org/cpython/rev/55dd094a2b01

--

___
Python tracker 

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



[issue14432] Bug in generator if the generator in created in a temporary C thread

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2f975036cf39 by Victor Stinner in branch '3.3':
Issue #14432: Fix compilation when thread support is disabled
http://hg.python.org/cpython/rev/2f975036cf39

New changeset 9852637f05c3 by Victor Stinner in branch 'default':
(Merge 3.3) Issue #14432: Fix compilation when thread support is disabled
http://hg.python.org/cpython/rev/9852637f05c3

--

___
Python tracker 

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



[issue14432] Bug in generator if the generator in created in a temporary C thread

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aa324af42c0e by Victor Stinner in branch '2.7':
Issue #14432: Generator now clears the borrowed reference to the thread state
http://hg.python.org/cpython/rev/aa324af42c0e

--

___
Python tracker 

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



[issue14432] Bug in generator if the generator in created in a temporary C thread

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Mark Shannon for your patch. Sorry, I forgot to mention your name if the 
changesets :-/ I didn't remember the whole story of this issue.

It should now be fixed.

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

___
Python tracker 

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



[issue19952] asyncio: test_wait_for_handle failure

2013-12-12 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue19952] asyncio: test_wait_for_handle failure

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a35b2d652449 by Victor Stinner in branch 'default':
Issue #19952: test_asyncio: relax timings of Windows events, buildbots are
http://hg.python.org/cpython/rev/a35b2d652449

--
nosy: +python-dev

___
Python tracker 

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



[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()

2013-12-12 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy:  -haypo

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

I'm unable to reproduce the test_4_daemon_threads failure, can anyone try on 
Windows?

--

___
Python tracker 

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



[issue17786] Crash in test_ctypes.test_callbacks() on AMD64 NetBSD 5.1.2 [SB] 3.x

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

There is no more NetBSD buildbot, so I'm closing the issue.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue18746] test_threading.test_finalize_with_trace() fails on FreeBSD buildbot

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

I don't see this issue anymore on FreeBSD buildbots. It was probably fixed. The 
issue #19466 changed also the Python shutdown procedure.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue19968] Using DESTDIR breaks sys.path

2013-12-12 Thread R. David Murray

R. David Murray added the comment:

sys.path is computed dynamically at run time.  Try moving the install directory 
around on your filesystem, and you'll see.

I'm not familiar with stow, and I don't know if anyone else on the team is 
either, so you may have to explain your issue in more detail.  If there is a 
real issue here, my guess would be that the solution will be based on the new 
venv support.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue19957] Minor refactor of Lib/email/encoders.py

2013-12-12 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Okay, here is the patch on which we removed checking of special case for 
iso-2022-*.

--
Added file: 
http://bugs.python.org/file33109/minor_refactor_encoders_in_email_lib_v2.patch

___
Python tracker 

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



[issue19787] tracemalloc: set_reentrant() should not have to call PyThread_delete_key()

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 46393019b650 by Victor Stinner in branch 'default':
Close #19787: PyThread_set_key_value() now always set the value. In Python 3.3,
http://hg.python.org/cpython/rev/46393019b650

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

___
Python tracker 

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



[issue19787] Fix PyThread_set_key_value() strange behaviour

2013-12-12 Thread STINNER Victor

Changes by STINNER Victor :


--
title: tracemalloc: set_reentrant() should not have to call 
PyThread_delete_key() -> Fix PyThread_set_key_value() strange behaviour

___
Python tracker 

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



[issue15751] Support subinterpreters in the GIL state API

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

FYI I fixed a weird behaviour of the PyThread_set_key_value() function. The 
change has indirectly on impact on test.support.run_in_subinterp():
http://bugs.python.org/issue19787#msg206015

So my change might have an effect on this issue.

--

___
Python tracker 

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



[issue19957] Minor refactor of Lib/email/encoders.py

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 29e5dd1f608a by R David Murray in branch 'default':
#19957: Simplify encode_7or8bit now that _payload is always str.
http://hg.python.org/cpython/rev/29e5dd1f608a

--
nosy: +python-dev

___
Python tracker 

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



[issue15751] Support subinterpreters in the GIL state API

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

They are now two issues (#10915 and this one) with many messages. Both issues 
are open. Can someone please make a summary? How can we fix the 
GIL/subinterpreter issue?

--

___
Python tracker 

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



[issue19957] Minor refactor of Lib/email/encoders.py

2013-12-12 Thread R. David Murray

R. David Murray added the comment:

Thanks, Vajrasky and Serhiy.

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

___
Python tracker 

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



[issue19437] More failures found by pyfailmalloc

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

There is no more pending patches nor known issues, so I'm closing this issue. I 
will open a new issue if I find new bugs.

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

___
Python tracker 

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



[issue19230] Reimplement the keyword module in C

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

So what? Do you want faster Python startup?

--

___
Python tracker 

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



[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

"The real question for me is: why are you interested in speeding up the
import of the operator module? 200 µs won't make a visible difference."

Alone, the gain is useless, but it's like the work done in Python 3.4 to avoid 
loading some modules at startup. The overall idea is to have a fast startup 
time.

I heard that Python 3 startup time is a major blocker point for Mercurial for 
example.

But maybe this specific issue is not worth the trouble. (Other parts should be 
optimized.)

--

___
Python tracker 

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



[issue19787] Fix PyThread_set_key_value() strange behaviour

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

Oh, my change on PyThread_set_key_value() has an unexpected effect on 
_testcapi.run_in_subinterp(): it now fixes the Python thread state. 
Py_NewInterpreter() creates a second Python thread state for the current 
thread, but PyThread_set_key_value() ignored the second call setting the new 
thread state.

It's a little bit strange that nobody noticed this bug before. It doesn't fix 
issue #10915: test_threading still hangs when tracemalloc is enabled (I 
modified manually test.support.run_in_subinterp() for a manual test).

This issue should now be fixed.

--

___
Python tracker 

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



[issue19787] Fix PyThread_set_key_value() strange behaviour

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

My commit broke test_capi, so I revert it. Here is the commit as a patch.

The impact on subinterpreters is more complex than what I expected. A decision 
should be take on what to do: mimic behaviour of Python 3.3 for subinterpreters 
(don't replace the Python thread state when a new subinterpreter is created), 
or fix code using subinterpreters.

--
resolution: fixed -> 
status: closed -> open
Added file: http://bugs.python.org/file33110/pythread_set_key_value-2.patch

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2013-12-12 Thread Eric Snow

Eric Snow added the comment:

Nick: that sounds good to me.  I like the idea of find_spec() being the same as 
import_module(), minus actually loading the module.

In that spirit, here's a rough patch that accomplishes that.  It refactors 
things a bit to get there.  Considering where we are in the release cycle, I'd 
rather punt on a proper rendition like this this until 3.5.  In the meantime we 
could duplicate some code for the sake of find_spec() in the 3.4 timeframe.

--
Added file: 
http://bugs.python.org/file33111/issue19944-find-spec-mirror-import-module.diff

___
Python tracker 

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



[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c

2013-12-12 Thread Charles-François Natali

Charles-François Natali added the comment:

Actually no, I don't understand this patch: if the makefile was correct, C
files depending on Include/Python-ast.h and Python/Python-ast.c shouldn't
be built before those files have been generated by asdl_c.py.
The problem doesn't lie in the non-atomicity, but in the make file
dependency graph.

--

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2013-12-12 Thread Eric Snow

Eric Snow added the comment:

Here's a version that I'd feel more comfortable with for 3.4 (with the intent 
of refactoring in 3.5).

--
Added file: 
http://bugs.python.org/file33112/issue19944-find-spec-mirror-import-module-simple.diff

___
Python tracker 

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