[issue11176] give more meaningful argument names in argparse documentation

2012-07-08 Thread David Lam

David Lam  added the comment:

haha wow, I was working on this bug too!  maybe we can work on the final patch 
together

I got through about 2/3's of the docs, so I thought it might help to upload 
what I got so far.  I basically just made stuff up so I'm totally winning to 
change anything (or everything)

I made a little effort to make the examples mildly amusing, since novelty sorta 
helps in retention.  So one of the recurring examples I used involves that of a 
pizza-making-program... hopefully this helps in some way!

--
nosy: +dlam
Added file: 
http://bugs.python.org/file26325/issue11165-doc-fix-up-to-section-15.4.4.diff

___
Python tracker 

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



[issue15125] argparse: positional arguments containing - in name not handled well

2012-07-08 Thread Nicu Stiurca

Nicu Stiurca  added the comment:

Eric:
I agree, that would be the obvious workaround. However, it turns that the way 
dest is set differs for optional and positional arguments. I alluded to this in 
my earlier message http://bugs.python.org/issue15125#msg163456

Specifically, it turns out that when the first argument to add_argument() 
starts with '-', it is interpreted as an optional argument and dest in 
_inferred_ from the first argument (eg, by stripping leading '-', and replacing 
remaining '-' with '_'). So supplying dest= to add_argument() overrides this 
heuristic.

But when the first argument to add_argument() does not start with a '-', dest 
becomes exactly the first argument, and supplying dest as a keyword argument 
like you suggest yields the exception I reported earlier.

Revisiting the documentation on dest 
(http://docs.python.org/dev/library/argparse.html#dest), this behavior is 
briefly and un-enlighteningly addressed in the first paragraph. The problem is 
that the paragraph suggests that dest can be explicitly set using keyword 
argument even for positional arguments; instead a ValueError is thrown as I 
have already mentioned.

I suppose that patching argparse to replace '-' with '_' for positional 
arguments may break existing code for anyone that has figured out they can get 
hyphenated positional arguments with getattr(), which would make it a risky 
patch. But patching the module to allow explicitly setting dest via keyword 
argument shouldn't hurt anybody.

For clarity, I recommend adding """(This conversion does NOT take place for 
positional arguments.)""" before the last sentence of paragraph 2 in the dest 
documentation.

Since I had no idea about using getattr, I bet others wouldn't figure it out 
either. I suggest also adding a simple example in the documentation for anybody 
that wants to use an invalid Python identifier as an argument. (Please don't 
say this is an invalid use case because eg, ssh has options -1, -2, -4, and -6.)

--

___
Python tracker 

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



[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-08 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Here is a single combined patch.  I gather this is preferred.

--
Added file: http://bugs.python.org/file26324/issue-15300-combined.patch

___
Python tracker 

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



[issue15302] Use argparse instead of getopt in test.regrtest

2012-07-08 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

It is also in the spirit of dogfooding.

--

___
Python tracker 

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



[issue15302] Use argparse instead of getopt in test.regrtest

2012-07-08 Thread Chris Jerdonek

New submission from Chris Jerdonek :

I think it would be an improvement to switch from using getopt to argparse in 
test.regrtest.  The code would be easier to maintain, it would give us more 
powerful options going forward, and it would improve the usability of the test 
command (e.g. nicer command-line help).

--
components: Tests
keywords: easy
messages: 165064
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: Use argparse instead of getopt in test.regrtest
versions: Python 3.3

___
Python tracker 

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



[issue15273] Remove unnecessarily random behavior from test_unparse.py

2012-07-08 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

test_grammar should be that file, though, people often forget to update it.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue13532] In IDLE, sys.stdout and sys.stderr can write any pickleable object

2012-07-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The patch (to my production Idle, with name fix) prevents crashing and raises 
an error instead when an object *can* be pickled, so I will apply before 3.3 if 
no problems appear and we cannot do better.

But written objects are still pickled, so sys.stdout.write(sys) still raises 
the PicklingError instead of (as in CP interpreter)
  TypeError: must be str, not module

It seems to me that the type check should be done in the subprocess before the 
object (which should be a string) is pickled. (I also wonder if it is really 
necessary to pickle a string or the encoded bytes to send it back. The pickle 
is just a stream of bytes.)

--
title: In IDLE, sys.stdout.write and sys.stderr can write any pickleable object 
-> In IDLE, sys.stdout and sys.stderr can write any pickleable object

___
Python tracker 

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



[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-08 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

And here is the second part.  Combining this with the first patch provides a 
fix.

--
Added file: http://bugs.python.org/file26323/issue-15300-2.patch

___
Python tracker 

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-07-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, pitrou
stage:  -> needs patch

___
Python tracker 

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



[issue15295] Document PEP 420 namespace packages

2012-07-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue15270] "Economy of Expression" section outdated

2012-07-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue15125] argparse: positional arguments containing - in name not handled well

2012-07-08 Thread Éric Araujo

Éric Araujo  added the comment:

