[issue15331] Codecs docs should explain that the bytes-bytes shorthand aliases are missing

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

While you're right about that, the docs shouldn't be claiming they're available 
as long as that is the case.

Updated the issue to make it clear this is a problem with the current docs and 
the change in the nature of the encode() and decode() methods for Python 3.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
stage: test needed -> needs patch
title: Missing codec aliases for bytes-bytes codecs -> Codecs docs should 
explain that the bytes-bytes shorthand aliases are missing

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

FWIW it's, I've been thinking further about this recently and I think 
implementing this feature as builtin methods is the wrong way to approach it.

Instead, I propose the addition of codecs.encode and codecs.decode methods that 
are type neutral (leaving any type checks entirely up to the codecs 
themselves), while the str.encode and bytes.decode methods retain their current 
strict test model related type restrictions.

Also, I now think my previous proposal for nice error messages was massively 
over-engineered. A much simpler approach is to just replace the status quo:

>>> "".encode("bz2_codec")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/ncoghlan/devel/py3k/Lib/encodings/bz2_codec.py", line 17, in 
bz2_encode
return (bz2.compress(input), len(input))
  File "/home/ncoghlan/devel/py3k/Lib/bz2.py", line 443, in compress
return comp.compress(data) + comp.flush()
TypeError: 'str' does not support the buffer interface

with a better error with more context like:

UnicodeEncodeError: encoding='bz2_codec', errors='strict', 
codec_error="TypeError: 'str' does not support the buffer interface"

A similar change would be straightforward on the decoding side.

This would be a good use case for __cause__, but the codec error should still 
be included in the string representation.

--

___
Python tracker 

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



[issue15339] document the threading "facts of life" in Python

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Given the scope of the issue, a concurrent programming howto that lists some of 
the available options and the caveats associated with each of them seems 
worthwhile.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue15349] SyntaxError b0rked grammar

2012-07-14 Thread Ztatik Light

New submission from Ztatik Light :

SyntaxError: import * is not allowed in function '__init__' because it is 
contains a nested function with free variables


^  /s/"because it is contains"/"because it contains"

--
components: Interpreter Core
messages: 165437
nosy: Ztatik.Light
priority: normal
severity: normal
status: open
title: SyntaxError b0rked grammar
versions: Python 2.6

___
Python tracker 

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



[issue14455] plistlib unable to read json and binary plist files

2012-07-14 Thread d9pouces

d9pouces  added the comment:

The plutil (Apple's command-line tool to convert plist files from a format to 
another) returns an error if you try to convert a XML plist with dates to JSON.

--

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2012-07-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

2012-07-14 Thread samwyse

samwyse  added the comment:

Since no one else seems willing to do it, here's a patch that adds a 
'quote_via' keyword parameter to the urlencode function.

>>> import urllib.parse
>>> query={"foo": "+ "}
>>> urllib.parse.urlencode(query)
'foo=%2B+'
>>> urllib.parse.urlencode(query, quote_via=urllib.parse.quote)
'foo=%2B%20'

--
keywords: +patch
Added file: http://bugs.python.org/file26378/urllib_parse.diff

___
Python tracker 

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



[issue15350] {urllib,urllib.parse}.urlencode.__doc__ is unclear

2012-07-14 Thread samwyse

New submission from samwyse :

The doc string for url encode states:

The query arg may be either a string or a bytes type. When query arg is a
string, the safe, encoding and error parameters are sent to the quote_via
function for encoding

IMHO, this implies that the argument can be a string.  Note that the preceding 
paragraphs starts out with "If the query arg is a sequence of two-element 
tuples". I think that it should read:

The components of the query arg may be either a string or a bytes
type. When query arg is a string, the safe, encoding and error
parameters are sent to the quote_via function for encoding.

--
components: Library (Lib)
messages: 165440
nosy: samwyse
priority: normal
severity: normal
status: open
title: {urllib,urllib.parse}.urlencode.__doc__ is unclear
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue15350] {urllib,urllib.parse}.urlencode.__doc__ is unclear

2012-07-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> needs patch
type: behavior -> enhancement
versions:  -Python 2.6, Python 3.1

___
Python tracker 

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



[issue15327] Argparse: main arguments and subparser arguments indistinguishable

2012-07-14 Thread samwyse

samwyse  added the comment:

The Namespace object contains a combined list of all of the arguments, from 
both the main parser and the subparser.  I don't see any way to resolve 
identically name augments without breaking a lot of code that relies on the 
current behavior.  I would instead propose that anyone needing to distinguish 
between identically named args in nested parsers use distinct names as the 
primary name of the argument, and the non-distictive name as an alias.  For 
example:
parser.add_argument('--verbose(main)', '--verbose', ...)

