[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Charles-François Natali

Charles-François Natali added the comment:

I think we should test multiple timeout values (e.g. 0.1, 0.5, 1 and
1.5): it'll take a little longer, but since the test suite didn't
detect it, that's really lacking. Also, rathr than using an harcoded
delta, we could maybe use a fudger factor, like what's done for
threading lock tests.

--

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-14 Thread Ezio Melotti

Ezio Melotti added the comment:

If possible it would be better to still generate a valid output, possibly by 
limiting the indentation or removing it after a certain point.
However I don't know if there are any restrictions that should be followed 
while generating a plist (What happens if the line is too long? Is the 
indentation required?).

--

___
Python tracker 

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



[issue13510] Clarify that readlines() is not needed to iterate over a file

2013-04-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Patch LGTM.  I think it would also be better to say something like "Note that 
it's already possible to iterate on file objects using ``for line in file: 
...`` without calling file.readlines()." in Doc/library/io.rst:readlines, as 
suggested in msg148703.

--

___
Python tracker 

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



[issue13510] Clarify that readlines() is not needed to iterate over a file

2013-04-14 Thread Dan Riti

Dan Riti added the comment:

Added a new version of the patch to incorporate Ezio's comment!

--
Added file: http://bugs.python.org/file29859/demote-readlines-v2.patch

___
Python tracker 

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



[issue16826] Don't check for PYTHONCASEOK if interpreter started with -E

2013-04-14 Thread Meador Inge

Meador Inge added the comment:

Here is a version which implements the subprocess method for testing
suggested by Éric.

--
Added file: http://bugs.python.org/file29858/issue16826-1.patch

___
Python tracker 

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



[issue14012] Misc tarfile fixes

2013-04-14 Thread Éric Araujo

Éric Araujo added the comment:

I should be able to do that but can’t say when.

--
versions:  -Python 3.2

___
Python tracker 

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



[issue17733] Add tests to test__header_value_parser for RFC 2231 parsing code

2013-04-14 Thread R. David Murray

Changes by R. David Murray :


--
title: Unit tests for RFC 2231 parsing code -> Add tests to 
test__header_value_parser for RFC 2231 parsing code

___
Python tracker 

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



[issue9849] Argparse needs better error handling for nargs

2013-04-14 Thread Mark Lawrence

Mark Lawrence added the comment:

The behaviour has changed from that given in msg116355.  Using Python 3.3.1 on 
Windows.

>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('foo', nargs='1')
Traceback (most recent call last):
  File "c:\python33\lib\argparse.py", line 1322, in add_argument
self._get_formatter()._format_args(action, None)
  File "c:\python33\lib\argparse.py", line 585, in _format_args
formats = ['%s' for _ in range(action.nargs)]
TypeError: 'str' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "c:\python33\lib\argparse.py", line 1324, in add_argument
raise ValueError("length of metavar tuple does not match nargs")
ValueError: length of metavar tuple does not match nargs

The docs http://docs.python.org/3/library/argparse.html#nargs are clear that 
nargs is an integer or various types of string so I think this could be closed 
as already fixed.

--
nosy: +BreamoreBoy

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

2013-04-14 Thread Piotr Dobrogost

Piotr Dobrogost added the comment:

> Following discussions on python-dev, the default is always to symlink,
> except on Windows (no support for true symlinks on XP and older) and

In this case couldn't symlinks be automatically used on Windows Vista or newer?

--
nosy: +piotr.dobrogost

___
Python tracker 

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



[issue17010] Windows launcher ignores active virtual environment

2013-04-14 Thread Piotr Dobrogost

Piotr Dobrogost added the comment:

Issue titled "Python Launcher and virtualenv?" at 
https://bitbucket.org/vinay.sajip/pylauncher/issue/15/ is related.

--
nosy: +piotr.dobrogost

___
Python tracker 

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



[issue17480] pyvenv should be installed someplace more obvious on Windows

2013-04-14 Thread Piotr Dobrogost

Piotr Dobrogost added the comment:

I've just stumbled upon this issue after asking "Where is pyvenv script in 
Python 3 on Windows installed?" question at 
http://stackoverflow.com/q/1598/95735

"Perhaps Windows installs should include (alongside Python.exe) a pyvenv.exe 
that invokes venv for the Python environment in which it's executed."

I think it's the right thing to do.

--
nosy: +piotr.dobrogost

___
Python tracker 

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



[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

You're right, sorry. I got confused by the exponential notation in 
9.107589721679688e-05. Updated patch is in attachment.

--
Added file: http://bugs.python.org/file29857/issue17707.patch

___
Python tracker 

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



[issue16954] Add docstrings for ElementTree module

2013-04-14 Thread Eli Bendersky

Eli Bendersky added the comment:

You can ask on the python-dev mailing list. It's possible that other Python 
developers ran into a similar issue.

--

___
Python tracker 

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



[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Without using Decimal and without patching connections.py (hence
> q.get() returns immediately) the resulting delta is mismatched:

Well, why are you surprised the test fails without the patch?

--

___
Python tracker 

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



[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Without using Decimal and without patching connections.py (hence q.get() 
returns immediately) the resulting delta is mismatched:

==
FAIL: test_timeout (__main__.WithProcessesTestQueue)
--
Traceback (most recent call last):
  File "Lib/test/test_multiprocessing.py", line 708, in test_timeout
self.assertGreaterEqual(delta, 0.19)
AssertionError: 9.107589721679688e-05 not greater than or equal to 0.19

--

___
Python tracker 

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



[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't understand what you're worrying about here. This is just because of 
evaluation order:

>>> import itertools
>>> it = itertools.count()
>>> f = it.__next__
>>> f() - f()
-1
>>> f() - f()
-1

--

___
Python tracker 

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



[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Yeah, right. Too strict indeed. I'll get rid of the assertLessEqual statement.
Here's why Decimal is necessary:

>>> import time
>>> time.time() - time.time()
-9.5367431640625e-07
>>> from decimal import Decimal
>>> Decimal(time.time()) - Decimal(time.time())
Decimal('-0.69141387939453125')

--

___
Python tracker 

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



[issue17733] Unit tests for RFC 2231 parsing code

2013-04-14 Thread Ankur Ankan

Changes by Ankur Ankan :


--
components: Tests
nosy: Ankur.Ankan, r.david.murray
priority: normal
severity: normal
status: open
title: Unit tests for RFC 2231 parsing code
type: enhancement

___
Python tracker 

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



[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Your test is much too strict (and I don't understand why you're using a 
Decimal). I think testing that the delta is greater or equal than 0.2 would be 
enough.

--
nosy: +pitrou

___
Python tracker 

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



[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


Added file: http://bugs.python.org/file29856/issue17707.patch

___
Python tracker 

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



[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


Removed file: http://bugs.python.org/file29855/issue17707.patch

___
Python tracker 

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



[issue17707] Multiprocessing queue get method does not block for short timeouts

2013-04-14 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Patch including a unittest is in attachment.

--
keywords: +patch
Added file: http://bugs.python.org/file29855/issue17707.patch

___
Python tracker 

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



[issue17135] imp doc should direct to importlib

2013-04-14 Thread R. David Murray

R. David Murray added the comment:

Thanks, Kristian.  The 3.x docs were a "fresh start", so if we want to mark 
something as deprecated it would be a Python3 version number, the number 
current at the time of the deprecation.

There is another open issue, 17177, that speaks specifically about deprecating 
the module, but it sounds like a documentation deprecation to start with is a 
good idea; I believe that at this point all the imp functions can be replicated 
with suitable importlib calls (Eric can correct me if I'm wrong).  It would 
thus be as of version 3.4, at this point, since we didn't do it before the 3.3 
release.

This issue also mentions linking to "importlib instead of the import 
statement", which refers to the ':keyword:`import`' statement in the title.

Do you want to resubmit the patch with those changes?  Otherwise I can just 
make them when I commit 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



[issue17575] HTTPConnection.send

2013-04-14 Thread dspub...@freemail.hu

dspub...@freemail.hu added the comment:

Thank you Stephen.Tu for information. I think so, the "return" has been found 
;-)

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



[issue16954] Add docstrings for ElementTree module

2013-04-14 Thread David Lam

David Lam added the comment:

Hi Eli, I sure would!

(Though, if anyone finds this issue and can figure out a solution, I'd 
encourage them to post it!)

--

___
Python tracker 

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



[issue17716] From ... import fails when parent package failed but child module succeeded, yet works in std import case

2013-04-14 Thread Pascal Chambon

Pascal Chambon added the comment:

Thanks for the feedback, I'm gonna read those docs and related issues asap, and 
check that planned evolutions will actually fix this.

just as a side note in the meantime: I dont think that the problem here is the 
"purge " of sys.modules, the failure is actually located in the semantic 
difference between the two forms of import statements, that should basically 
behave the same but do not (hance the interest of these related issues noted 
above).

--

___
Python tracker 

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



[issue10438] list an example for calling static methods from WITHIN classes

2013-04-14 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Note that in Python 3 you can also do __class__.f() in a staticmethod.  Not 
sure if that is encouraged though.

--
nosy: +sbt

___
Python tracker 

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



[issue17732] distutils.cfg Can Break venv

2013-04-14 Thread Nick Sloan

Nick Sloan added the comment:

It looks like virtualenv includes an empty distutils.cfg at 
myvirtualenv/lib/python3.3/distutils/distutils.cfg. Most of 
myvirtualenv/lib/python3.3 is just symlinked to the base python version, but 
myvirtualenv/lib/python3.3/distutils/ is not, and I bet this is exactly why.

--

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-14 Thread Mike Milkin

Mike Milkin added the comment:

Yep you are correct.
>>>
plistlib.readPlistFromBytes(plistlib.writePlistToBytes({'test': 
plistlib.Data(b'aa')}))
{'test': Data(b'aa')}
>>> plistlib.readPlistFromBytes(plistlib.writePlistToBytes([{'test': 
>>> plistlib.Data(b'aa')}]))
[{'test': Data(b'')}]

I presume we want to raise a ValueError if the indentation is more than the 
maximal line length.

--

___
Python tracker 

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



[issue10438] list an example for calling static methods from WITHIN classes

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



[issue17732] distutils.cfg Can Break venv

2013-04-14 Thread Éric Araujo

Éric Araujo added the comment:

There is a --no-user-cfg option to disable reading ~/.pydistutils.cfg, but I 
don’t recall an option to ignore the global config.  How does virtualenv avoid 
this problem, if it does?

--
assignee: eric.araujo -> vinay.sajip
components: +Library (Lib) -Distutils
nosy: +carljm, vinay.sajip
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



[issue17732] distutils.cfg Can Break venv

2013-04-14 Thread Nick Sloan

New submission from Nick Sloan:

When distutils.cfg defines an install-lib, it will be used within virtual 
environments created using venv as well, which makes it impossible to install 
things with setup.py or similar.

Steps to reproduce:

Create a distutils.cfg file and set a value for install-lib.

Create a virtual environment: $pyvenv myvenv

Activate that environment: $source myvenv/bin/activate

Attempt to install something: $python distribute_setup.py

It will attempt to install in the lib-install directory, and should fail with 
an error that the directory is not on the python path. This issue affects 
python3 from the mac homebrew project, which bundles a distutil.cfg, thus 
breaking pyvenv by default.

--
assignee: eric.araujo
components: Distutils
messages: 186942
nosy: eric.araujo, nicksloan, tarek
priority: normal
severity: normal
status: open
title: distutils.cfg Can Break venv
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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-14 Thread Ezio Melotti

Ezio Melotti added the comment:

On 3.x it's called writePlistToBytes, and it seems to have the same issue.

--
versions:  -Python 3.2

___
Python tracker 

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



[issue13510] Clarify that readlines() is not needed to iterate over a file

2013-04-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree with removing .readlines section. If .readlines did not exist, I do not 
think we would add it now.

--

___
Python tracker 

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



[issue17731] test_iter_importers intermittent failure in test_pkgutil

2013-04-14 Thread Ezio Melotti

Ezio Melotti added the comment:

This is related to #16163.
Other buildbots failed too, e.g.:
http://buildbot.python.org/all/builders/x86%20RHEL%206%203.3/builds/501
http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%203.x/builds/4128
http://buildbot.python.org/all/builders/AMD64%20Fedora%20without%20threads%203.3/builds/648

--
nosy: +berker.peksag, ezio.melotti
stage:  -> needs patch
versions: +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



[issue17731] test_iter_importers intermittent failure in test_pkgutil

2013-04-14 Thread R. David Murray

New submission from R. David Murray:

A buildbot produced the following traceback, but the test passed when re-run.  

http://buildbot.python.org/all/builders/x86%20Gentoo%203.3/builds/630/steps/test/logs/stdio

test_loader_deprecated (test.test_pkgutil.ImportlibMigrationTests) ... ok

==
ERROR: test_iter_importers (test.test_pkgutil.ExtendPathTests)
--
Traceback (most recent call last):
  File "", line 1521, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/buildslave/3.3.murray-gentoo/build/Lib/test/test_pkgutil.py", 
line 206, in test_iter_importers
importlib.import_module(fullname)
  File "/var/lib/buildslave/3.3.murray-gentoo/build/Lib/importlib/__init__.py", 
line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1586, in _gcd_import
  File "", line 1567, in _find_and_load
  File "", line 1524, in _find_and_load_unlocked
ImportError: No module named 'spam.eggs'; spam is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/buildslave/3.3.murray-gentoo/build/Lib/test/test_pkgutil.py", 
line 226, in test_iter_importers
del sys.modules['spam.eggs']
KeyError: 'spam.eggs'

--
keywords: buildbot
messages: 186938
nosy: ncoghlan, r.david.murray
priority: normal
severity: normal
status: open
title: test_iter_importers intermittent failure in test_pkgutil
type: behavior

___
Python tracker 

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



[issue13510] Clarify that readlines() is not needed to iterate over a file

2013-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I would actually remove the whole section about readlines() or
> possibly just mention it briefly (something like "If you want to read
> all the lines of a file in a list you can also use f.readlines().")
> The sizehint arg is rarely used, so I don't see the point of going in
> such details about it in the tutorial.

You are right, Ezio.

--

___
Python tracker 

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



[issue13510] Clarify that readlines() is not needed to iterate over a file

2013-04-14 Thread Ezio Melotti

Ezio Melotti added the comment:

I would actually remove the whole section about readlines() or possibly just 
mention it briefly (something like "If you want to read all the lines of a file 
in a list you can also use f.readlines().")
The sizehint arg is rarely used, so I don't see the point of going in such 
details about it in the tutorial.  In Lib/, there are only a couple of places 
where it's actually used:
Lib/fileinput.py:358: self._buffer = self._file.readlines(self._bufsize)
Lib/idlelib/GrepDialog.py:90: block = f.readlines(10)

--

___
Python tracker 

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



[issue10438] list an example for calling static methods from WITHIN classes

2013-04-14 Thread R. David Murray

R. David Murray added the comment:

After a discussion (at the Boston Python sprint, unfortunately I forget with 
who) of how difficult this could be to explain succinctly without confusing 
either java/C++ programmers on the one hand or Python programmers on the other 
hand, this, the wording in the attached patch occurred to me.  I'm not certain 
that adding the extra words is worth it, but if so this might do.

--
keywords: +patch
Added file: 
http://bugs.python.org/file29854/static_method_call_examples_10438.patch

___
Python tracker 

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



[issue15866] encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs

2013-04-14 Thread Ezio Melotti

Ezio Melotti added the comment:

I tend to agree with Victor: if you want to fix 2.7 go ahead, but if that's too 
much work it's OK with me to close this issue.

--

___
Python tracker 

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



[issue17618] base85 encoding

2013-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Hi and thanks for the patch!

> I named the Mercurial base85 implementation functions with the "b85"
> prefix. For the Ascii85 ones, I used "a85". I considered overloading
> the same functions with a keyword argument to select which encoding,
> but rejected that. Thoughts?

I agree, it's better like this.

> I haven't made the changes to add a pure Python binascii module as
> suggested in msg186216. Although poorly named, "base64.py" already contains 
> a number of other encodings, so this seemed the best place for these too.

Yes, I think it's ok. I was thinking about binascii in the context of making a 
C version, but we can refactor things later anyway.

Now about the patch: I haven't read it in detail, but it seems to lack tests 
for b85decode and b85encode. It should be easy enough to get some test values 
by calling Mercurial's version.

--

___
Python tracker 

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



[issue17693] Use _PyUnicodeWriter API for CJK decoders

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ffd4b72f7f95 by Victor Stinner in branch 'default':
Issue #17693: Fix memory/reference leaks
http://hg.python.org/cpython/rev/ffd4b72f7f95

--

___
Python tracker 

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



[issue17341] Poor error message when compiling invalid regex

2013-04-14 Thread R. David Murray

R. David Murray added the comment:

Thanks Jason.

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-14 Thread Mike Milkin

Mike Milkin added the comment:

Looks like plistlib.writePlistToString is no loger in the plistlib.

--
nosy: +mmilkin

___
Python tracker 

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



[issue17341] Poor error message when compiling invalid regex

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 65db865c0851 by R David Murray in branch '3.3':
#17341: Include name in re error message about invalid group name.
http://hg.python.org/cpython/rev/65db865c0851

New changeset 227fed7a05d4 by R David Murray in branch 'default':
Merge #17341: Include name in re error message about invalid group name.
http://hg.python.org/cpython/rev/227fed7a05d4

New changeset bbb3aa45b4ea by R David Murray in branch '2.7':
#17341: Include name in re error message about invalid group name.
http://hg.python.org/cpython/rev/bbb3aa45b4ea

--
nosy: +python-dev

___
Python tracker 

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



[issue17244] py_compile.compile() fails to raise exceptions when writing of target file fails

2013-04-14 Thread Brett Cannon

Changes by Brett Cannon :


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

___
Python tracker 

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



[issue17244] py_compile.compile() fails to raise exceptions when writing of target file fails

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 04aaeae6ee7b by Brett Cannon in branch 'default':
Issue #17244: Don't mask exceptions raised during the creation of
http://hg.python.org/cpython/rev/04aaeae6ee7b

--
nosy: +python-dev

___
Python tracker 

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



[issue995907] memory leak with threads and enhancement of the timer class

2013-04-14 Thread Yael

Yael added the comment:

Added a class Threading.TimerPool. This new class spawns one thread, and that 
thread is running as long as there are active timers.

--
keywords: +patch
Added file: http://bugs.python.org/file29853/mywork.patch

___
Python tracker 

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



[issue17221] Resort Misc/NEWS

2013-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I commit patches since no one objected.

Not all errors are corrected. There are duplicates (`cat Misc/NEWS | sort | 
uniq -cd | sort -n`). I'm not sure that the line "What's New in Python 3.3.1 
release candidate 1?" in Misc/NEWS for 3.4 correct. The difference between 3.3 
and 3.4 is more than expected (`hg diff -r 3.3 -r default Misc/NEWS`).

--
stage: patch review -> commit review

___
Python tracker 

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



[issue17221] Resort Misc/NEWS

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dbb943399c9b by Serhiy Storchaka in branch '2.7':
Issue #17221: Resort Misc/NEWS.
http://hg.python.org/cpython/rev/dbb943399c9b

New changeset 7da08495b497 by Serhiy Storchaka in branch '3.3':
Issue #17221: Resort Misc/NEWS.
http://hg.python.org/cpython/rev/7da08495b497

New changeset 6fdcea9e89a3 by Serhiy Storchaka in branch 'default':
Issue #17221: Resort Misc/NEWS.
http://hg.python.org/cpython/rev/6fdcea9e89a3

--
nosy: +python-dev

___
Python tracker 

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



[issue17618] base85 encoding

2013-04-14 Thread Martin Morrison

Martin Morrison added the comment:

I've updated the Ascii85 algorithms to remove the quadratic complexity, and use 
a single struct.pack/unpack. They should now be much quicker for large input 
strings.

It's difficult to factor out commonality with b85* because the encodings and 
rules differ. This is especially true for decode (where Ascii85 allows 
arbitrary whitespace, so it either has to be stepped through as I've 
implemented it, or it would have to first be sanitised with .replace() or 
similar, which is expensive for large inputs). For encode, the special cases 
supported by Ascii85 make it impossible to *just* use a lookup table, and the 
simplified algorithm for encoding means it isn't necessary to use one at all. I 
also wanted to keep the Mercurial code intact as much as possible, so it can be 
kept in sync in future if necessary.

My notes from the previous diff also still apply if anyone has thoughts on 
those.

--
Added file: http://bugs.python.org/file29852/issue17618-3.diff

___
Python tracker 

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



[issue17702] os.environ converts key type from string to bytes in KeyError exception

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 72df981e83d3 by Victor Stinner in branch '3.3':
Close #17702: os.environ now raises KeyError with the original environment
http://hg.python.org/cpython/rev/72df981e83d3

New changeset ea54559a4442 by Victor Stinner in branch 'default':
(Merge 3.3) Close #17702: os.environ now raises KeyError with the original
http://hg.python.org/cpython/rev/ea54559a4442

New changeset b0c002fa4335 by Victor Stinner in branch '3.3':
Issue #17702: use assertRaises() for the unit test
http://hg.python.org/cpython/rev/b0c002fa4335

New changeset cc6c5b5ec4f2 by Victor Stinner in branch 'default':
(Merge 3.3) Issue #17702: use assertRaises() for the unit test
http://hg.python.org/cpython/rev/cc6c5b5ec4f2

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2013-04-14 Thread Phillip J. Eby

Phillip J. Eby added the comment:

On Sun, Apr 14, 2013 at 3:51 AM, Nick Coghlan  wrote:
> Your analysis is one of the pieces that was missing,

Unfortunately, I just noticed it's actually incorrect in a pretty
important part  In my original example, I said, "because of the
circularity, this will *also* happen if you import 'a' first."  This
statement is actually false.  Importing 'a' first in that example will
result in a.util == b.util:util, not a.util=b.util.  I made the
mistake because I was for some reason thinking that 'a' was going to
execute its import while being imported from b.util, and in that
scenario it will not.

That means there *is* an ordering dependency, and an ambiguity like
this one can lie dormant until long after you've introduced the
circularity.  :-(

--

___
Python tracker 

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



[issue15866] encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs

2013-04-14 Thread STINNER Victor

STINNER Victor added the comment:

Should we really invest time to fix bugs related to astral (non-BMP) characters 
with rare codecs and error handlers (CJK codecs, xmlcharrefreplace error 
handler)? Python 3.3 is released and has a much better support of astral 
characters (in many places). I don't know for CJK codecs: Python 3.3 still uses 
the legacy Unicode API for CJK codecs and so depend on the wchar_t type (which 
is 16 bits on Windows). I just fixed Python 3.4 to use the new Unicode API (PEP 
393), which always support astral characters support and don't depend on the 
size of the wchar_t type.

I'm not against fixing Python 2.7, I'm just not interested.

--

___
Python tracker 

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



[issue17044] Implement PEP 422: Simple class initialisation hook

2013-04-14 Thread Daniel Urban

Daniel Urban added the comment:

I've attached a new patch. With this patch, type.__prepare__ has an optional 
keyword-only argument 'namespace', and returns it if it's specified. Also, 
__init_class__ is passed an argument: a mapping proxy of the mapping originally 
returned by __prepare__.

> Would it make sense to have the signature of __init_class__ parallel
> meta.__init__()
I don't think so, because some of the arguments (name, bases) would be mostly 
useless, others would have a different meaning (namespace). Although, passing 
the keyword arguments from the class header might make some sense ... I'm not 
sure.

If everybody agrees with these changes, I'll create a patch for the PEP too.

--
Added file: http://bugs.python.org/file29851/pep422_6.patch

___
Python tracker 

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



[issue17703] Trash can mechanism segfault during interpreter finalization in Python 2.7.4

2013-04-14 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Yes, let's not break thing in point releases.

--

___
Python tracker 

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



[issue9682] socket.create_connection error message for domain subpart with invalid length is very confusing

2013-04-14 Thread Mike Milkin

Changes by Mike Milkin :


Removed file: http://bugs.python.org/file29834/Issue9682-full.patch

___
Python tracker 

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



[issue9682] socket.create_connection error message for domain subpart with invalid length is very confusing

2013-04-14 Thread Mike Milkin

Mike Milkin added the comment:

I did not mean to take the decode out of the previos patch.  Sorry for the spam.

--
Added file: http://bugs.python.org/file29850/Issue9682-full.patch

___
Python tracker 

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



[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2013-04-14 Thread Nick Coghlan

Changes by Nick Coghlan :


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

___
Python tracker 

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



[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c40b50d65a00 by Nick Coghlan in branch '3.3':
Close issue #16163: handle submodules in pkgutil.iter_importers
http://hg.python.org/cpython/rev/c40b50d65a00

New changeset 3bb5a8a4830e by Nick Coghlan in branch 'default':
Merge fix for #16163 from 3.3
http://hg.python.org/cpython/rev/3bb5a8a4830e

--
nosy: +python-dev

___
Python tracker 

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



[issue16694] Add pure Python operator module

2013-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thank you!
One optional thing, the code churn could be minimized in test_operator.py by 
writing "operator = self.module" at the beginning of each test method.
Otherwise, looks good to me.

--

___
Python tracker 

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



[issue17703] Trash can mechanism segfault during interpreter finalization in Python 2.7.4

2013-04-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 12.04.2013 20:00, Antoine Pitrou wrote:
> 
> Marc-André, does this patch work for you?
> 
> Added file: http://bugs.python.org/file29791/tstate_trashcan.patch

Thanks, Antoine. I can try this tomorrow.

--

___
Python tracker 

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



[issue17730] code.interact() doesn't support no banner

2013-04-14 Thread Drekin

New submission from Drekin:

Currently, there is no way to run code.interact without a banner – empty string 
still means to print an empty line. If I want that behaviour, I must subclass 
code.InteractiveConsole and reimplement whole .interact method including the 
repl logic just not to print a banner. Maybe there should be .print_banner 
method for this.

--
components: Library (Lib)
messages: 186914
nosy: Drekin
priority: normal
severity: normal
status: open
title: code.interact() doesn't support no banner
type: enhancement
versions: 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



[issue17703] Trash can mechanism segfault during interpreter finalization in Python 2.7.4

2013-04-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson
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



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

2013-04-14 Thread Larry Hastings

Larry Hastings added the comment:

Oh...!  Serhiy, I thought you already checked in the AsIndex stuff.  Guess I 
was asleep at the switch.

Certainly the patch should go in for trunk.  I'd be comfortable with it going 
in for 3.3 as a bugfix but that's ultimately Georg's call.

I'll give you a comment or two on the diff.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue17713] test_logging fails in test_compute_rollover_weekly_attime

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset efda51b85b31 by Vinay Sajip in branch 'default':
Issue #17713: additional tweak to test.
http://hg.python.org/cpython/rev/efda51b85b31

--

___
Python tracker 

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



[issue17713] test_logging fails in test_compute_rollover_weekly_attime

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1494daf809c1 by Vinay Sajip in branch 'default':
Closes #17713: Fixed bug in test_compute_rollover_weekly_attime.
http://hg.python.org/cpython/rev/1494daf809c1

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



[issue17413] format_exception() breaks on exception tuples from trace function

2013-04-14 Thread R. David Murray

R. David Murray added the comment:

Thanks Ingrid and Mark.  The patch looks good; I put a couple of FYI comments 
on the review.

I'm pretty sure this patch is correct, but I'd like someone with more 
experience modifying the ceval loop to confirm, so I'm nosying Benjamin.

--
nosy: +benjamin.peterson
stage: needs patch -> commit review
versions:  -Python 3.2

___
Python tracker 

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



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

2013-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you, Mark. There is only one question. For what version is it 
appropriate? Only for 3.4 or for all maintained?

--

___
Python tracker 

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



[issue2118] smtplib.SMTP() raises socket.error rather than SMTPConnectError

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset adc72ff451dc by R David Murray in branch 'default':
#2118: IOError is deprecated, use OSError.
http://hg.python.org/cpython/rev/adc72ff451dc

--

___
Python tracker 

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



[issue16550] pickletools.py treats 32bit lengths as signed, but pickle.py as unsigned

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4ced30417300 by Alexandre Vassalotti in branch '3.3':
Issue #16550: Update the opcode descriptions of pickletools to use unsigned
http://hg.python.org/cpython/rev/4ced30417300

--
nosy: +python-dev

___
Python tracker 

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



[issue16551] Cleanup the pure Python pickle implementation

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3dff836cedef by Serhiy Storchaka in branch 'default':
Closes #16551. Cleanup pickle.py.
http://hg.python.org/cpython/rev/3dff836cedef

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

___
Python tracker 

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



[issue13050] RLock support the context manager protocol but this is not documented

2013-04-14 Thread Georg Brandl

Georg Brandl added the comment:

Thanks, closing.

--
nosy: +georg.brandl
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue17727] document that some distributions change site.py defaults

2013-04-14 Thread Matthias Klose

Matthias Klose added the comment:

the local patch adds as documentation on Debian/Ubuntu:

"""
For Debian and derivatives, this sys.path is augmented with directories
for packages distributed within the distribution. Local addons go
into /usr/local/lib/python/dist-packages, Debian addons
install into /usr/lib/python3/dist-packages.
/usr/lib/python/site-packages is not used.
"""

I can improve the local information, but I'm not sure how much should be 
added/changed in the upstream documentation.

So maybe we should add an option for python-config to get the site dirs, or the 
list of site dirs too?

--

___
Python tracker 

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



[issue17729] advocacy howto improvements

2013-04-14 Thread Georg Brandl

New submission from Georg Brandl:

>From docs@:

"""
The howto-advocacy is interesting.

You might consider removing the following sentences, which I found personally 
gave me a negative impression:

"python hasn't had all the publicity" to my mind gives the impression that 
python is not popular.

"python is definitely not a toy language that only usable for small tasks". 
This gives to me the impression that you feel many people think it is.

Section "who's going to support it?" a company needs to be able to call 
someone, pay for support right now, within one hour, not on a maybe basis. I 
feel either remove this section or suggest links to three companies providing 
python support.

Section "python is freely available , how good can it be?" I felt what I wanted 
to see was not that Linux and apache are good, but why python is good.
"""

I think the advocacy howto was written quite a while ago and could use a 
makeover.

--
assignee: docs@python
components: Documentation
messages: 186903
nosy: akuchling, docs@python, georg.brandl
priority: normal
severity: normal
status: open
title: advocacy howto improvements
versions: Python 2.7, 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



[issue17728] format() default precisions undocumented

2013-04-14 Thread Georg Brandl

New submission from Georg Brandl:

The docs for % formatting say what the default precision for presentation types 
e, f, g is.  I couldn't find the same for format().

--
assignee: eric.smith
components: Documentation
messages: 186902
nosy: eric.smith, georg.brandl
priority: normal
severity: normal
status: open
title: format() default precisions undocumented
versions: Python 2.7, 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



[issue3056] Simplify the Integral ABC

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4678259af5a4 by Georg Brandl in branch '2.7':
The Integral class does not contain implementations for the bit-shifting 
operations. (See #3056.)
http://hg.python.org/cpython/rev/4678259af5a4

New changeset 1d4ba14cc505 by Georg Brandl in branch '3.3':
The Integral class does not contain implementations for the bit-shifting 
operations. (See #3056.)
http://hg.python.org/cpython/rev/1d4ba14cc505

--
nosy: +python-dev

___
Python tracker 

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



[issue14462] In re's named group the name cannot contain unicode characters

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2fa27a3818a2 by Georg Brandl in branch '3.3':
Closes #14462: allow any valid Python identifier in sre group names, as 
documented.
http://hg.python.org/cpython/rev/2fa27a3818a2

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

___
Python tracker 

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



[issue13638] PyErr_SetFromErrnoWithFilenameObject is undocumented

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4cc94d30926f by Georg Brandl in branch '2.7':
Closes #13638: document PyErr_SetFromErrnoWithFilenameObject,
http://hg.python.org/cpython/rev/4cc94d30926f

New changeset ee848457930f by Georg Brandl in branch '3.3':
Closes #13638: document PyErr_SetFromErrnoWithFilenameObject,
http://hg.python.org/cpython/rev/ee848457930f

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



[issue17618] base85 encoding

2013-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I want to see both algorithms to be similar so far as it is possible. It might 
be worth extract and reuse a common code. Mercurial's code looks far more 
optimal (for example a85encode has a quadratic complexity in result 
accumulating).

--

___
Python tracker 

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



[issue17727] document that some distributions change site.py defaults

2013-04-14 Thread Georg Brandl

New submission from Georg Brandl:

>From the docs@ list:
"""
Dear all,

the first paragraph of the documentation for the site module states that 
site.py constructs four directories using a head and tail part, and that

one of the tail parts would be lib/pythonX.Y/site-packages on UNIX/Mac.

However, in my Python 3.2 installation on Ubuntu 12.04 this is actually 
lib/python3/dist-packages (so no .Y and a different subdirectory) !

This is also stated in the module’s doc string.

I don’t know why the Python documentation says something else, but that should 
be fixed.
"""

Attached a patch to explain why the defaults may look different on some 
distributions.  Please review.

--
assignee: docs@python
components: Documentation
files: site-patch.diff
keywords: patch
messages: 186897
nosy: barry, docs@python, doko, georg.brandl
priority: normal
severity: normal
stage: patch review
status: open
title: document that some distributions change site.py defaults
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29849/site-patch.diff

___
Python tracker 

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



[issue17661] documentation of '%r' links to the wrong repr

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dd5e7aef4d5b by Georg Brandl in branch '2.7':
Closes #17661: fix references to repr() going to module repr.
http://hg.python.org/cpython/rev/dd5e7aef4d5b

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



[issue17661] documentation of '%r' links to the wrong repr

2013-04-14 Thread Georg Brandl

Georg Brandl added the comment:

Fixed, thanks.

--

___
Python tracker 

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



[issue17711] Persistent id in pickle with protocol version 0

2013-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think a string with character codes < 256 will be better for 
test_protocol0_is_ascii_only(). It can be latin1 encoded (Python 2 allows any 
8-bit strings).

PyUnicode_AsASCIIString() can be slower than _PyUnicode_AsStringAndSize() 
(actually PyUnicode_AsUTF8AndSize()) because the latter can use cached value. 
You can check if the persistent id only contains ASCII characters by checking 
PyUnicode_GET_LENGTH(pid_str) == size.

And what are you going to do with the fact that in Python 2 you can pickle 
non-ascii persistent ids, which will not be able to unpickle in Python 3?

--

___
Python tracker 

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



[issue17726] faq/design: improve clarity

2013-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ab35b5e81317 by Georg Brandl in branch '2.7':
Closes #17726: small clarification in design FAQ.
http://hg.python.org/cpython/rev/ab35b5e81317

New changeset f6fdf3457f74 by Georg Brandl in branch '3.3':
Closes #17726: small clarification in design FAQ.
http://hg.python.org/cpython/rev/f6fdf3457f74

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



[issue17716] From ... import fails when parent package failed but child module succeeded, yet works in std import case

2013-04-14 Thread Nick Coghlan

Nick Coghlan added the comment:

More generally, I think we may have to revisit the question of what we remove 
from sys.modules on failure if, as a side effect of the import, a child module 
was imported successfully.

In this situation, the possibilities are:

1. Remove the parent module, and all child modules. We don't currently do this 
because importing the child modules may have had side effects. However, I'm not 
sure this reasoning is sound, as the section of __init__.py before the failure 
may have had side effects too, and we don't let that stop us from removing the 
parent module.

2. Remove just the parent module. That's what we currently do, and it's a 
problem because we're knowingly breaking one of the import state invariants 
(i.e. if a non top-level module is present in sys.modules, then all parent 
modules in the chain can be assumed to also be in sys.modules)

3. Leave the partially initialised parent module in sys.modules as well. This 
would be a bad idea, since it would lead to very inconsistent behaviour as to 
whether or not the parent module was left in sys.modules based on the contents 
of __init__.py

To be honest, I think purging the entire subtree (option 1 above) would be 
better than what we do now - breaking state invariants is bad, because it can 
lead to surprising errors a long way from the actual source of the problem.

--
versions:  -Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.5

___
Python tracker 

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



[issue17726] faq/design: improve clarity

2013-04-14 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe:

I puzzled a bit on what that sentence meant.

--
assignee: docs@python
components: Documentation
files: diff
messages: 186891
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: faq/design: improve clarity
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29848/diff

___
Python tracker 

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



[issue17668] re.split loses characters matching ungrouped parts of a pattern

2013-04-14 Thread Mike Hoy

Changes by Mike Hoy :


--
nosy: +mikehoy

___
Python tracker 

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



[issue17716] From ... import fails when parent package failed but child module succeeded, yet works in std import case

2013-04-14 Thread Nick Coghlan

Nick Coghlan added the comment:

The interpreter level problem covered by the current issue is that the 
difference between "import mypkg.module_a" and "from mypkg import module_a" is 
masking the fact that it is the original "import mypkg" that failed, and may 
still fail on the second and subsequent imports. That is, the user level code 
is at best dubious, but the interpreter is spitting out misleading error 
messages that obscure the real cause of the failure.

In the tests for #17636, we should ensure that all of the following 
consistently raise RuntimeError when the import fails (on both the initial and 
subsequent import attempts):

import badpkg.goodmod
raise RuntimeError("Always fails")

from badpkg import goodmod
raise RuntimeError("Always fails")

from . import goodmod
raise RuntimeError("Always fails")

Where that is the __init__.py code in the following layout:

badpkg/
__init__.py
goodmod.py

--

___
Python tracker 

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



[issue992389] attribute error due to circular import

2013-04-14 Thread Nick Coghlan

Nick Coghlan added the comment:

The implementation of issue #17636 (making IMPORT_FROM fall back to sys.modules 
when appropriate) will make "import x.y" and "from x import y" equivalent for 
resolution purposes during import.

That covers off the subset of circular references that we want to allow, so I'm 
closing this one in favour of the more precisely defined proposal.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Modify IMPORT_FROM to fallback on sys.modules

___
Python tracker 

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



[issue17725] English mistake in Extending and Embedding Python doc page.

2013-04-14 Thread Kyle Simpson

Kyle Simpson added the comment:

I have provided a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file29847/issue17725.patch

___
Python tracker 

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2013-04-14 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks for working through that Phillip - falling back to sys.modules when the 
expected attribute was missing is actually something I suggested as a 
possibility years ago, and Guido's response at the time was "If it was that 
easy, someone would have done it already".

Your analysis is one of the pieces that was missing, along with Brett's insight 
that the code that needs the fallback is the IMPORT_FROM bytecode rather than 
the import implementation.

I'm going to close the original circular import bug as being superseded by this 
one.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue17725] English mistake in Extending and Embedding Python doc page.

2013-04-14 Thread Kyle Simpson

New submission from Kyle Simpson:

The second sentence in http://docs.python.org/3/extending/index.html says:

  Those modules can define new functions but also new
  object types and their methods.

The word "but" doesn't make sense here. I suppose that the
author meant to write:

  Those modules can not only define new functions but
  also new object types and their methods.

--
assignee: docs@python
components: Documentation
messages: 186886
nosy: Kyle.Simpson, docs@python
priority: normal
severity: normal
status: open
title: English mistake in Extending and Embedding Python doc page.

___
Python tracker 

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