Isn’t the obvious workaround to pass a dest argument which is a valid 
identifier?  add_argument('spam-eggs', dest='spam_eggs')

Maybe argparse in 3.4 could do this transformation automatically (see how 
namedtuple converts anything to valid identifiers).

--
nosy: +eric.araujo

___
Python tracker 

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



[issue11176] give more meaningful argument names in argparse documentation

2012-07-08 Thread Éric Araujo

Éric Araujo  added the comment:

Yep, this is still open.  Thanks for the patch, I did a review (if you did not 
get a mail, follow the link in the list of files).

--
assignee: eric.araujo -> 
nosy: +ezio.melotti, sandro.tosi

___
Python tracker 

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



[issue1757057] Unexpected "maximum recursion depth exceeded" in IDLE shell with objects that cannot be pickled

2012-07-08 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue12510] IDLE: calltips mishandle raw strings and other examples

2012-07-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Thank you for the 'positive lookbehind assertion' for anchoring the match after 
'('. That is what I was missing. '[^,]' is too broad as, in particular, it 
matches the ')' in 'a(self)'. We don't want the ')' removed. The tests passed 
with a faulty re because the method test was faulty in that it only tested that 
something is removed, but not that the removal is correct. I fixed the tests 
also to really test proper removal.

--

___
Python tracker 

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



[issue12510] IDLE: calltips mishandle raw strings and other examples

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset eea379307efa by Terry Jan Reedy in branch '3.2':
Issue 12510: Delete actual first param name for all methods; revise tests.
http://hg.python.org/cpython/rev/eea379307efa

New changeset 464c6a50b0ce by Terry Jan Reedy in branch 'default':
Merge with 3.2 Issue 12510
http://hg.python.org/cpython/rev/464c6a50b0ce

--

___
Python tracker 

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



[issue15262] Idle does not show traceback in other threads

2012-07-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Thanks Roger. So this should be fixed in the upcoming 2.7.4 and probably 3.2.4.

--

___
Python tracker 

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