Running the attached file produces the following output.

# using non-distinctive args
['--verbose', 'command'] => Namespace(command='command', verbose=True)
['command', '--verbose'] => Namespace(command='command', verbose=True)
['--verbose', 'command', '--verbose'] => Namespace(command='command', 
verbose=True)

# using distinctive args
['--verbose', 'command'] => Namespace(command='command', verbose(main)=True, 
verbose(subcommand)=False)
['command', '--verbose'] => Namespace(command='command', verbose(main)=False, 
verbose(subcommand)=True)
['--verbose', 'command', '--verbose'] => Namespace(command='command', 
verbose(main)=True, verbose(subcommand)=True)

--
nosy: +samwyse
Added file: http://bugs.python.org/file26379/argparsetest.py

___
Python tracker 

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



[issue15280] Don't use builtins as variable names in urllib.request

2012-07-14 Thread Éric Araujo

Éric Araujo  added the comment:

We don’t do code cleanups for their own sake, but rather as part of a bug fix 
or feature addition.  Please see #15137 for a longer explanation.

--
nosy: +eric.araujo, r.david.murray, terry.reedy

___
Python tracker 

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



[issue15311] Developer Guide doesn't get updated once a day

2012-07-14 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



[issue15314] Use importlib instead of pkgutil in runpy

2012-07-14 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



[issue15317] Source installation sets incorrect permissions for Grammar3.2.3.final.0.pickle

2012-07-14 Thread Éric Araujo

Éric Araujo  added the comment:

How did you configure and build?  If you ran make as root it may explain this.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue15280] Don't use builtins as variable names in urllib.request

2012-07-14 Thread Brian Brazil

Brian Brazil  added the comment:

This patch is a result of frustration encountered when debugging #15002.
Not being able to use 'type' directly is rather annoying, so after figuring
that bug out I set some time aside to make it easier for the next person.

This could be considered a bug that urllib is hard to debug and breaks
vim's syntax highlighting.

--

___
Python tracker 

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



[issue15323] Provide target name in output message when Mock.assert_called_once_with fails

2012-07-14 Thread Éric Araujo

Éric Araujo  added the comment:

Nice idea!  A small question: Why print 'time' in the message and not 
'time.time'?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue15328] datetime.strptime slow

2012-07-14 Thread Éric Araujo

Changes by Éric Araujo :


--
components: +Extension Modules -None
versions: +Python 3.4 -Python 2.7

___
Python tracker 

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



[issue15336] Argparse required arguments incorrectly displayed as optional arguments

2012-07-14 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



[issue15337] The cmd module incorrectly lists "help" as an undocumented command

2012-07-14 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
title: The cmd module incorrectly lists "help" as an undocument command -> The 
cmd module incorrectly lists "help" as an undocumented command

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 Thread Éric Araujo

Changes by Éric Araujo :


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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 Thread Éric Araujo

Éric Araujo  added the comment:

Sounds like a pkgutil-related issue to me.

--
nosy: +eric.araujo

___
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-14 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +brett.cannon, eric.araujo, ncoghlan

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2012-07-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Here is yet some inconsistency:

$ LANG=uk_ua.microsoftcp1251 ./python -c "import locale; 
print(locale.getdefaultlocale())"
('uk_UA', 'CP1251')
$ LANG=uk_ua.microsoft-cp1251 ./python -c "import locale; 
print(locale.getdefaultlocale())"
('uk_UA', 'microsoft_cp1251')

$ ./python -c "import locale; print(locale.normalize('ka_ge.georgianacademy'))"
ka_GE.GEORGIAN-ACADEMY
$ ./python -c "import locale; print(locale.normalize('ka_GE.GEORGIAN-ACADEMY'))"
ka_GE.georgian_academy

--

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2012-07-14 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Here is a complex patch for more careful locale parsing.

--
Added file: http://bugs.python.org/file26380/locale_parse.patch

___
Python tracker 

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



[issue15327] Argparse: main arguments and subparser arguments indistinguishable

2012-07-14 Thread samwyse

samwyse  added the comment:

One change and one minor problem with my suggestion.

