[issue12646] zlib.Decompress.decompress/flush do not raise any exceptions when given truncated input streams

2011-08-06 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> I have another proposition (as an alternative). The new _bz2.BZ2Decompressor
> objects have an attribute called eof which is False until the end of the
> stream is read. The same attribute could be added to zlib.Decompress objects.

+1, I like the idea of being consistent across related modules.
I'll put together a patch.

--

___
Python tracker 

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



[issue11572] bring Lib/copy.py to 100% coverage

2011-08-06 Thread Sandro Tosi

Sandro Tosi  added the comment:

JFTR, the same kind of check of __reduce_ex__ and then falling back on 
__reduce__ is prenset in pickle too: maybe it's worth align them?

--

___
Python tracker 

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



[issue12703] Loading a module

2011-08-06 Thread Rémy HUBSCHER

New submission from Rémy HUBSCHER :

I patched it for redbarrel but there is the same bug on distutils2.

This patch allow to see the error raised when loading the module instead of 
saying that the module does not exists.

https://bitbucket.org/tarek/redbarrel/changeset/2cf6d7e32081#chg-redbarrel/util.py

--
assignee: tarek
components: Distutils2
messages: 141715
nosy: Natim, alexis, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: Loading a module

___
Python tracker 

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



[issue12682] Meaning of 'accepted' resolution as documented in devguide

2011-08-06 Thread Ezio Melotti

Ezio Melotti  added the comment:

FWIW that would be fine with me.  Even if there's nothing broken in a feature 
request, "fixed" applied to feature could mean "the lack of this feature has 
been fixed".
If the issue is valid, one can say so in a message without marking it as 
'accepted'.

--

___
Python tracker 

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



[issue12703] Improve error reporting for packaging.util.resolve_name

2011-08-06 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report.  Would you have time to make a code+test patch for the 
CPython repo?  distutils2 has moved there under the name packaging.

--
assignee: tarek -> eric.araujo
stage:  -> needs patch
title: Loading a module -> Improve error reporting for 
packaging.util.resolve_name
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



[issue12666] map semantic change not documented in What's New

2011-08-06 Thread Éric Araujo

Éric Araujo  added the comment:

I have reported the bugs to the metatracker.  In the meantime, could you 
manually upload a diff?

--

___
Python tracker 

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



[issue12646] zlib.Decompress.decompress/flush do not raise any exceptions when given truncated input streams

2011-08-06 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

Here's the patch.

--
Added file: http://bugs.python.org/file22846/zlib-eof

___
Python tracker 

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



[issue12646] zlib.Decompress.decompress/flush do not raise any exceptions when given truncated input streams

2011-08-06 Thread Nadeem Vawda

Changes by Nadeem Vawda :


Added file: http://bugs.python.org/file22847/zlib-eof.patch

___
Python tracker 

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



[issue12646] zlib.Decompress.decompress/flush do not raise any exceptions when given truncated input streams

2011-08-06 Thread Nadeem Vawda

Changes by Nadeem Vawda :


Removed file: http://bugs.python.org/file22846/zlib-eof

___
Python tracker 

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



[issue12666] map semantic change not documented in What's New

2011-08-06 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I'm attaching the diff at 
https://bitbucket.org/jaraco/cpython-issue12666/changeset/bc362109eed8

--
keywords: +patch
Added file: 
http://bugs.python.org/file22848/cpython-issue12666-bc362109eed8.diff

___
Python tracker 

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



[issue12301] Use :data:`sys.thing` instead of ``sys.thing`` throughout

2011-08-06 Thread Bryce Verdier

Bryce Verdier  added the comment:

I would like to help out with this, as there seems to be a lot of work that 
needs to be done.

I guess I'm a little unsure about what you mean by ``code`` instead of :data:. 
Is ``code`` generic? Like in Doc/tutorials/classes.rst I see a lot of things 
similar to ``eval()``. Are you saying that dhould be changed to :data:eval()?

--
nosy: +louiscipher

___
Python tracker 

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



[issue12301] Use :data:`sys.thing` instead of ``sys.thing`` throughout

2011-08-06 Thread Ezio Melotti

Ezio Melotti  added the comment:

Nope, ``...`` can be used for generic pieces of code, whereas e.g. 
:data:`sys.stdout` indicates that stdout is a "data" attribute of the sys 
module.
If you use :data:`...` and rebuild the doc (cd Doc/; make html), you will see 
that e.g. sys.stdout will be then a link to the sys.html page.

--

___
Python tracker 

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



[issue11481] The copy module already uses copyreg

2011-08-06 Thread Sandro Tosi

Sandro Tosi  added the comment:

After quite a long chat with Ezio, I'm just proposing this updated patch:

- it fixes the copy doc, explicitly acknowledging the use of copyreg 
functionalities
- it rewords the first paragraph of copyreg doc, which was a bit too 
pickle-centric
- it adds an example to copyreg, to give an initial clue of how it works.

I'd like to hear comments/suggestions about it.

--
nosy: +fdrake, rhettinger
Added file: http://bugs.python.org/file22849/issue11481-v2.patch

___
Python tracker 

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



[issue12704] Language References does not specify exception raised by final yield()

2011-08-06 Thread Nikolaus Rath

New submission from Nikolaus Rath :

>From http://docs.python.org/reference/simple_stmts.html#the-yield-statement:

"As of Python version 2.5, the yield statement is now allowed in the try clause 
of a try ... finally construct. If the generator is not resumed before it is 
finalized (by reaching a zero reference count or by being garbage collected), 
the generator-iterator’s close() method will be called, allowing any pending 
finally clauses to execute."

This strongly suggests that the last-executed yield statement will raise an 
exception if the generator is closed. If this is the case, it would be great if 
the documentation could be extended to say what exception is raised.

If this is not the case, it would be great if whatever magic is happening could 
be documented as well.

--
assignee: docs@python
components: Documentation
messages: 141724
nosy: Nikratio, docs@python
priority: normal
severity: normal
status: open
title: Language References does not specify exception raised by final yield()
type: feature request
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue12301] Use :data:`sys.thing` instead of ``sys.thing`` throughout

2011-08-06 Thread Bryce Verdier

Bryce Verdier  added the comment:

Is this more what was in mind for the bug?

--
Added file: http://bugs.python.org/file22850/issue12301.test_patch

___
Python tracker 

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



[issue12704] Language References does not specify exception raised by final yield()

2011-08-06 Thread Nikolaus Rath

Nikolaus Rath  added the comment:

>From http://www.python.org/dev/peps/pep-0342/ I believe that the last yield 
>will raise GeneratorExit. So my suggestion is to replace the above mentioned 
>paragraph with:

"""
As of Python version 2.5, yield is an expression rather than a statement and 
allowed in the try clause of a try ... finally construct. If the generator is 
not resumed before it is finalized (by reaching a zero reference count or by 
being garbage collected), the generator-iterator’s close() method will be 
called, and the yield expression in the generator function will raise 
GeneratorExit. 

If the generator function raises GeneratorExit (either directly or by not 
catching it), future calls to the next() method of the generator iterator will 
raise StopIteration. GeneratorExit exceptions raised by the generator function 
are catched internally and do not result in a call to sys.excepthook.
"""

--

___
Python tracker 

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



[issue12611] 2to3 crashes when converting doctest using reduce()

2011-08-06 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Attached a patch that adds a test case reproducing the issue. Hopely someone 
with more experience with lib2to3 can do the actual fixing...

--
keywords: +patch
type:  -> behavior
Added file: http://bugs.python.org/file22851/issue12611_test.patch

___
Python tracker 

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



[issue12301] Use :data:`sys.thing` instead of ``sys.thing`` throughout

2011-08-06 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I presume so. I believe ``x`` is meant for general code like ``for thing in 
group: print(thing)``. While Éric specifically mentioned the :data: role, I 
presume the same idea applies to :func: and possibly other link-generating 
roles.

Is there a statement role, so that "effect of the ``global`` statement, " could 
be changed to link to the global statement doc?

This seems like a great project for a beginning developer to contribute patches.

Georg, do you have any reason to not have markup become more specific?

--
nosy: +georg.brandl

___
Python tracker 

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



[issue12702] shutil.copytree() should use os.lutimes() to copy the metadata of symlinks

2011-08-06 Thread Ned Deily

Ned Deily  added the comment:

Keep in mind that os.lutimes() may not be available on the platform so the 
patch will need to test for that.

--
nosy: +ned.deily

___
Python tracker 

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



[issue12301] Use :data:`sys.thing` instead of ``sys.thing`` throughout

2011-08-06 Thread Ezio Melotti

Ezio Melotti  added the comment:

For global there's :keyword:.  Also note that :data: should be used for 
module-level variables (or constant) not for attributes of e.g. classes and 
instances.

If there are other ``...`` that can be fixed (even using something else like 
e.g. :func: or :meth:), they should be fixed as well, but apparently ``...`` 
was often misused instead of :data: (maybe :data: was a recent addition).

--

___
Python tracker 

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



[issue12661] Add a new shutil.cleartree function to shutil module