[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-08 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Attaching a small refactoring patch to eliminate some cut-and-paste, prior to 
fixing this issue.

--
keywords: +patch
Added file: http://bugs.python.org/file26322/issue-15300-1.patch

___
Python tracker 

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



[issue15301] os.chown: OverflowError: Python int too large to convert to C long

2012-07-08 Thread do1

do1  added the comment:

I can add that system is x86_32. Same code in x86_64 result in no error even on 
older Python version 2.6.6

--

___
Python tracker 

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



[issue15301] os.chown: OverflowError: Python int too large to convert to C long

2012-07-08 Thread do1

New submission from do1 :

os.chown() can not change uid/gid to valid but high number.

# chown 4294967294.4294967294 a
# ls -l a
-rw-r--r-- 1 4294967294 4294967294 0 Jul  9 05:22 a

# python
Python 2.7.3 (default, Jun 24 2012, 06:19:44)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.chown("a", 4294967294, 4294967294)
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: Python int too large to convert to C long

--
components: None
messages: 165053
nosy: do1
priority: normal
severity: normal
status: open
title: os.chown: OverflowError: Python int too large to convert to C long
versions: Python 2.7

___
Python tracker 

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



[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-08 Thread Chris Jerdonek

New submission from Chris Jerdonek :

Running tests using the -j/--multiprocess option doubly-nests the test working 
directory:

$ ./python.exe -m test -j3 
-->cpython/build/test_python_63955/build/test_python_63956 
$ ./python.exe -m test
-->cpython/build/test_python_63957

It seems like the test directories for different processes should be siblings 
when running in multiprocessing mode as opposed to doubly-nesting under a new 
build directory.

--
components: Tests
messages: 165052
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: test directory doubly-nested running tests with -j/--multiprocess
versions: Python 3.3

___
Python tracker 

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



[issue15262] Idle does not show traceback in other threads

2012-07-08 Thread Roger Serwy

Roger Serwy  added the comment:

Mark, I ran your example against 2.7.1 and did not receive a traceback. I then 
ran it against the latest 2.7.3+ and receive a traceback in IDLE. Here's the 
entire Shell contents:


Python 2.7.3+ (2.7:97445ca895d5, Jul  8 2012, 19:58:43) 
[GCC 4.5.2] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> from thread import start_new
>>> def f(): typo

>>> start_new(f, ())
139804918241024Unhandled exception in thread started by 

>>> 
Traceback (most recent call last):
  File "", line 1, in f
NameError: global name 'typo' is not defined

>>>

--

___
Python tracker 

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



[issue14826] urllib2.urlopen fails to load URL

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a4bdb637d818 by Senthil Kumaran in branch 'default':
revert the changes done for issue14826 - quoting witin Request is not desirable.
http://hg.python.org/cpython/rev/a4bdb637d818

--

___
Python tracker 

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



[issue14826] urllib2.urlopen fails to load URL

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset ebd37273e0fe by Senthil Kumaran in branch '3.2':
revert the changes done for issue14826 - quoting witin Request is not desirable.
http://hg.python.org/cpython/rev/ebd37273e0fe

--

___
Python tracker 

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



[issue14715] test.support.DirsOnSysPath should be replaced by importlib.test.util.import_state

2012-07-08 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
nosy: +cjerdonek

___
Python tracker 

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



[issue12988] Tkinter File Dialog crashes on Win7 when saving to Documents Library

2012-07-08 Thread Ali Rahmjoo

Ali Rahmjoo  added the comment:

I have exactly the same problem mentioned by Brian Gernhardt for 32-bit Python 
3.2.3 on Win7.

--
nosy: +alirahmjoo

___
Python tracker 

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



[issue14826] urllib2.urlopen fails to load URL

2012-07-08 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

On Sun, Jul 8, 2012 at 9:42 AM, Christian Heimes  wrote:

> I vote for reverting the chances as they break the API. You could improve the 
> docs and emphasize that URLs must be quoted correctly as the module doesn't 
> implement browser magic.

Okay. But I do realize that in 3.3, we may have a FancyURLOpener /
URLOpener 's open method, which is not directly called by the apis,
but they seem to have quote behavior. I guess, I approached this
change as to making them consistent, but realize it is mistake, for
the reasons that you state and Antoine state.

--

___
Python tracker 

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



[issue14826] urllib2.urlopen fails to load URL

2012-07-08 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

On Sun, Jul 8, 2012 at 2:30 AM, Antoine Pitrou  wrote:
>
> Senthil, do you read python-dev? I think this change was prematurate from the 
> start (nevermind the fact that you didn't run the test suite before 
> committing).

I  thought that the other legacy URLOpen was quoting it correct and
then I wanted to see it can be made consistent.
It did get me thinking that why it was different for so long. I
realize that committing soon was a mistake.

> For example, if you have an URL with a non-ASCII domain name such as 
> "http://وزارة-الأتصالات.مصر/";, the domain name should IDNA-encoded, not 
> %-encoded like the rest.

Agreed and understood.

> Furthermore, some people are certainly already quoting their URLs to 
> workaround this issue, so "fixing" it will break their code by 
> double-escaping the URLs. You've got to be more careful.

Oh. yes, the change may break an already quoted URL. I think, I shall
revert this back.

--

___
Python tracker 

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



[issue4130] Intel icc 9.1 does not support __int128_t used by ctypes

2012-07-08 Thread Meador Inge

Meador Inge  added the comment:

This is still broken after the libffi update (issue15194).  The errors are the 
same as Alex mentioned when he tested libffi-3.0.11.  The right way to go is to 
get this fixed in upstream libffi and backport the patch.

--
assignee: theller -> 
stage:  -> needs patch

___
Python tracker 

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



[issue15265] random.sample() docs unclear on k < len(population)

2012-07-08 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks, I've added a note.

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

___
Python tracker 

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



[issue15265] random.sample() docs unclear on k < len(population)

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 72174d8af3ba by Raymond Hettinger in branch 'default':
Issue 15265: document the exception raised for invalid sample sizes.
http://hg.python.org/cpython/rev/72174d8af3ba

--
nosy: +python-dev

___
Python tracker 

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



[issue15294] regression with nested namespace packages

2012-07-08 Thread Eric V. Smith

Eric V. Smith  added the comment:

The patch looks good to me. I haven't run the tests, though.

--

___
Python tracker 

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



[issue14982] pkgutil.walk_packages seems to not work properly on Python 3.3a

2012-07-08 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

FYI, I created issue 15299 and issue 15297 which also relate to 
pkgutil.walk_packages() not working correctly in Python 3.3 -- even with the 
caveat added by Brett.  These two issues are in pkgutil.walk_packages()'s code 
path when passed path=None.

--

___
Python tracker 

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



[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

2012-07-08 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Martin, FYI, Pat processed my contrib form.

--

___
Python tracker 

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



[issue13557] exec of list comprehension fails on NameError

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset ab22ffa6fb2e by Terry Jan Reedy in branch '2.7':
Issue #13557: Clarify effect of giving two different namespaces to exec or
http://hg.python.org/cpython/rev/ab22ffa6fb2e

New changeset ea670d71a36d by Terry Jan Reedy in branch '3.2':
Issue #13557: Clarify effect of giving two different namespaces to exec or
http://hg.python.org/cpython/rev/ea670d71a36d

New changeset b47ae7a9e685 by Terry Jan Reedy in branch 'default':
Merge 3.2 closes issue 13557
http://hg.python.org/cpython/rev/b47ae7a9e685

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

___
Python tracker 

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



[issue15299] pkgutil.ImpImporter(None).iter_modules() does not search sys.path

2012-07-08 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
title: ImpImporter(None).iter_modules() does not search sys.path -> 
pkgutil.ImpImporter(None).iter_modules() does not search sys.path

___
Python tracker 

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



[issue15294] regression with nested namespace packages

2012-07-08 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue15299] ImpImporter(None).iter_modules() does not search sys.path

2012-07-08 Thread Chris Jerdonek

New submission from Chris Jerdonek :

The pkgutil.ImpImporter documentation says that if dirname is None, 
ImpImporter(dirname) should create a PEP 302 importer that searches the current 
sys.path, plus any modules that are frozen or built-in:

http://docs.python.org/dev/library/pkgutil.html#pkgutil.ImpImporter

However, the iter_modules() method of an ImpImporter instance doesn't search 
sys.path if dirname is None.  It returns a generator that always yields 
nothing.  For example--

Python 3.3.0b1 (default:5d43154d68a8, Jul  8 2012, 13:54:45) 
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)] on darwin
>>> from pkgutil import ImpImporter
>>> importer = ImpImporter()
>>> list(importer.iter_modules())
[]