First, you don't need the second alias, since it's a prefix of the argument 
name.  Also, HelpFormatter._format_actions_usage ends with a bit of code 
labeled "clean up separators for mutually exclusive groups"; it removes matched 
parentheses from the argument names.  :(  I'd recommend that you instead use 
one of the following (all of which I've tested):

parser.add_argument('--verbose[main]', ...)
parser.add_argument('--verbose{main}', ...)
parser.add_argument('--verbose', ...)

--

___
Python tracker 

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



[issue15230] runpy.run_path doesn't set __package__ correctly

2012-07-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3b05cf877124 by Nick Coghlan in branch '3.2':
Close #15230: runpy.run_path now sets __package__ correctly. Also refactored 
the runpy tests to use a more systematic approach
http://hg.python.org/cpython/rev/3b05cf877124

New changeset 8a44e7c0fa30 by Nick Coghlan in branch 'default':
Merge fix for #15230 from 3.2
http://hg.python.org/cpython/rev/8a44e7c0fa30

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



[issue14935] PEP 384 Refactoring applied to _csv module

2012-07-14 Thread Robin Schreiber

Robin Schreiber  added the comment:

Added missing INCREF and DECREF inside the dealloc, and new methods of the 
types.

--
Added file: http://bugs.python.org/file26381/csv_pep384_v1.patch

___
Python tracker 

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



[issue15230] runpy.run_path doesn't set __package__ correctly

2012-07-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4880aac5c665 by Nick Coghlan in branch '3.2':
Issue #15230: Update runpy docs to clarify a couple of points that came up in 
this issue
http://hg.python.org/cpython/rev/4880aac5c665

New changeset 416cd57d38cf by Nick Coghlan in branch 'default':
Merge #15230 doc updates from 3.2
http://hg.python.org/cpython/rev/416cd57d38cf

--

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Indeed, pydoc relies on pkgutil.walk_packages to work out what to document, and 
that's broken currently due to the reliance on a non-standard importer API that 
isn't in PEP 302 (not even as an optional extension, like the get_filename() 
used by runpy)

I'm not seeing any way out other than to add an API to the importlib importers 
that pkgutil can use. My preference is to call that method "_iter_modules" 
right now, and then we can look at making it (or something like it) public for 
3.4.

--
nosy: +georg.brandl
priority: normal -> release blocker

___
Python tracker 

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



[issue15351] Add to unittest.TestCase support for using context managers

2012-07-14 Thread Chris Jerdonek

New submission from Chris Jerdonek :

The setUp() and tearDown() methods of unittest.TestCase are of course extremely 
useful.  But sometimes one has set up and tear down functionality that one 
would like to apply in the form of an existing context manager (and that may be 
from an outside source).

There is currently no clear or clean way to do this.  It would be nice if 
unittest exposed a way to do this.

The closest I have been able to come is overriding TestCase.run() as follows:

class MyTest(unittest.TestCase):

def run(self, result=None):
with my_context_manager() as foo:
# Do stuff.
super(MyTest, self).run(result)

But this is not ideal because the context manager is surrounding more than it 
should (various test initialization code internal to unittest, etc).  Also, 
ideally the API would let one apply a context manager either before or after 
setUp() and tearDown(), or both.

Here is one idea for an API.  unittest.TestCase could expose a setUpContext() 
context manager that wraps the user-defined setUp() and tearDown(), and also a 
runTestMethod() method that runs the test method code by itself (i.e. currently 
the following line of unittest/case.py: `self._executeTestPart(testMethod, 
outcome, isTest=True)`).

To use the API, the user could override a simple method called something like 
runTest():

def runTest(self):
with setUpContext():
self.runTestMethod()

The user would, in the override, be free to insert additional context managers 
before or after setUpContext(), or both.

--
components: Library (Lib)
messages: 165454
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: Add to unittest.TestCase support for using context managers
type: enhancement

___
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-14 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

In addition, before changing ImpImporter.iter_modules(), we should probably 
also add some tests of the method for values of self.path that do work (i.e. 
for when self.path is not None).  The method is currently untested.

I can work on adding tests for that over the next few days.

--
keywords: +easy

___
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-14 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 Thread Brett Cannon

Brett Cannon  added the comment:

Ugh, I don't exactly love the idea of adding a method to any of importlib's 
finders simply because PJE didn't try to make this non-standard API part of PEP 
302 or something. But basically pkgutil is worthless without doing something 
about this damn iter_modules() method that the module keeps expecting.

Nick's proposal of adding importlib._bootstrap.FileFinder._iter_modules() is 
probably the best we can do with the timeline we have. But if we do this then I 
want to deprecate pkgutil in Python 3.4 and we can then get a proper API that 
is documented for module discovery and can have whatever helper code is needed 
in importlib (since namespace packages take care of the need for extend_path() 
and the only other use for pkgutil). That's the only deal I'm willing to strike 
here if we are going to keep pkgutil working in Python 3.3 as people expect.

--
nosy: +cjerdonek

___
Python tracker 

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



[issue15228] os.utime() docs not clear on behavior on nonexistant files

2012-07-14 Thread Larry Hastings

Larry Hastings  added the comment:

I don't think this needs clarifying.  If you think the reference to "touch" 
currently only muddles the issue, let's remove it entirely.

--

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 Thread Georg Brandl

Georg Brandl  added the comment:

Not great, but that sounds reasonable.

--

___
Python tracker 

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



[issue15337] The cmd module incorrectly lists "help" as an undocumented command

2012-07-14 Thread Roger Serwy

Roger Serwy  added the comment:

On 3.3.0b1 and 3.2 I get:


(Cmd) help

Documented commands (type help ):

help


I only see help under "Undocumented" with 2.7.


It looks like this changeset f8c896ad787f never got backported to 2.7. This 
involves adding a doc string to do_help. Manually applying this doc_string 
fixes the problem on 2.7

--
nosy: +serwy

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

I agree pkgutil is pretty much useless right now and deprecation worth 
considering.  But isn't another option simply to change pkgutil's internals to 
provide its own iter_modules whenever it finds that method missing?  This seems 
to be what it has done in the past for some code paths when it made its own 
ImpImporter wrappers (in pkgutil.get_importer()):

http://hg.python.org/cpython/file/416cd57d38cf/Lib/pkgutil.py#l363

It seems this would at least work for FileFinders, though I haven't thought 
this through to know for sure one way or the other.

--

___
Python tracker 

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



[issue15280] Don't use builtins as variable names in urllib.request

2012-07-14 Thread Éric Araujo

Éric Araujo  added the comment:

> Not being able to use 'type' directly is rather annoying, so after figuring 
> that bug out I set
> some time aside to make it easier for the next person.
If you make a patch for #15002 then by all means rename “type” to “filetype” so 
that you can use the type function without jumping through hoops.  Or see if 
using isinstance can avoid the need for type.

Note that Python lets you override a built-in name, it’s only a PEP 8 
convention that recommends to avoid doing so.  In many cases it makes a lot of 
sense to name something “type” (typically a class attribute), “file” (like in 
the print function in 3.x) or “open” (see tarfile, gzip, tokenize, etc.).

> This could be considered a bug that urllib is hard to debug
I don’t think so; we prefer keeping the code similar between branches so that 
patches are easier to port.

> and breaks vim's syntax highlighting.
I am a Vim user and think there are great things (like the fact that string 
delimiters are not highlighted as string contents) and debatable things (like 
the special color for self and built-in functions).

Your help with fixing bugs is very appreciated, but I think this patch will be 
rejected.

--
status: open -> pending

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

In Python 2.7, I just did this test:

>>> import sys, pkgutil
>>> for path in sys.path:
...   print pkgutil.get_importer(path)

And got only pkgutil.ImpImporter instances and imp.NullImporter objects.

So even before, at least in the most common case, it looks like pkgutil may 
have been relying on its "wrapped" importers for access to an iter_modules() 
method.

When I do the same test in Python 3.3, I get only FileFinder instances.  So in 
Python 3.3, pkgutil just isn't getting to the lines that would otherwise create 
ImpImporter instances that would work for our purposes (presumably because 
sys.path_hooks is populated differently in Python 3.3).

--

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 Thread Brett Cannon

Brett Cannon  added the comment:

Right, you aren't getting ImpImporters because they are only used when a module 
doesn't define __loader__. But in Python 3.3, by default *all* modules get that 
attribute defined.

And yes, we could either tweak pkgutil to recognize FileFinder and special-case 
it or we can add the method and tweak the probably two or three places the 
method is called. It's a matter of effort.

--

___
Python tracker 

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



[issue9522] xml.etree.ElementTree forgets the encoding

2012-07-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +storchaka

___
Python tracker 

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



[issue15352] importlib.h should be regenerated when the marshaling code changes

2012-07-14 Thread Meador Inge

New submission from Meador Inge :

Today I was hacking on a patch that changes the marshaling format for Code 
objects.  When building the patch I was met with:

   ValueError: bad marshal data (unknown type code)
   make: *** [Lib/_sysconfigdata.py] Abort trap: 6

This is because the frozen importlib was not rebuilt with the new marshaling 
format.

--
components: Build
messages: 165464
nosy: meador.inge
priority: normal
severity: normal
stage: needs patch
status: open
title: importlib.h should be regenerated when the marshaling code changes
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



[issue15352] importlib.h should be regenerated when the marshaling code changes

2012-07-14 Thread Meador Inge

Meador Inge  added the comment:

Patch attached.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file26382/issue15352-v0.patch

___
Python tracker 

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



[issue15351] Add to unittest.TestCase support for using context managers

2012-07-14 Thread R. David Murray

R. David Murray  added the comment:

Well, if you want to invoke the context in setup/teardown for some reason (as 
opposed to in the test methods themselves), you can do this:

  def setUp(self):
  self.foo = MyContextManager.__enter__()
  self.addCleanup(MyContextManager.__exit__())

Personally I rarely do this (except occasionally the mock equivalent, see 
below), preferring to call the context manager explicitly in the test method 
itself, often factored out into a test helper.

I think we as a community are still learning how best to use context managers 
and what the optimum design of context manager is.  There is some thought that 
a context manager should always provide a non-context way of getting at the 
functionality of the enter and exit methods.  For example, the mock context 
managers have start() and stop() methods.  There has also been a small amount 
of discussion of making more use of context managers in unittest itself, 
possibly along the lines you suggest.

I think this may be an area in which we are not yet ready to settle on an API.  
Michael may have a different opinion, of course ;)