2011-08-06 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Hello Leonid, I think the best way forward would be post it as a recipe in 
active state cookbook if you have not already and see the adoption. If there is 
enough, then it can be added to shutil module. AFAIK, a couple of shutil 
features have gained entry in this way.

--

___
Python tracker 

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



[issue10087] HTML calendar is broken

2011-08-06 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

FWIW, I think removing the encoding facility (more so because it can interfere 
with the terminal encoding) and just dealing with strings to output the html 
version of calendar seems a neater way than definiing write = 
sys.stdout.buffer.write and writing the bytes to the STDOUT.

Is this not feasible at the moment?

--
nosy: +orsenthil

___
Python tracker 

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



[issue12608] crash in PyAST_Compile when running Python code

2011-08-06 Thread Meador Inge

Meador Inge  added the comment:

Thanks for the test case Albert.  The attached patch adds a unit test based off 
of the given repro case and fixes the bug in the FunctionDef compiler.  The 
compiler was hitting a NULL pointer deref on FunctionDefs with empty list 
bodies.

Reproduced and fixed on tip.  Full test suite ran on Fedora 15; no regressions.

--
keywords: +patch
nosy: +meador.inge
stage:  -> patch review
Added file: http://bugs.python.org/file22852/issue12608.patch

___
Python tracker 

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



[issue10087] HTML calendar is broken

2011-08-06 Thread Ezio Melotti

Ezio Melotti  added the comment:

BTW, accessing sys.stdout.buffer is not really safe, because if sys.stdout has 
been replaced with some other object, the buffer attribute might not be 
available (IIRC StringIO doesn't have it).

--

___
Python tracker 

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



[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?

2011-08-06 Thread Devin Jeanpierre

New submission from Devin Jeanpierre :

(this is copy-pasted from 
http://mail.python.org/pipermail/python-ideas/2011-July/010787.html )

compile('1\n2\n', '','single') == compile('1\n', '','single').

That is, it ignores the second statement ('2\n'),
without offering a way for the caller to detect this.

Considering that 'single' is primarily used to emulate the behaviour
of the Python interpreter, most of the time, giving it multiple
statements is an impossibility, and so that case doesn't matter and
could raise an exception without affecting existing code. For example,
the code module meets this description, as do debuggers and such.

However, in cases where it _is_ possible to give the compiler multiple
statements, the user should be warned that his input isn't valid,
somehow. For example, the following doctest will mysteriously fail,
because it was written incorrectly (doctest uses 'single'):

   >>> import sys
   ... sys.stdout.write('foo\n')
   foo

This is because the second statement in the doctest was silently
discarded by compile(). It might not always be clear to users how to
fix this, and I think this kind of non-obvious error would exist in
any use of 'single' that can in theory involve multiple statements,
through user error or program bug. So I'd appreciate it if compile()
raised an exception in this case. Perhaps SyntaxError or ValueError.

--
components: Interpreter Core
messages: 141735
nosy: Devin Jeanpierre
priority: normal
severity: normal
status: open
title: Make compile('1\n2\n', '', 'single') raise an exception instead of 
silently truncating?
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



[issue10087] HTML calendar is broken

2011-08-06 Thread Chris Lambacher

Chris Lambacher  added the comment:

Senthil: I think that would fundamentally make things worse. The HTML calendar 
apparently always provides a bytes type, but lets assume it provided you with 
unicode and we used sys.stdout.write on the output. Fundamentally you would get 
the same behavior as the patch provides since if you don't provide an encoding 
it uses sys.getdefaultencoding() which, IIUC is fundamentally what happens if 
you sys.stdout.write a unicode string.

Ezio: I think it is highly unlikely that someone would be fiddling around with 
sys.stdout and then calling the main() function on calendar.main() (after 
setting up sys.args so that option parser gets the right parameters).

--

___
Python tracker 

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



[issue12677] Turtle, fix right/left rotation orientation

2011-08-06 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Sandro - You could go ahead and commit this.

--

___
Python tracker 

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



[issue1346874] httplib simply ignores CONTINUE

2011-08-06 Thread Nikolaus Rath

Changes by Nikolaus Rath :


--
nosy: +Nikratio

___
Python tracker 

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



[issue10087] HTML calendar is broken

2011-08-06 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Chris, as you already suggested in msg124410, I would prefer the removal of 
encoding specification from command line. Providing the encoding argument via 
API with deprecating warning is a good idea.

The output should be string and it should be just be printed. It should not be 
converted to bytes and then decoded back to string.

--
nosy: +pitrou

___
Python tracker 

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



[issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions

2011-08-06 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil
nosy: +orsenthil

___
Python tracker 

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