Strictly speaking, one could say the documentation only applies to the 
find_module() method since that's the only method covered by the PEP 302 API  
However, iter_modules() is a public method.  So I think that either 
iter_modules() should be fixed, made private, or else the documentation 
clarified by saying that searching sys.path does not apply to iter_modules().

I'm pretty sure though that iter_modules() should be fixed.  This is because 
there are other functions in pkgutil that seem not to work because 
ImpImporter.iter_modules() behaves the way it does (specifically calling 
pkgutil.iter_modules() with path=None).

--
components: Library (Lib)
messages: 165038
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: ImpImporter(None).iter_modules() does not search sys.path
versions: Python 3.3

___
Python tracker 

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



[issue15294] regression with nested namespace packages

2012-07-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file26320/nestednspkg.patch

___
Python tracker 

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



[issue15294] regression with nested namespace packages

2012-07-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file26321/nestednspkg.patch

___
Python tracker 

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



[issue15294] regression with nested namespace packages

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file26320/nestednspkg.patch

___
Python tracker 

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-07-08 Thread Matthias Klose

New submission from Matthias Klose :

_sysconfigdata is generated in srcdir, not builddir, so if you do two 
consecutive differently builds in different builddirs and using the same 
srcdir, then the _sysconfigdata of the second build wins. _sysconfigdata.py has 
to be built in the builddir, not the srcdir.

--
components: Build
messages: 165036
nosy: doko
priority: release blocker
severity: normal
status: open
title: _sysconfigdata is generated in srcdir, not builddir
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue15297] pkgutil.iter_importers() includes an ImpImporter

2012-07-08 Thread Chris Jerdonek

New submission from Chris Jerdonek :

I'm not sure if this should be fixed in the code or in the documentation, but 
the pkgutil.iter_importers() documentation says that 
pkgutil.iter_importers(name) should yield the "importers for sys.meta_path, 
sys.path, and Python’s “classic” import machinery, in that order" when name 
does not include a ".":

http://docs.python.org/dev/library/pkgutil.html#pkgutil.iter_importers

However, the function appends a "non-classic" pkgutil.ImpImporter at the end of 
all that:

Python 3.3.0b1 (default:5d43154d68a8, Jul  8 2012, 13:54:45) 
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)] on darwin
>>> from pkgutil import iter_importers
>>> list(iter_importers())[-1]


--
components: Library (Lib)
messages: 165035
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: pkgutil.iter_importers() includes an ImpImporter
versions: Python 3.3

___
Python tracker 

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



[issue15283] pyvenv says nothing on success

2012-07-08 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I think, the ``source bin/activate`` should be mentioned in the Docs
at least. It should not require that a person carries this knowledge
from somewhere else. At the moment, I do not see mention of it in the
docs either -

http://docs.python.org/dev/library/venv.html

--
nosy: +orsenthil

___
Python tracker 

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



[issue15296] Minidom can't create ASCII representation

2012-07-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +eli.bendersky
stage:  -> patch review

___
Python tracker 

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