--
nosy: +michael.foord, r.david.murray
versions: +Python 3.4

___
Python tracker 

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



[issue15351] Add to unittest.TestCase support for using context managers

2012-07-14 Thread R. David Murray

R. David Murray  added the comment:

That should have been

   self.addCleanup(MyContextManager.__exit__)

You could alternatively call __exit__() explicitly in tearDown, of course, but 
I believe addCleanup is a more reliable cleanup than tearDown.

--

___
Python tracker 

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



[issue15352] importlib.h should be regenerated when the marshaling code changes

2012-07-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Looks good to me. It probably won't cover all cases (such as e.g. changing the 
bytecode format), but it's a good step forward.

--
nosy: +pitrou

___
Python tracker 

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



[issue15353] ld: library not found for -lpython3.3m because of wrong LDFLAGS_PYTHON

2012-07-14 Thread Jerry Jacobs

New submission from Jerry Jacobs :

Dear all,

I'm using python in a application (sigrok.org) and want to ship it as a 
framework with a .app folder. 

I'm building python-3.3b1 from source to a .framework. It is correctly compiled 
and installed in the given directory. Only the python-3.3.pc is incorrect 
because it has not the name python-3.3m.pc and includes the following library 
entries: Libs: -L${libdir} -lpython3.3m

So this results in:
ld: library not found for -lpython3.3m
because of the deployment of the wrong .pc Libs directive:
build/decoders/nunchuk/Makefile
127:CPPFLAGS_PYTHON = 
-I/Users/jerry/Sigrok/Python.framework/Versions/3.3/include/python3.3m 
-I/Users/jerry/Sigrok/Python.framework/Versions/3.3/include/python3.3m
159:LDFLAGS_PYTHON = 
-L/Users/jerry/Sigrok/Python.framework/Versions/3.3/lib/python3.3/config-3.3m 
-ldl -framework CoreFoundation -lpython3.3m -framework CoreFoundation 
Python.framework/Versions/3.3/Python
187:PYTHON3_CONFIG = python3.3m-config

Kind regards,
Jerry

--
assignee: ronaldoussoren
components: Macintosh
messages: 165469
nosy: Jerry.Jacobs, ronaldoussoren
priority: normal
severity: normal
status: open
title: ld: library not found for -lpython3.3m because of wrong LDFLAGS_PYTHON
type: compile error
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



[issue15353] ld: library not found for -lpython3.3m because of wrong LDFLAGS_PYTHON

2012-07-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +hynek, ned.deily

___
Python tracker 

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



[issue15353] ld: library not found for -lpython3.3m because of wrong LDFLAGS_PYTHON

2012-07-14 Thread Ned Deily

Changes by Ned Deily :


--
assignee: ronaldoussoren -> ned.deily

___
Python tracker 

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



[issue15351] Add to unittest.TestCase support for using context managers

2012-07-14 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

Thanks for the interesting background and feedback. I was aware of the 
__enter__/__exit__ option but not the other information. And yes, I agree on 
the importance of trying and discussing any API before settling on it. The one 
I suggested was merely a point of departure. :)

--

___
Python tracker 

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



[issue14340] Update embedded copy of expat - fix security & crash issues

2012-07-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e4dc8be9a72f by Gregory P. Smith in branch 'default':
Update the embedded copy of the expat XML parser to 2.1.0.  It brings
http://hg.python.org/cpython/rev/e4dc8be9a72f

--
nosy: +python-dev

___
Python tracker 

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



[issue14340] Update embedded copy of expat - fix security & crash issues

2012-07-14 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Updated in 3.3 for beta2.