[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
status: open -> closed

___
Python tracker 

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



[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 5d43154d68a8 by Amaury Forgeot d'Arc in branch 'default':
Issue #15110: Copy same docstring as other '_exec_module' methods.
http://hg.python.org/cpython/rev/5d43154d68a8

--

___
Python tracker 

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



[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 37e68da59047 by Amaury Forgeot d'Arc in branch 'default':
Issue #15110: Also hide importlib frames when importing a builtin module fails.
http://hg.python.org/cpython/rev/37e68da59047

--

___
Python tracker 

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



[issue15283] pyvenv says nothing on success

2012-07-08 Thread Éric Araujo

Éric Araujo  added the comment:

> Creating a venv is useless if you don't ever activate it, right.
This is a common misconception.  Shell activation is only about putting the 
venv’s bin directory on the beginning of the PATH.  It’s a purely optional 
convenience.  Using a virtualenv can be done fully with explicit paths like 
Martin mentioned.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue15293] AST nodes do not support garbage collection

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8538d01c by Benjamin Peterson in branch 'default':
add gc support to the AST base type (closes #15293)
http://hg.python.org/cpython/rev/8538d01c

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

___
Python tracker 

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



[issue12081] Remove distributed copy of libffi

2012-07-08 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Closing as a duplicate. The original issue is resolved: we are not distributing 
an old copy of libffi anymore.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> libffi-3.0.11 update

___
Python tracker 

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



[issue15262] Idle does not show traceback in other threads

2012-07-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Unless this could have been just as easily fixed in IDLE as in the core 
(Roger?), no, don't hold your breath ;-).

--
nosy: +serwy

___
Python tracker 

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



[issue12081] Remove distributed copy of libffi

2012-07-08 Thread Meador Inge

Meador Inge  added the comment:

Matthias recently updated libffi to 3.0.11 (issue15194).  It would seem that we 
intend to keep a local copy of the libffi sources for now and that this issue 
can be closed.  Does anyone see a reason to keep this open?

--

___
Python tracker 

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



[issue15294] regression with nested namespace packages

2012-07-08 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue15273] Remove unnecessarily random behavior from test_unparse.py

2012-07-08 Thread R. David Murray

R. David Murray  added the comment:

I thought we had other tests that did this as well (pickle?).  If you need 
reproducibility you check the random seed and reuse it.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue15283] pyvenv says nothing on success

2012-07-08 Thread Vinay Sajip

Changes by Vinay Sajip :


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

___
Python tracker 

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



[issue15283] pyvenv says nothing on success

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9c345b4bd97e by Vinay Sajip in branch 'default':
Closes #15281, #15283: Don't make venv scripts executable, but copy source mode 
instead, and provide better help for pyvenv.
http://hg.python.org/cpython/rev/9c345b4bd97e

--
nosy: +python-dev

___
Python tracker 

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



[issue15281] pyvenv --symlinks option is a no-op?

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9c345b4bd97e by Vinay Sajip in branch 'default':
Closes #15281, #15283: Don't make venv scripts executable, but copy source mode 
instead, and provide better help for pyvenv.
http://hg.python.org/cpython/rev/9c345b4bd97e

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

___
Python tracker 

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



[issue14826] urllib2.urlopen fails to load URL

2012-07-08 Thread Christian Heimes

Christian Heimes  added the comment:

The docs [1] state that `url should be a string containing a valid URL.` An URL 
with a space ' ' is not a valid URL as the space must be quoted as %20. The 
brackets may also cause problems as they are not valid xs:anyURI chars.

I vote for reverting the chances as they break the API. You could improve the 
docs and emphasize that URLs must be quoted correctly as the module doesn't 
implement browser magic.

[1] 
http://docs.python.org/py3k/library/urllib.request.html#urllib.request.Request

--
nosy: +christian.heimes

___
Python tracker 

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



[issue13405] Add DTrace probes

2012-07-08 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Justin, I can compile and run the tests fine in my Solaris 11 virtual machine, 
both in 32 and 64 bits and both static and dynamic.

I am using GCC, and you are using Sun Studio.

http://buildbot.python.org/all/builders/x86%20Solaris%2011%20custom/builds/17/steps/compile/logs/stdio

I was wondering if you have Jabber/XMPP (mine: j...@jabber.org) so we can talk 
about this in realtime, and do some "remote keyboard" test.

--

___
Python tracker 

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



[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I really like the "_exec_module" trick, but it should be applied to
> builtin modules as well. I hacked _sre.c and got:

I hadn't thought about this one. Can you apply your patch?

--

___
Python tracker 

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



[issue15296] Minidom can't create ASCII representation

2012-07-08 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Minidom can parse ASCII-encoded XML data, but can't create it.

>>> from xml.dom.minidom import parseString
>>> doc = parseString(b'>> encoding="us-ascii"?>€')
>>> doc.toxml('us-ascii')
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/xml/dom/minidom.py", line 47, in toxml
return self.toprettyxml("", "", encoding)
  File "/home/serhiy/py/cpython/Lib/xml/dom/minidom.py", line 56, in toprettyxml
self.writexml(writer, "", indent, newl, encoding)
  File "/home/serhiy/py/cpython/Lib/xml/dom/minidom.py", line 1798, in writexml
node.writexml(writer, indent, addindent, newl)
  File "/home/serhiy/py/cpython/Lib/xml/dom/minidom.py", line 868, in writexml
self.childNodes[0].writexml(writer, '', '', '')
  File "/home/serhiy/py/cpython/Lib/xml/dom/minidom.py", line 1090, in writexml
_write_data(writer, "%s%s%s" % (indent, self.data, newl))
  File "/home/serhiy/py/cpython/Lib/xml/dom/minidom.py", line 304, in 
_write_data
writer.write(data)
  File "/home/serhiy/py/cpython/Lib/codecs.py", line 355, in write
data, consumed = self.encode(object, self.errors)
UnicodeEncodeError: 'ascii' codec can't encode character '\u20ac' in position 
0: ordinal not in range(128)

Same for other non-unicode encodings.

Suggested simple patch solves this issue.

--
components: Library (Lib), Unicode, XML
files: minidom_toxml_encoding.patch
keywords: patch
messages: 165020
nosy: ezio.melotti, storchaka
priority: normal
severity: normal
status: open
title: Minidom can't create ASCII representation
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file26319/minidom_toxml_encoding.patch

___
Python tracker 

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



[issue15292] import hook behavior documentation improvement

2012-07-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

Perhaps the porting section in the 3.3 What's New?

--

___
Python tracker 

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



[issue15295] Document PEP 420 namespace packages

2012-07-08 Thread Brett Cannon

Brett Cannon  added the comment:

One request I would like to make is that while the docs are being written, to 
please look at importlib.find_loader() and let me know if the name no longer 
applies (it's new in Python 3.3 so it can easily be renamed).

--

___
Python tracker 

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



[issue15295] Document PEP 420 namespace packages

2012-07-08 Thread Brett Cannon

New submission from Brett Cannon :

I believe Barry said he was going to handle the documentation for PEP 420.

--
assignee: barry
components: Documentation
messages: 165017
nosy: barry, brett.cannon
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Document PEP 420 namespace packages
versions: Python 3.3

___
Python tracker 

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



[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Brett Cannon

Brett Cannon  added the comment:

Re-opening so Antoine can look at Amaury's proposed fix for builtin modules.

--
status: closed -> open

___
Python tracker 

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



[issue15292] import hook behavior documentation improvement

2012-07-08 Thread Brett Cannon

Brett Cannon  added the comment:

Everything Nick said is right: PyPy did it properly according to the spec and 
CPython 2.7 got it wrong. Unfortunately fixing this now would break code and so 
it will simply have to stay a Python 2.7 quirk with Python 3.3 and later doing 
it correctly.

So documenting the screw-up would be good so that people know that the solution 
they use in Python 2.7 won't work in Python 3.3 and later.

--

___
Python tracker 

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



[issue15294] regression with nested namespace packages

2012-07-08 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Legacy namespace packages (handled with pkgutil) do not work anymore when they 
are nested. The attached test file passes under 3.2 but fails under 3.3.

--
components: Interpreter Core
files: test_nested_nspackage.py
messages: 165014
nosy: brett.cannon, eric.snow, ncoghlan, pitrou
priority: high
severity: normal
status: open
title: regression with nested namespace packages
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26318/test_nested_nspackage.py

___
Python tracker 

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 7aa75ea4116d by Nick Coghlan in branch 'default':
Issue 14814: The new systematic tests aren't just about error reporting any 
more - change names accordingly. Added and tweaked some example to ensure they 
were covering the intended code paths
http://hg.python.org/cpython/rev/7aa75ea4116d

--

___
Python tracker 

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



[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I really like the "_exec_module" trick, but it should be applied to builtin 
modules as well. I hacked _sre.c and got:

~/python/cpython3.x$ ./python 
Traceback (most recent call last):
  File "/home/amauryfa/python/cpython3.x/Lib/site.py", line 70, in 
import re
  File "/home/amauryfa/python/cpython3.x/Lib/re.py", line 122, in 
import sre_compile
  File "/home/amauryfa/python/cpython3.x/Lib/sre_compile.py", line 13, in 

import _sre, sys
  File "", line 1318, in _find_and_load
  File "", line 1285, in _find_and_load_unlocked
  File "", line 347, in set_package_wrapper
  File "", line 360, in set_loader_wrapper
  File "", line 443, in _requires_builtin_wrapper
  File "", line 493, in load_module
ValueError: Just a test


This change correctly hides importlib frames:


diff -r 9afdd8c25bf2 Lib/importlib/_bootstrap.py
--- a/Lib/importlib/_bootstrap.py   Sun Jul 08 14:00:06 2012 +0200
+++ b/Lib/importlib/_bootstrap.py   Sun Jul 08 15:03:27 2012 +0200
@@ -490,12 +490,15 @@
 """Load a built-in module."""
 is_reload = fullname in sys.modules
 try:
-return _imp.init_builtin(fullname)
+return self._exec_module(fullname)
 except:
 if not is_reload and fullname in sys.modules:
 del sys.modules[fullname]
 raise
 
+def _exec_module(self, fullname):
+return _imp.init_builtin(fullname)
+
 @classmethod
 @_requires_builtin
 def get_code(cls, fullname):

--

___
Python tracker 

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



[issue15290] setAttribute() can fail

2012-07-08 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Then Twisted will have to change. From

http://docs.python.org/library/xml.dom.minidom.html

"Applications should not instantiate the classes themselves; they should use 
the creator functions available on the Document object."

If they insist on not using createElement, they use internal API, and need to 
adjust that to new Python versions.

Closing as invalid.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue15290] setAttribute() can fail

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> That's invalid usage. You are supposed to create new element nodes
> through the document's createElement method. "unattached" nodes are
> not supported.

Well, I don't know how many third-party application rely on this, but
Twisted does it.

--

___
Python tracker 

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



[issue15290] setAttribute() can fail

2012-07-08 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

That's invalid usage. You are supposed to create new element nodes through the 
document's createElement method. "unattached" nodes are not supported.

--

___
Python tracker 

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



[issue15290] setAttribute() can fail

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file26317/minidom_setattribute.patch

___
Python tracker 

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



[issue15290] setAttribute() can fail

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Trivial reproducer:

>>> e = minidom.Element("span")
>>> e.setAttribute("class", "version")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/antoine/cpython/default/Lib/xml/dom/minidom.py", line 743, in 
setAttribute
attr.ownerDocument = self.ownerDocument
AttributeError: ownerDocument

--

___
Python tracker 

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



[issue1767933] Badly formed XML using etree and utf-16

2012-07-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file26316/etree_write_utf16_4.patch

___
Python tracker 

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



[issue15276] unicode format does not really work in Python 2.x

2012-07-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I confirm the bug on 2.7.

$ ./python 
Python 2.7.3+ (2.7:ab9d6c4907e7+, Apr 25 2012, 20:02:36) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_NUMERIC, 'uk_UA.UTF-8')
'uk_UA.UTF-8'
>>> u'{:n}'.format(1)
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 2: ordinal 
not in range(128)
>>> '{:n}'.format(1)
'10\xc2\xa'

--
components: +Interpreter Core, Unicode
nosy: +ezio.melotti, storchaka
type:  -> behavior

___
Python tracker 

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 45265ecaa3e4 by Nick Coghlan in branch 'default':
Issue 14814: Remove dead function (noticed by Serhiy Storchaka)
http://hg.python.org/cpython/rev/45265ecaa3e4

--

___
Python tracker 

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



[issue15292] import hook behavior documentation improvement

2012-07-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

The PyPy and 3.3 behaviour are actually correct according to the spec, but it's 
*really* unclear in PEP 302.

sys.meta_path accepts finder objects. These are explicitly documented as 
returning "None" from find_module() to indicate "try the next one" and raising 
exceptions solely to report problems.

However, for reasons that are unknown to me, sys.path_hooks entries (which 
occupy most of the section on registering hooks) use a different protocol to 
indicate "try the next one": raising ImportError.

Since meta_path and path_hooks are described in the same section, and the 
meta_path description just says "add finder objects", it's understandable that 
implementors take the path_hooks protocol description as applying to finders in 
general :(

I would chalk the 2.x (and likely 3.x for x < 3) behaviour up to the only 
partial implementation of PEP 302 in CPython (until Brett's success in 
bootstrapping importlib for 3.3).

--

___
Python tracker 

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



[issue1767933] Badly formed XML using etree and utf-16

2012-07-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Here is a patch with using context management (as Eli advised). This
makes error handling much safer and probably makes the code a little
easier. Several new tests are added.

--

___
Python tracker 

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



[issue15284] Handle ipv6 not being enabled in test_socket

2012-07-08 Thread Brian Brazil

Changes by Brian Brazil :


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

___
Python tracker 

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



[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2012-07-08 Thread Stefan Behnel

Stefan Behnel  added the comment:

Florent, what you describe is exactly the definition of a new feature.
Users even have to change their code in order to make use of it.

--

___
Python tracker 

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



[issue15293] AST nodes do not support garbage collection

2012-07-08 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Add the following to test_ast:

diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -199,6 +199,7 @@ class AST_Tests(unittest.TestCase):
 x.foobar = 42
 self.assertEqual(x.foobar, 42)
 self.assertEqual(x.__dict__["foobar"], 42)
+x.x = x
 
 with self.assertRaises(AttributeError):
 x.vararg


and you'll get a reference leak.

--
assignee: benjamin.peterson
components: Interpreter Core
messages: 165001
nosy: benjamin.peterson, pitrou
priority: normal
severity: normal
status: open
title: AST nodes do not support garbage collection
type: resource usage
versions: Python 3.3

___
Python tracker 

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



[issue15291] test_ast leaks memory a lot

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, that was easy :)

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

___
Python tracker 

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



[issue15291] test_ast leaks memory a lot

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 048d8d9aecf1 by Antoine Pitrou in branch 'default':
Issue #15291: Fix a memory leak where AST nodes where not properly deallocated.
http://hg.python.org/cpython/rev/048d8d9aecf1

--
nosy: +python-dev

___
Python tracker 

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



[issue15292] import hook behavior documentation improvement

2012-07-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +brett.cannon, ncoghlan

___
Python tracker 

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



[issue15292] import hook behavior documentation improvement

2012-07-08 Thread Anders Hammarquist

New submission from Anders Hammarquist :

When testing Eutaxia on PyPy (1.9) I discovered a discrepancy in the path_hooks 
import hook implementation. In CPython (2.7), if the find_module() method 
raises ImportError (as imp.find_module() does when it does not find a module in 
the given path), will cause the search to continue, whereas PyPy would 
propagate the ImportError.

PyPy has now been changed to behave like CPython.

The documentation is not entirely clear, but it does not explicitly document 
the import hook mechanism as eating an ImportError in find_module(). It should 
probably be made explicit, which ever way it should be. It is not obvious what 
is the correct behaviour, given the implicit relative imports, where the 
ImportError simply means that the import hook cannot find the module.

Quick testing on CPython 3.3 indicates that it behaves like PyPy did, but as it 
doesn't do implicit relative imports my test case didn't work as it was. For 
3.3, without implicit relative imports, propagating the ImportError feels like 
the correct behaviour.

The attached demonstration needs a file /tmp/test/foo.py that does a top-level 
import, e.g. "import errno" to demonstrate the discrepancy.

--
assignee: docs@python
components: Documentation
files: testimport.py
messages: 164998
nosy: docs@python, iko
priority: normal
severity: normal
status: open
title: import hook behavior documentation improvement
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file26315/testimport.py

___
Python tracker 

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



[issue15291] test_ast leaks memory a lot

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Strangely, the reference leak was fixed in:

changeset:   75686:9e7f6ddc0d76
user:Benjamin Peterson 
date:Wed Mar 14 21:50:29 2012 -0500
summary: free AST's dict

But it didn't fix the memory leak.

--

___
Python tracker 

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



[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2012-07-08 Thread Florent Xicluna

Florent Xicluna  added the comment:

Well, it fixes the behavior of ElementTree in some multi-threaded cases, 
provided you pass the namespace map as an argument of the serializer call.

The fix implements an optional argument for this use case.
As a side effect, it makes it easier to work with custom namespaces.

If the consensus is to wait for next version, I'm fine with that.

--

___
Python tracker 

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



[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks, Brett!

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

___
Python tracker 

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



[issue15291] test_ast leaks memory a lot

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

So, the culprit is:

changeset:   75542:3877bf2e3235
user:Benjamin Peterson 
date:Mon Mar 12 09:46:44 2012 -0700
summary: give the AST class a __dict__

--
nosy: +benjamin.peterson, georg.brandl

___
Python tracker 

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



[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2012-07-08 Thread Stefan Behnel

Stefan Behnel  added the comment:

Looks like a new feature to me.

--
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue15291] test_ast leaks memory a lot

2012-07-08 Thread Antoine Pitrou

New submission from Antoine Pitrou :

On the default branch, if you run test_ast in a loop:

./python -E -m test -F test_ast

you will see that the process memory use grows very quickly. This doesn't 
happen on 3.2.
I'm not a Valgrind expert so perhaps someone else can take a look. Otherwise 
I'll try to bisect.

--
components: Interpreter Core
messages: 164992
nosy: neologix, pitrou, skrah
priority: critical
severity: normal
status: open
title: test_ast leaks memory a lot
type: resource usage
versions: Python 3.3

___
Python tracker 

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



[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2012-07-08 Thread Eli Bendersky

Eli Bendersky  added the comment:

Can this be honestly classified as a bugfix though? If it's a feature it will 
have to be postponed to 3.4

--

___
Python tracker 

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



[issue15286] normpath does not work with local literal paths

2012-07-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> May I ask you why you mention the symbolic links? I know that if one
> of the segments of the path is a symbolic link there are problems but
> this is not related to \\?\ or am I confused? Just curious :)

No, it is not related with "\\?\" but I'm pointing out that normpath()
isn't very useful because of that. And Windows has symlink support
nowadays :-)

For the record, I'm trying to build a saner path-handling library at
http://pypi.python.org/pypi/pathlib/ . I hope to propose it for
inclusion in 3.4.

--

___
Python tracker 

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



[issue15287] support.TESTFN was modified by test_builtin

2012-07-08 Thread Florent Xicluna

Changes by Florent Xicluna :


--
assignee: ronaldoussoren -> 
components:  -Macintosh
nosy:  -ronaldoussoren
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15287] support.TESTFN was modified by test_builtin

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6651c932d014 by Florent Xicluna in branch 'default':
Issue #11022 and #15287: correctly remove the TESTFN file in test_builtin.
http://hg.python.org/cpython/rev/6651c932d014

--
nosy: +python-dev

___
Python tracker 

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



[issue11022] locale.getpreferredencoding() must not set temporary LC_CTYPE

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6651c932d014 by Florent Xicluna in branch 'default':
Issue #11022 and #15287: correctly remove the TESTFN file in test_builtin.
http://hg.python.org/cpython/rev/6651c932d014

--

___
Python tracker 

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



[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8c877ad00bc4 by Antoine Pitrou in branch 'default':
Issue #15110: Fix the tracebacks generated by "import xxx" to not show the 
importlib stack frames.
http://hg.python.org/cpython/rev/8c877ad00bc4

--
nosy: +python-dev

___
Python tracker 

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



[issue15276] unicode format does not really work in Python 2.x

2012-07-08 Thread Berker Peksag

Berker Peksag  added the comment:

I can't reproduce this with Python 2.7.3.

berker@wakefield ~[master*]$ python
Python 2.7.3 (default, Apr 20 2012, 22:39:59) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_NUMERIC, 'fr_FR')
'fr_FR'
>>> u'{:n}'.format(1)
u'10 000'

--
nosy: +berker.peksag

___
Python tracker 

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



  1   2   >