I'll leave it up to release managers to decide if they want to apply these 
updates for future 2.7 and 3.2 releases (trivial, just be sure to keep our one 
local modification adding the "#define XML_HAS_SET_HASH_SALT" to expat.h when 
you do it).

I'm leaving it as a release blocker for 2.7.4 and 3.2.4 so that they see it.

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

___
Python tracker 

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



[issue14340] Update embedded copy of expat - fix security & crash issues

2012-07-14 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Reasons why it is a good idea to apply this change to 2.7.4 and 3.2.4:

* Memory leak in poolGrow (CVE-2012-1148)
* Resource leak in readfilemap.c (CVE-2012-1147)
* Buffer over-read and crash in big2_toUtf8 (CVE-2009-3560)
* Parser crash with special UTF-8 sequences (CVE-2009-3270)
* Dangling positionPtr after error (2855609) - 
http://sourceforge.net/tracker/?func=detail&aid=2855609&group_id=10127&atid=110127
 - Specifically reported by a pyexpat user.
* Unitialized memory returned from XML_Parse (3206497) - 
http://sourceforge.net/tracker/?func=detail&aid=3206497&group_id=10127&atid=110127

The features 2.1.0 adds over 2.0.x are not exposed to pyexpat or Python users.

--

___
Python tracker 

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



[issue15354] _PyObject_LengthHint only accepts longs

2012-07-14 Thread Philip Jenvey

New submission from Philip Jenvey :

The __length_hint__ optimization was broken a while ago for many iterators due 
to a bug introduced in 44c090c74202. It only accepts longs as valid hints, not 
ints

This affects 2.6 too (but that's in security-only fix mode), but not 3.x

--
assignee: pjenvey
messages: 165474
nosy: pjenvey
priority: normal
severity: normal
status: open
title: _PyObject_LengthHint only accepts longs
type: performance
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



[issue15354] _PyObject_LengthHint only accepts longs

2012-07-14 Thread Philip Jenvey

Philip Jenvey  added the comment:

attached a fix for review

--
keywords: +patch
Added file: http://bugs.python.org/file26383/lengthhint-fix.diff

___
Python tracker 

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




[issue15355] generator.__next__() docs should mention exception if already executing

2012-07-14 Thread Chris Jerdonek

New submission from Chris Jerdonek :

I think the generator.__next__() documentation should say that it raises an 
exception if the generator is already executing:

http://docs.python.org/dev/reference/expressions.html#generator.__next__

I don't think this is currently mentioned anywhere in the section on yield 
expressions.

I think this is worth mentioning because this is different from the general 
situation for iterators, for example.  One consequence of this is that, unlike 
for iterators, using a bare generator in a multithreaded situation will always 
result in a critical section (since an iterator can be made to take care of its 
own locking, etc).

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 165476
nosy: cjerdonek, docs@python
priority: normal
severity: normal
status: open
title: generator.__next__() docs should mention exception if already executing
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



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

2012-07-14 Thread Larry Hastings

Larry Hastings  added the comment:

It looks like #1747858 is another duplicate.  Though arguably all these "dups" 
aren't really dups because I rewrote chown's argument parsing for 3.3.

--

___
Python tracker 

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



[issue15354] _PyObject_LengthHint only accepts longs

2012-07-14 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

It's probably easier just to use PyNumber_Check.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue15238] shutil.copystat should copy Linux extended attributes

2012-07-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 5f62c317c202 by Larry Hastings in branch 'default':
- Issue #15238: shutil.copystat now copies Linux "extended attributes".
http://hg.python.org/cpython/rev/5f62c317c202

--
nosy: +python-dev

___
Python tracker 

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



[issue15354] _PyObject_LengthHint only accepts longs

2012-07-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 872afada51b0 by Benjamin Peterson in branch '2.7':
allow any number to be returned from __length_hint__ (closes #15354)
http://hg.python.org/cpython/rev/872afada51b0

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



[issue15238] shutil.copystat should copy Linux extended attributes

2012-07-14 Thread Larry Hastings

Changes by Larry Hastings :


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



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

2012-07-14 Thread Larry Hastings

Larry Hastings  added the comment:

Here's a first cut at a patch.  It's really just an update of Victor's patch to 
#4591 (done with his blessing).  I tweaked it slightly; the parsing functions 
are now O& converter functions.

I also added a reasonable unit test.  Note however that the unit test is only 
run if you run the test as root.

I don't think this needs any documentation, just a Misc/NEWS entry.

If someone can give me quick turnaround on a review (or two) maybe we can get 
this in before beta 2 tomorrow.

I'm adding Antoine and MvL as they were in on the earliest known bug of this 
class.

--
keywords: +patch
nosy: +loewis, pitrou
Added file: http://bugs.python.org/file26384/larry.chown.unsigned.uid.gid.1.diff

___
Python tracker 

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



[issue15233] atexit: guarantee order of execution of registered functions?

2012-07-14 Thread Larry Hastings

Larry Hastings  added the comment:

Okay, I'll remove the ".. note".  Checking in shortly.

--

___
Python tracker 

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



[issue15233] atexit: guarantee order of execution of registered functions?

2012-07-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f8b520b6f654 by Larry Hastings in branch 'default':
- Issue #15233: Python now guarantees that callables registered with
http://hg.python.org/cpython/rev/f8b520b6f654

--

___
Python tracker 

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



[issue15233] atexit: guarantee order of execution of registered functions?

2012-07-14 Thread Larry Hastings

Larry Hastings  added the comment:

So, it's checked in to trunk.  Shall I also backport to 2.7 and 3.2 as the 
issue suggests?

--

___
Python tracker 

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



[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-07-14 Thread Larry Hastings

Larry Hastings  added the comment:

The .4 patches both LGTM, please commit!

--

___
Python tracker 

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



[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-14 Thread zoupl

New submission from zoupl :

Compile python (from 2.4.6 to version 2.6.8) on solaris 5.10 sparc using gcc 
3.4.6. When using UTf-8, the \xa0 is a space. Howeve this is wrong. Version 2.7 
is OK.

>>> s = '\xa0'
>>> assert s.strip() == s
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
'en_US.UTF-8'
>>> assert s.strip() == s

--
components: Unicode
messages: 165486
nosy: ezio.melotti, zoupl
priority: normal
severity: normal
status: open
title: '\xa0' isspace returns true while compiling python on solaris 10 by 
users using gcc 3.4.6
versions: Python 2.6

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

*sigh* And, of course, there's no meaningful regression test defined for 
pkgutil.walk_packages, which is why the test suite didn't pick this up :(

Oh well, at least I have a clear place to start.

--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue15357] Deprecate redundant pieces of pkgutil

2012-07-14 Thread Nick Coghlan

New submission from Nick Coghlan :

To set the stage for fixing the regression reported in #15343, I'm going 
through and clearly marking the parts of pkgutil which should no longer be used 
now that the default import system is PEP 302 compliant.

--
assignee: ncoghlan
components: Library (Lib)
messages: 165488
nosy: georg.brandl, ncoghlan
priority: release blocker
severity: normal
status: open
title: Deprecate redundant pieces of pkgutil
type: enhancement
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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Unassigning for the moment - I'm busy fighting fires in pkgutil (which is 
actually broken due to the import changes). If someone else has time to flesh 
out the method and data attribute documentation for the ipaddress classes, that 
would be great.

--
assignee: ncoghlan -> 
components: +Documentation -Library (Lib)
stage: patch review -> needs patch

___
Python tracker 

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



[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-14 Thread R. David Murray

R. David Murray  added the comment:

2.6 only gets security fixes at this point, which this is not.

--
nosy: +r.david.murray
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-14 Thread zoupl

zoupl  added the comment:

Could you please tell me the way to deal with this is version 2.7?

--

___
Python tracker 

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



[issue12978] Figure out extended attributes on BSDs

2012-07-14 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



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

2012-07-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6120cf695574 by Eli Bendersky in branch 'default':
Close #1767933: Badly formed XML using etree and utf-16. Patch by Serhiy 
Storchaka, with some minor fixes by me
http://hg.python.org/cpython/rev/6120cf695574

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



[issue9458] xml.etree.ElementTree.ElementTree.write(): encoding handling problems

2012-07-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 51b5ee7cfa3b by Eli Bendersky in branch 'default':
Issue #9458: clarify the documentation of ElementTree.write with regards to the 
type of the stream expected for a given encoding
http://hg.python.org/cpython/rev/51b5ee7cfa3b

--
nosy: +python-dev

___
Python tracker 

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



[issue9458] xml.etree.ElementTree.ElementTree.write(): encoding handling problems

2012-07-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

I agree with Serhiy that this is more of a documentation/understanding issue 
than a real bug. I've clarified the doc of ElementTree.write a bit to make it 
explicit what stream is expected for 'write'.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
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



[issue13823] xml.etree.ElementTree.ElementTree.write - argument checking

2012-07-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

About (1):

It's customary for Python to accept "truthful" values (like non-empty strings) 
as True. I see no harm in that. Strict type-checking to boolean True in each 
and every place is not necessary.

About (2):

Similarly, this isn't productive. ET may not know about all encodings 
underlying the system. The warning is clearly documented - it's up for the user 
to make sure it's valid.

--
resolution:  -> wont fix
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] ET: add custom namespaces to serialization methods

2012-07-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

I'm changing the issue name to reflect the direction it's taken. Florent, once 
3.3 is branched, could you please refresh the patch vs. head for 3.4 (don't 
forget the "what's new") and I'll review it for commit.

--
title: Change the variable "nsmap" from global to instance 
(xml.etree.ElementTree) -> ET: add custom namespaces to serialization methods

___
Python tracker 

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



[issue13378] ET: add custom namespaces to serialization methods

2012-07-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

I'd also expand the doc of register_namespace to note what it should and 
shouldn't be used for (once this feature is added).

--

___
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-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

The pkgutil import emulation is being deprecated in 3.3

However, I'll use this as useful input for any new walk_packages tests added 
while resolving #15343

--
resolution:  -> wont fix
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



[issue15272] pkgutil.find_loader accepts invalid module names

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'll add a regression test for this as part of my purge of any internal usage 
of the pkgutil import emulation.

--

___
Python tracker 

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



[issue14988] _elementtree: Raise ImportError when importing of pyexpat fails

2012-07-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

I agree, but this will now be delayed to 3.4, since it's not a bug-fixing 
change in functionality.

P.S. is there any way to create a test for it?

--
assignee:  -> eli.bendersky
priority: normal -> low
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



[issue15083] Rewrite ElementTree tests in a cleaner and safer way

2012-07-14 Thread Eli Bendersky

Changes by Eli Bendersky :


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



[issue15352] importlib.h should be regenerated when the marshaling code changes

2012-07-14 Thread Eric Snow

Eric Snow  added the comment:

FYI: the .pyc magic number is now built/kept in Lib/importlib/_bootstrap.py, so 
updates to it will trigger a rebuild of frozen importlib during make.

--
nosy: +eric.snow

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2012-07-14 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



[issue10908] Improvements to trace._Ignore

2012-07-14 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue9914] trace/profile conflict with the use of sys.modules[__name__]

2012-07-14 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue10342] trace module cannot produce coverage reports for zipped modules

2012-07-14 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue9325] Add an option to pdb/trace/profile to run library module as a script

2012-07-14 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue14332] Better explain "junk" concept in difflib doc

2012-07-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

ping

--

___
Python tracker 

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



[issue13386] Document documentation conventions for optional args

2012-07-14 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue15352] importlib.h should be regenerated when the marshaling code changes

2012-07-14 Thread Eric Snow

Eric Snow  added the comment:

What I mean is, shouldn't changes to marshal have an accompanying bump to the 
pyc magic number?

--

___
Python tracker 

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



[issue10685] trace does not ignore --ignore-module

2012-07-14 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue13997] Clearly explain the bare minimum Python 3 users should know about Unicode

2012-07-14 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue15314] Use importlib instead of pkgutil in runpy

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

OK, the way I plan to tackle this is to actually redirect the pkgutil APIs to 
importlib (rather than using the private import emulation).

The reason I'm going to tackle it like this is that there are some assumptions 
pkgutil deals with that importlib doesn't. Specifically, runpy expects 
find_loader() to take care of importing the parent package. In addition, 
importlib is prone to throwing AttributeError or TypeError for problems where 
pkgutil consistently throws ImportError. By using pkgutil as a compatibility 
shim, most code (including runpy itself) will be able to transition to 
importlib without actually needing any changes.

This approach also brings test_runpy and test_cmd_line_script more fully to 
bear on the importlib implementation, which is a nice bonus :)

--

___
Python tracker 

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



[issue15314] Use importlib instead of pkgutil in runpy

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Oh, special - importlib.find_loader() currently expects every module to have a 
__loader__ attribute, but there's at least one that doesn't: __main__.

Guess I'll be tweaking it to handle that case more gracefully after all :)

--

___
Python tracker 

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



[issue14332] Better explain "junk" concept in difflib doc

2012-07-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I guess I should try to come up with something that is an improvement, even if 
not perfect.

--

___
Python tracker 

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



[issue15314] Use importlib instead of pkgutil in runpy

2012-07-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Ah, __main__, thou art such a special beast.

Here's my current plan:

1. __main__ will be initialised with __loader__ set to BuiltinImporter. This 
covers cases like the interactive prompt or execution of stdin where there is 
no source code available for __main__

2. When executing a script (either directly or via runpy), __main__.__loader__ 
will be *changed* at a later point to refer to the appropriate kind of loader 
object.

--
priority: high -> release blocker

___
Python tracker 

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