[issue2889] curses for windows (alternative patch)

2010-10-08 Thread Christoph Gohlke

Changes by Christoph Gohlke :


--
nosy: +cgohlke

___
Python tracker 

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



[issue812369] module shutdown procedure based on GC

2010-10-08 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

0001-update-GC-shutdown-patch.patch looks sane to me at first glance.  any 
other opinions?

--

___
Python tracker 

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



[issue1545463] New-style classes fail to cleanup attributes

2010-10-08 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

looks harmless to me.  though i think issue812369 looks okay as well at first 
glance.

--

___
Python tracker 

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-10-08 Thread Matthew Barnett

Matthew Barnett  added the comment:

issue2636-20101009.zip is a new version of the regex module.

It appears from a posting in python-list and a closer look at the docs that 
string positions in the 're' module are limited to 32 bits, even on 64-bit 
builds. I think it's because of things like:

Py_BuildValue("i", ...)

where 'i' indicates the size of a C int, which, at least in Windows compilers, 
is 32-bits in both 32-bit and 64-bit builds.

The regex module shared the same problem. I've changed such code to:

Py_BuildValue("n", ...)

and so forth, which indicates Py_ssize_t.

Unfortunately I'm not able to confirm myself that this will fix the problem on 
64 bits.

--
Added file: http://bugs.python.org/file19168/issue2636-20101009.zip

___
Python tracker 

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



[issue1553375] Add traceback.print_full_exception()

2010-10-08 Thread R. David Murray

R. David Murray  added the comment:

I like 'allframes', so I changed to that.  The updated patch also adds the 
allframes parameter to format_exception.

In going over the tests I realized that I'm not sure the output for the case of 
chain=True is correct.  Opinions?  If it is not correct it is not obvious to me 
how to fix it.

--
Added file: http://bugs.python.org/file19167/full_traceback2.patch

___
Python tracker 

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



[issue10008] Two links point to same place

2010-10-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

> You initial link 
> I only see one entry, Thread (class in threading), which points to
> http://docs.python.org/library/threading.html#threading.Thread
> as it should. I do not see a duplicate link nearby.

It used to be there. Please see
http://docs.python.org/release/2.7/genindex-T.html
But ZipFile seems to have same issue, and still there.
Please see
http://docs.python.org/genindex-Z.html

>Thread [neader, no link]
>  module

Hmm, I cannot see this.

--

___
Python tracker 

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



[issue8445] buildbot: test_ttk_guionly failures (test_traversal, test_tab_identifiers, test_identify, test_heading_callback)

2010-10-08 Thread Stephen Hansen

Stephen Hansen  added the comment:

BTW, release31-maint appears to have the same issue, its fouling up that build 
on my slave too. I tried applying the ttk3k.patch but it didn't apply cleanly, 
and I'm completely ignorant of TK so can't really figure out what's different 
between the 3.1->3.2 version to try to adjust the fix and test it out.

Then again I'm not sure if there's still going to be test-fixes applied to 3.1. 
So its possible you can just ignore this comment :)

--

___
Python tracker 

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



[issue8445] buildbot: test_ttk_guionly failures (test_traversal, test_tab_identifiers, test_identify, test_heading_callback)

2010-10-08 Thread Stephen Hansen

Stephen Hansen  added the comment:

I'm still getting this error on the release27-maint branch on my Snow Leopard 
slave, and the issue8445.diff fixes it: will this fix be backported?

I tested issue8445.diff and it applies cleanly, and fixes the issue.

--
nosy: +ixokai

___
Python tracker 

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



[issue10025] random.seed not initialized as advertised

2010-10-08 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Perhaps replace equivalent with "based on" or some such.  This is a very minor 
nit and likely of interest to no one except the OP.

--
priority: normal -> low

___
Python tracker 

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



[issue10043] UnboundLocalError with local variable set by setattr, caused by code run later

2010-10-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The usual way to set a module variable by name, rather than
setattr(modules[__name__], 'name', 'value')
is
>>> globals()['name'] = 2
>>> name
2

Issues of working with external names, such as from database columns, has been 
discussed several times on python-list and the corresponding newsgroups. Please 
post there is you want to discuss that.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue7642] Minor improvement to os.system doc

2010-10-08 Thread Éric Araujo

Éric Araujo  added the comment:

Looks good.  (Before committing, one space should be changed to two spaces 
after a full stop in the first diff hunk.)

--
assignee: georg.brandl -> d...@python
nosy: +d...@python
stage:  -> patch review
title: [patch] Minor improvement in os.system doc -> Minor improvement to 
os.system doc
versions: +Python 2.7, Python 3.1

___
Python tracker 

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



[issue10018] IDLE not loading in xp pro due to tcl issue

2010-10-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Please ask for help with installation and usage on the python-list mailing 
list, which is also mirrored on the gmane.comp.python.general newsgroup at 
news.gmane.org and the comp.lang.python usenet newsgroup. This issue tracker is 
for python bugs (and feature requests).

Your problem probably stems from the fact that you have both python22 and 
python27 on the search path, but I cannot say why or what you need to do. Ask 
as suggested above, specifying exactly how you installed python.

PS. 2.5 and 2.6 are closed to normal bug reports.

--
nosy: +terry.reedy
resolution:  -> invalid
status: open -> closed
versions:  -Python 2.5, Python 2.6

___
Python tracker 

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



[issue1051] certificate in Lib/test/test_ssl.py expires in February 2013

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Cert generation script committed in r85327.

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



[issue10025] random.seed not initialized as advertised

2010-10-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

3.1 has the same problem (and the same results as above)

Assuming behavior is not changed, please suggest a specific rewording that you 
would be happy with and that is not too verbose.

--
components: +Documentation
nosy: +terry.reedy
stage:  -> needs patch
versions: +Python 3.1

___
Python tracker 

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



[issue10021] Format parser is too permissive

2010-10-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This is a bug report in that there is a discrepancy between the grammar in the 
doc and the behavior. Laxiness can lead to portability problems if CPython is 
lax compared to a normal reading of the spec and another implementation takes 
the spec seriously.

I agree that implementation details that lead to an exception here and not 
there, or vice versa, are best avoided.

For getattr:
'''
getattr(object, name[, default]) 
Return the value of the named attributed of object. name must be a string.
'''
the doc is careful to just say that name must be a string, not specifically an 
identifier. Given that, I suppose
"attribute_name::=  identifier" should be changed to match so that string 
formats can always (all implementations) also access non-identifier attributes.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue7771] dict view comparison methods are not documented

2010-10-08 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The '^' corresponds to the __xor__ magic method.

snip from _abcoll.py:

def __xor__(self, other):
if not isinstance(other, Set):
if not isinstance(other, Iterable):
return NotImplemented
other = self._from_iterable(other)
return (self - other) | (other - self)

--

___
Python tracker 

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



[issue10011] `except` doesn't use `isinstance`

2010-10-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Questions should be asked on python-list or other discussion forums, not nere. 
If this were a feature-request, it would need a realistic use-case. If the 
implied change were requested, I would think it should be rejected as 
conflicting with the language definition, which to me stipulates that when an 
exception is raised, nothing happens until it is caught.

--
nosy: +terry.reedy
resolution:  -> invalid
status: open -> closed
versions:  -Python 3.1

___
Python tracker 

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



[issue7771] dict view comparison methods are not documented

2010-10-08 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hello Raymond,
thanks for the review. I've reworked the patch to refer to Collections.Set (but 
is there a way to make that reference a link to the description of Collections 
ABCs?) and so I've also removed all the examples, leaving only the one for '^' 
because I didn't see a Set operator to do that (but I'm happy to be proven 
wrong :)

Regards,
Sandro

--
Added file: http://bugs.python.org/file19166/issue7771-py3k-v2.patch

___
Python tracker 

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



[issue10008] Two links point to same place

2010-10-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

You initial link 
I only see one entry, Thread (class in threading), which points to
http://docs.python.org/library/threading.html#threading.Thread
as it should. I do not see a duplicate link nearby.

I have no idea what ', [1]' is supposed to mean.

What does puzzle me is that

Thread [neader, no link]
   module

points to http://docs.python.org/c-api/init.html#index-64
it seems like the entry should have more. This entry is gone in 3.1.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue10017] pprint.pprint raises TypeError on dictionaries with user-defined types as keys

2010-10-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

A simpler change would to replace:
rv = self.obj.__lt__(other.obj)
with
rv = type(self.obj).__lt__(self.obj, other.obj)

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue4388] test_cmd_line fails on MacOS X

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

For the record, this can be now reproduced under Linux by forcing different 
locale and filesystem encodings:

$ PYTHONFSENCODING=utf8 LANG=ISO-8859-1 ./python -m test.regrtest test_cmd_line

[1/1] test_cmd_line
test test_cmd_line failed -- Traceback (most recent call last):
  File "/home/antoine/py3k/__svn__/Lib/test/test_cmd_line.py", line 109, in 
test_run_code
assert_python_ok('-c', command)
  File "/home/antoine/py3k/__svn__/Lib/test/script_helper.py", line 35, in 
assert_python_ok
return _assert_python(True, *args)
  File "/home/antoine/py3k/__svn__/Lib/test/script_helper.py", line 31, in 
_assert_python
"stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 1, stderr follows:
Traceback (most recent call last):
  File "", line 1, in 
TypeError: ord() expected a character, but string of length 2 found

--
nosy: +pitrou

___
Python tracker 

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



[issue9992] Command line arguments are not correctly decodedif locale and fileystem encodings aredifferent

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The important point is that we have to use the same encoding to decode 
> and encode command line arguments.

I don't think I agree with this. It's only important when you run a Python 
interpreter using subprocess, but the point of using subprocess is to run 
something *else* than Python. This something else generally expects filenames 
in their correct bytes representation, not in a mojibaked version hand-tuned 
for Python.

--
nosy: +pitrou

___
Python tracker 

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



[issue7771] dict view comparison methods are not documented

2010-10-08 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

We should probably just make reference to the collections.Set() abstract API 
instead of listing out all operations.

--
nosy: +rhettinger

___
Python tracker 

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



[issue4388] test_cmd_line fails on MacOS X

2010-10-08 Thread STINNER Victor

STINNER Victor  added the comment:

> FWIW, this still happens on the latest of /branches/py3k, 
> when LANG does not match up to the enforced fs encoding
 
ixokai has the bug on Snow Leopard x86.

--

___
Python tracker 

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



[issue1553375] Add traceback.print_full_exception()

2010-10-08 Thread R. David Murray

R. David Murray  added the comment:

No, that would be a bug, thanks.

Also thanks for reminding me about this issue.

--

___
Python tracker 

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



[issue9992] Command line arguments are not correctly decodedif locale and fileystem encodings aredifferent

2010-10-08 Thread Stephen Hansen

Stephen Hansen  added the comment:

This issue seems to be the cause of issue4388 -- and cmdline_encoding-2.patch 
fixes it, fwiw.

--
nosy: +ixokai

___
Python tracker 

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



[issue4388] test_cmd_line fails on MacOS X

2010-10-08 Thread Stephen Hansen

Stephen Hansen  added the comment:

FWIW, this still happens on the latest of /branches/py3k, when LANG does not 
match up to the enforced fs encoding-- which for me happened when I ran the 
buildslave under launchd.

I was finally able to reproduce it, and after doing so, verified that 
cmdline_encoding-2.patch on issue9992 fixed it.

--
nosy: +ixokai

___
Python tracker 

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



[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-08 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Refuse the temptation to hypergeneralize ;-)

Also refuse the temptation to double the size of the docs (more != better).

In the case of min/max, the pure python versions may add some value in showing 
that the first match is what is returned.  But the code will also be a bit 
convoluted because it needs paths for key-argument case and for the screwy 
interpretation of 1 arg vs multiple args.

The pure python code is there for any() and all() to show the early out feature 
and to suggest how you could roll-your-own if you want different behavior (such 
as returning the value of the first exception).

--

___
Python tracker 

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



[issue7771] dict view comparison methods are not documented

2010-10-08 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hello,
here attached a patch for this bug. I hope the format "< / <= / == / != / >= / 
>" is clearly understandable as an alternative sequence of different operations.

Regards,
Sandro

--
keywords: +patch
nosy: +sandro.tosi
Added file: http://bugs.python.org/file19165/issue7771-py3k.patch

___
Python tracker 

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



[issue3976] pprint._safe_repr is not general enough in one instance

2010-10-08 Thread Rodrigo Bernardo Pimentel

Rodrigo Bernardo Pimentel  added the comment:

Armin: this has the problem that, if the object you're trying to compare is a 
class, self.obj.__lt__ expects a different number of parameters (i.e., it 
expects the instance). See issue 10017 . Testing with "<" works.

--
nosy: +rbp

___
Python tracker 

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



[issue8902] add datetime.time.now() for consistency

2010-10-08 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
stage:  -> needs patch
type:  -> feature request
versions:  -Python 2.7, Python 3.1, Python 3.3

___
Python tracker 

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



[issue8902] add datetime.time.now() for consistency

2010-10-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I need to correct myself: datetime.today() is not an alternative spelling of 
date.today(), but rather a function returning current datetime which subtly 
different from datetime.now().

--

___
Python tracker 

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



[issue10045] poor cStringIO.StringO seek performance

2010-10-08 Thread Patrick Strawderman

Patrick Strawderman  added the comment:

Fair enough, but there is a great deal of existing code that already 
uses cStringIO.

--

___
Python tracker 

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



[issue10017] pprint.pprint raises TypeError on dictionaries with user-defined types as keys

2010-10-08 Thread Rodrigo Bernardo Pimentel

Rodrigo Bernardo Pimentel  added the comment:

If I'm understanding this correctly, this fails on 3.1 and not (although, 
actually, it does) on py3k/3.2 because:

* pprint._safe_key.__lt__ checks "rv = self.obj.__lt__(other.obj)" and falls 
back to id comparison if rv is NotImplemented

* If the object passed to _safe_key is a class, self.obj.__lt__ will expect 
*self* as well as the other object. Therefore the verification above fails with 
"TypeError: expected 1 arguments, got 0". You can see that pprint works with an 
instance:

>>> pprint.pprint({A(): 1, 1: 2})
{<__main__.A object at 0x8594d4c>: 1, 1: 2}

* Finally, this works on py3k *for your example* because, for some reason, on 
py3k the comparison is being based on the 1 key. That is, the comparison on 
_safe_key.__lt__ happens to be 1.__lt__(A), instead of A.__lt__(1). Perhaps 
hashing changed after the 3.1 release?

Anyway, py3k still fails when you force the comparison to happen on the class:

>>> class B(object): pass
... 
>>> pprint.pprint({A: 1, B: 2})
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/rbp/python/dev/py3k/Lib/pprint.py", line 55, in pprint
printer.pprint(object)
  File "/home/rbp/python/dev/py3k/Lib/pprint.py", line 132, in pprint
self._format(object, self._stream, 0, 0, {}, 0)
  File "/home/rbp/python/dev/py3k/Lib/pprint.py", line 155, in _format
rep = self._repr(object, context, level - 1)
  File "/home/rbp/python/dev/py3k/Lib/pprint.py", line 245, in _repr
self._depth, level)
  File "/home/rbp/python/dev/py3k/Lib/pprint.py", line 257, in format
return _safe_repr(object, context, maxlevels, level)
  File "/home/rbp/python/dev/py3k/Lib/pprint.py", line 299, in _safe_repr
items = sorted(object.items(), key=_safe_tuple)
  File "/home/rbp/python/dev/py3k/Lib/pprint.py", line 89, in __lt__
rv = self.obj.__lt__(other.obj)
TypeError: expected 1 arguments, got 0
>>> 

So, basically, the fix on issue 3976 does't (always) work when there are 
classes as dict keys. I think switching from

rv = self.obj.__lt__(other.obj)
if rv is NotImplemented:

to something like

try:
rv = self.obj < other.obj
except TypeError:
rv = (str(type(self.obj)), id(self.obj)) < \
(str(type(other.obj)), id(other.obj))

solves this. Or we can check first whether self.obj is a 'type', but I think it 
gets convoluted.

If anyone can confirm that that's the way to go, I can produce one (though it's 
a trivial one). Raymond?

--

___
Python tracker 

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



[issue9866] Inconsistencies in tracing list comprehensions

2010-10-08 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
status: pending -> closed

___
Python tracker 

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



[issue4775] Incorrect documentation - UTC time

2010-10-08 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
status: pending -> closed

___
Python tracker 

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



[issue1545463] New-style classes fail to cleanup attributes

2010-10-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Does anyone want to weigh in on this?  I am merging in the issue812369 nosy 
list.

I would like to either apply gc-import.patch or close this as superseded by 
issue812369.

--
keywords: +needs review -patch
nosy: +arigo, brett.cannon, candrea, cburroughs, christian.heimes, glchapman, 
gregory.p.smith, loewis, nascheme, pitrou -BreamoreBoy
stage:  -> commit review
versions: +Python 3.2 -Python 2.5, 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



[issue1777412] Python's strftime dislikes years before 1900

2010-10-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

kiorky,

Thank you for the updated patch, but since it implements a new feature, it 
cannot be applied to 2.x series.  I am +1 on removing year > 1900 limitation 
from datetime.strftime in 3.x, but you need to consider how this can be 
achieved in pure python datetime implementation which is now slated to be 
released in 3.2.  See msg110792 above.

--

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Thu, Oct 7, 2010 at 3:37 PM, Raymond Hettinger
 wrote:
..
> I'll update the docs with an equivalent that works and that has a comment 
> showing when the
> StopIteration is raised and caught.
>

In this case, I wonder if "equivalent to" code should be added to the
section for enumerate() and map().  Also since any() and all() have
"equivalent to" code, I think min(), max() and sum() deserve it as
well.

--

___
Python tracker 

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



[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-10-08 Thread Stephen J. Turnbull

Changes by Stephen J. Turnbull :


--
nosy: +sjt

___
Python tracker 

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



[issue1553375] Add traceback.print_full_exception()

2010-10-08 Thread Pascal Chambon

Pascal Chambon  added the comment:

Is that normal to have two methods "test_full_traceback_is_full" at the same 
place, in full_traceback.patch / r.david.murray / 2010-08-04 02:32 ?

format_exception should have the same semantic as print_exception indeed.

--

___
Python tracker 

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



[issue10017] pprint.pprint raises TypeError on dictionaries with user-defined types as keys

2010-10-08 Thread Rodrigo Bernardo Pimentel

Rodrigo Bernardo Pimentel  added the comment:

FWIW, the problem still occurs on the most recent release31-maint checkout (as 
of r85323), and does not happen on py3k (3.2a2).

--
nosy: +rbp

___
Python tracker 

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



[issue7642] [patch] Minor improvement in os.system doc

2010-10-08 Thread Sandro Tosi

Changes by Sandro Tosi :


--
versions: +Python 3.2 -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



[issue7642] [patch] Minor improvement in os.system doc

2010-10-08 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hello,
I took the freedom to refresh this patch, clarifying the first Val's addition 
(as requested by Éric) and reformat the whole system() section to wrap a column 
80.

Regards,
Sandro

--
nosy: +sandro.tosi
Added file: http://bugs.python.org/file19164/issue7642.patch

___
Python tracker 

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



[issue6825] Minor documentation bug with os.path.split

2010-10-08 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi Evan,
all your comments make sense, so I prepared a new patch about it.

I decided to go with the first option and adding a note about the possible 
different strings.

Regards,
Sandro

--
versions: +Python 3.2 -Python 2.6
Added file: http://bugs.python.org/file19163/issue6825-py3k-v2.patch

___
Python tracker 

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



[issue9003] urllib.request and http.client should allow certificate checking

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a preliminary patch for http.client. I think it would be good to have 
local tests using a custom HTTPS server, too.

--
keywords: +patch
Added file: http://bugs.python.org/file19162/httpcli.patch

___
Python tracker 

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



[issue10047] python-2.6.6 coredump running newspipe

2010-10-08 Thread Rodrigo Bernardo Pimentel

Rodrigo Bernardo Pimentel  added the comment:

Does this always happen with a particular feed? Could you provide us with a 
configuration that reproduces the problem?

Also, as R. David Murray asked, does this happen with 2.7?

--
nosy: +rbp

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-08 Thread R. David Murray

R. David Murray  added the comment:

After RM approval on irc, committed in r85322, with some additional doc fixes 
but no code changes relative to the last patch posted here.

I'm leaving this open because I still want to try to improve the handling of 
non-ascii bytes in headers when decoding them to unicode.

--
priority: release blocker -> high

___
Python tracker 

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



[issue10047] python-2.6.6 coredump running newspipe

2010-10-08 Thread Thomas Klausner

Thomas Klausner  added the comment:

# python2.6
Python 2.6.6 (r266:84292, Sep 23 2010, 08:13:08)
[GCC 4.1.3 20080704 prerelease (NetBSD nb2 20081120)] on netbsd5
Type "help", "copyright", "credits" or "license" for more information.
>>> format(0.15256118774414062, ".2f")
'0.15'
>>>

--

___
Python tracker 

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



[issue10046] Correction to atexit documentation

2010-10-08 Thread Jason Baker

Jason Baker  added the comment:

I like that phrasing.  I think it would be a good idea to mention that this 
includes SIGINT by default, just to be explicit.

--

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-08 Thread R. David Murray

R. David Murray  added the comment:

Here is the final pre-alpha patch.  This one includes the BytesFeedParser class 
and a test.

Unless there are objections I'd like to commit this.  Believing the code needs 
a more thorough review would be a valid objection :)

--
Added file: http://bugs.python.org/file19161/email_parse_bytes9.diff

___
Python tracker 

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



[issue5117] os.path.relpath problem with root directory

2010-10-08 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto :


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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

I considered using a variable, but I went with the factory function for two 
reasons: consistency with the rest of contextlib, and equivalence to the 
contextmanager-based implementation.

Another reason is that it leaves the option of adding optional parameters at a 
later point.  I know, optional parameters aren't likely for a "null" 
constructor, but still... it somehow didn't feel right to relinquish control.

--

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-08 Thread R. David Murray

R. David Murray  added the comment:

I can only fix one package at a time :)

And in case it isn't clear, the "Generator produces ASCII-only unicode", which 
is in many ways a rather strange API, is one of the chief motivations for 
email6.

--

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Even if smtplib accepted bytes (it currently does not),

That sounds like a critical failure.

--

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-08 Thread R. David Murray

R. David Murray  added the comment:

Even if smtplib accepted bytes (it currently does not), *Generator* is still 
producing unicode, and should produce valid unicode and still insofar as 
possible preserve the meaning of the original message.  This means unicode acts 
as if it is an SMTP server that does not support the 8bit capability, so we 
must convert to 7bit clean CTEs.

If smtplib later grows the ability to accept bytes, BytesGenerator can be used 
to feed it.  I've clarified that BytesGenerator does not do the 7bit transform, 
and made some other doc tweaks.

--
Added file: http://bugs.python.org/file19160/email_parse_bytes8.diff

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

If you can supply a full patch before the end of the month, we should be able 
to get this in for 3.2beta1 (currently scheduled for 31 October)

--

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

Actually, the singleton idea isn't a bad one, but I'd go one step further and 
skip the factory function as well. So change that to be:

class NullContext():
   ... # as per nullcontext in my last message

nullcontext = NullContext()

(with the example in the docstring adjusted accordingly)

--

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

That is what we are using now, but I think a contextlib.null() would be useful 
to others, i.e. that its use is a useful idiom to adopt.  Specifically I would 
like to discourage the "duplicated code" idiom from the report, which I've seen 
all too often.

The "closing" constructor is also trivial to define, but it's there for 
convenience and to promote the use of with statement over try/finally 
boilerplate.  The same goes here: you don't miss the null context manager when 
you don't have it; you invent other solutions.  But when it's already 
available, it's an elegant pattern.  In my experience, if they have to define 
it to get it, most people won't bother with the pattern and will retain less 
elegant solutions.

--

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

The difference here is the one pointed out in the original post: for a 
function, you usually only care about having a value, so if you don't want to 
call it, you can just swap in a None value instead. If you need an actual 
callable, then "lambda:None" fits the bill.

The with statement isn't quite so forgiving. You need a genuine context manager 
in order to preserve the correct structure in the calling code. It isn't 
intuitively obvious how to do that easily. While not every 3-line function 
needs to be in the standard library, sometimes they're worth including to aid 
discoverability as much as anything else.

However, I don't see the point in making it a singleton and the name should 
include the word "context" so it doesn't becoming ambiguous when referenced 
without the module name (there's a reason we went with 
contextlib.contextmanager over contextlib.manager).

Something like:

class nullcontext():
"""No-op context manager, executes block without doing any additional 
processing.

Used as a standin if a particular block of code is only sometimes
used with a normal context manager:

  with optional_cm or nullcontext():
  # Perform operation, using the specified CM if one is given
"""
def __enter__():
pass
def __exit__(*exc_info):
pass

--

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Generator converts 8bit bodies into 7bit bodies by applying an
> appropriate 7bit CTE.  The reason it does this is that the output of
> Generator will often be passed to some other Python library function
> (most often smtplib) that can only handle ASCII unicode input.

What do you mean, ASCII *unicode* input? Any low-level network library
should accept bytes when arbitrary data is possible.

Enforcing 7-bit means things like binary attachments can grow larger for
no real reason. Also, raw message bodies become less readable (which
obviously is very minor issue).

> The statement about string input and output is a description of email
> *5.0*, the existing email package in 3.0 and 3.1, before my patch.
> The differences between 4.0 and 5.0 were never previously added to the
> docs, so I had to add them in order to then describe the differences
> between 5.0 and 5.1.

Ah, my bad. Sorry.

--

___
Python tracker 

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-08 Thread R. David Murray

R. David Murray  added the comment:

Generator converts 8bit bodies into 7bit bodies by applying an appropriate 7bit 
CTE.  The reason it does this is that the output of Generator will often be 
passed to some other Python library function (most often smtplib) that can only 
handle ASCII unicode input.  That is, Generator now produces a 7bit clean 
message that can be put on the wire by encoding it to ascii.  This means that 
RFC-compliant bytes input can be successfully transmitted onward using 
Generator and smtplib, whereas if Generator produced non-ASCII unicode it would 
not be possible to pass a message with an 8bit CTE on to smtplib.

The statement about string input and output is a description of email *5.0*, 
the existing email package in 3.0 and 3.1, before my patch.  The differences 
between 4.0 and 5.0 were never previously added to the docs, so I had to add 
them in order to then describe the differences between 5.0 and 5.1.

--

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> @Antoine: it is true that a null context manager can be easily
> defined, but it does requires a separate generator definition, often
> repeated in different modules.  This is markedly less elegant than
> just using contextlib.null() in an expression.

But you can use mymodule.null() where mymodule is a module gathering
common constructs of yours.

--

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

Thank you for your comments.

@Michael: I will of course write tests and documentation if there is indication 
that the feature will be accepted for stdlib.

@Antoine: it is true that a null context manager can be easily defined, but it 
does requires a separate generator definition, often repeated in different 
modules.  This is markedly less elegant than just using contextlib.null() in an 
expression.

I'm not acquainted with the history of identity function requests, but note 
that the identity function can be defined as an expression, using simply lambda 
x: x.  The equivalent expression that evaluates to a null context manager is 
markedly more convoluted, as shown in my report.

@Éric: The Null/_null/null distinction is an optimization that avoids creating 
new objects for something that is effectively a singleton.  It would be 
perfectly reasonable to define contextlib.null as Antoine did, but, this being 
stdlib, I wanted the implementation to be as efficient as (reasonably) possible.

--

___
Python tracker 

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



[issue10051] distutils fail to install unicode-encoded files with POSIX locale

2010-10-08 Thread Michał Górny

New submission from Michał Górny :

I was reported an issue where the user was unable to install my package [1] 
using python3.1. I was able to guess the issue comes from locale being set to 
POSIX and reproduce it.

It seems that the reasons are utf8-encoded characters in the installed script 
file. All the project files carry encoding declaration as per PEP-0263. They 
install fine with python2 but fail both with 3.1 and 3.2.

I think the build system should be locale-agnostic, and work correctly even if 
LC_ALL=C. If it's necessary to use text mode for scripts, I think a similar 
encoding guessing method should be used as in python itself.

I'm attaching a complete build log (for multiple versions of Python). Below I'm 
repasting the backtrace:

Traceback (most recent call last):
  File "setup.py", line 35, in 
'Topic :: System :: Installation/Setup'
  File "/usr/lib64/python3.1/distutils/core.py", line 149, in setup
dist.run_commands()
  File "/usr/lib64/python3.1/distutils/dist.py", line 919, in run_commands
self.run_command(cmd)
  File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
cmd_obj.run()
  File "/usr/lib64/python3.1/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
  File "/usr/lib64/python3.1/distutils/cmd.py", line 315, in run_command
self.distribution.run_command(command)
  File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
cmd_obj.run()
  File "/usr/lib64/python3.1/distutils/command/build_scripts.py", line 51, in 
run
self.copy_scripts()
  File "/usr/lib64/python3.1/distutils/command/build_scripts.py", line 83, in 
copy_scripts
first_line = f.readline()
  File "/usr/lib64/python3.1/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 127: 
ordinal not in range(128)

[1] http://github.com/mgorny/smart-live-rebuild

--
assignee: tarek
components: Distutils
files: build.log
messages: 118188
nosy: eric.araujo, mgorny, tarek
priority: normal
severity: normal
status: open
title: distutils fail to install unicode-encoded files with POSIX locale
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file19159/build.log

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

@contextlib.contextmanager
def null():
yield

Do we really need to add this to the stdlib?
Previous proposals to add an "identity function" or "no-op function" have 
always be refused. This one seems even less useful.

--
nosy: +pitrou

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Éric Araujo

Éric Araujo  added the comment:

I also find the Null/_null/null affair confusing.

--
nosy: +eric.araujo
stage:  -> patch 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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread STINNER Victor

STINNER Victor  added the comment:

About your patch:
 - __enter__() might return self instead of None... i don't really know which 
choice is better. "with Null() as x:" works in both cases
 - __exit__() has no result value, "pass" is enough
 - I don't like "Null" name, I prefer "Noop" (NoOperation, NoOp, ...) or 
something else

--
nosy: +haypo

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Michael Foord

Michael Foord  added the comment:

Patch is missing tests and documentation.

--

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread Michael Foord

Michael Foord  added the comment:

+1

Looks like a reasonable use case.

--
nosy: +michael.foord, ncoghlan

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2010-10-08 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Add the null context manager to contextlib -> Add a "no-op" (null) 
context manager to contextlib

___
Python tracker 

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



[issue10050] urllib.request still has old 2.x urllib primitives

2010-10-08 Thread Antoine Pitrou

New submission from Antoine Pitrou :

3.x urllib.request still has a lot of stuff inherited from 2.x urllib: 
URLopener, FancyURLopener, the urlretrieve implementation (perhaps others?).

Ideally, urlretrieve should be reimplemented using urlopen or build_opener, and 
the other stuff deprecated.

--
assignee: orsenthil
components: Library (Lib)
messages: 118182
nosy: jhylton, orsenthil, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: urllib.request still has old 2.x urllib primitives
versions: 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



[issue10049] Add the null context manager to contextlib

2010-10-08 Thread Hrvoje Nikšić

Changes by Hrvoje Nikšić :


--
components: +Library (Lib)
type:  -> feature request

___
Python tracker 

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



[issue10049] Add the null context manager to contextlib

2010-10-08 Thread Hrvoje Nikšić

New submission from Hrvoje Nikšić :

I find that I frequently need the "null" (no-op) context manager.  For example, 
in code such as:

with transaction or contextlib.null():
...

Since there is no easy expression to create a null context manager, we must 
resort to workarounds, such as:

if transaction:
with transaction:
... code ...
else:
... duplicated code ...

(with the usual options of moving the duplicated code to a function—but still.)

Or by creating ad-hoc null context managers with the help of 
contextlib.contextmanager:

if transaction is None:
transaction = contextlib.contextmanager(lambda: iter([None])()
with transaction:
...

Adding a "null" context manager would be both practical and elegant.  I have 
attached a patch for contextlib.py

--
files: fl
messages: 118181
nosy: hniksic
priority: normal
severity: normal
status: open
title: Add the null context manager to contextlib
Added file: http://bugs.python.org/file19158/fl

___
Python tracker 

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



[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-10-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

I've been pondering the idea of adopting a more conservative approach here, 
since there are actually two issues:

1. Properly quoted URLs are transferred as pure 7-bit ASCII (due to 
percent-encoding of everything else). However, most of the manipulation 
functions in urllib.parse can't handle bytes at all, even data that is 7-bit 
clean.

2. In the real world, just like email, URLs will often contain unescaped (or 
incorrectly escaped) characters. So assuming the input is actually pure ASCII 
isn't necessarily a valid assumption.

I'm wondering, since encoding (aside from quoting) isn't urllib.parse's 
problem, maybe what I should be looking at doing is just handling bytes input 
via an implicit ascii conversion in strict mode (and then conversion back when 
the processing is complete).

Then bytes manipulation of properly quoted URLs will "just work", while 
improperly quoted URLs will fail noisily. This isn't like email or http where 
the protocol contains encoding information that the library should be trying to 
interpret - we're just being given raw bytes without any context information.

If any application wants to be more permissive than that, it can do its own 
conversion to a string and then use the text-based processing. I'll add 
"encode" methods to the result objects to make it easy to convert their 
contents from str to bytes and vice-versa.

I'll factor out the implicit encoding/decoding such that if we decide to change 
the model later (ASCII-strict, ASCII-escape, latin-1) it shouldn't be too 
difficult.

--

___
Python tracker 

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



[issue10048] urllib.request documentation confusing

2010-10-08 Thread Antoine Pitrou

New submission from Antoine Pitrou :

The urllib.request documentation intermingles old 2.x urllib (FancyURLopener, 
etc.) with urllib2-inherited (*Handler, build_opener, etc.) primitives without 
making any distinction. This makes it rather confusing for the reader to figure 
out which ones to use.

Ideally, the use of the old primitives should also be discouraged.

--
assignee: d...@python
components: Documentation
messages: 118179
nosy: d...@python, orsenthil, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: urllib.request documentation confusing
versions: Python 3.1, Python 3.2

___
Python tracker 

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



[issue9003] urllib.request and http.client should allow certificate checking

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is the API addition I would suggest for the http.client module:

Add two new keyword arguments `context` and `check_hostname` to 
HTTPSConnection; `context` would allow to pass a SSLContext instance for 
certificate checking and other options (default None, meaning no checking); 
`check_hostname` would specify whether to check the hostname against the URL 
(default to check only if context is present and context.verify_mode != 
CERT_NONE).

Here is the API addition I would suggest for the urllib.request module:

- Add constructor arguments `context` and `check_hostname` to HTTPSHandler. 
They will be passed to the underlying HTTPSConnection.

- Add `ssl_ca_file` and `ssl_ca_path` arguments to the high-level function 
urlopen(); if at least one of them is present, a custom opener with a custom 
HTTPSHandler will be created, mandating the checking of server certificates

--
resolution: accepted -> 

___
Python tracker 

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



[issue10040] GZipFile failure on large files

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Can you show a snippet of the code (or descrive it in detail) that "processes" 
the GzipFile? Right now it's not obvious which operations you are doing.

--
components: +Library (Lib) -Windows
nosy: +pitrou
stage: unit test needed -> 
versions: +Python 3.1, Python 3.2

___
Python tracker 

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I wanted to go forward with this and so I've committed the patch in r85321. If 
you're concerned about the lack of support for IP addresses, you can open a new 
issue (and even provide a patch!). Thank you.

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



[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There are a couple of things I don't understand:

+* :class:`~email.generator.Generator` will convert message bodies that
+  have a :mailheader:`ContentTransferEncoding` of 8bit and a known charset to
+  instead have a :mailheader:`CotnentTransferEncoding` of ``QuotedPrintable``.

Why so?

+* All operations are on unicode strings.  Text inputs must be strings,
+  text outputs are strings.

This is a rather strange statement given that you are adding bytes-consuming 
and bytes-producing functions.

--

___
Python tracker 

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



[issue1708] improvements for linecache

2010-10-08 Thread umaxx

umaxx  added the comment:

@BreamoreBoy: what do you man by taking this forward?

The patch is there. Since three years now, no one else seems to be interested.

I personally do not have any interest in this anymore as I just do not use 
Python for this stuff anymore since a long time now too, so I do not care if 
Python linecache is going to be improved or not.

IMHO, such things like slow linecache could be the reason for people to switch 
to languages with faster String-Operations and Caches like Perl.

If you like just close the bug report or commit the patch or whatever - I do 
not care anymore.

--

___
Python tracker 

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



[issue10047] python-2.6.6 coredump running newspipe

2010-10-08 Thread Stefan Krah

Stefan Krah  added the comment:

Can you reproduce it by executing this?

>>> format(0.15256118774414062, ".2f")

--
nosy: +skrah

___
Python tracker 

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



[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ah, sorry for closing, then. You are right, this is a genuine issue.

--

___
Python tracker 

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



[issue9978] Better wait for slow machine in test_os (_kill_with_event)

2010-10-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I modified the patch slightly to avoid potential hang.

--

___
Python tracker 

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



[issue9978] Better wait for slow machine in test_os (_kill_with_event)

2010-10-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Thank you. Committed in r85315(py3k), r85318(release27-maint).

--
status: open -> closed

___
Python tracker 

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



[issue10040] GZipFile failure on large files

2010-10-08 Thread Robert Rohde

Robert Rohde  added the comment:

It's Windows 7 Ultimate (64-bit) on a very high end system.

I don't think it would be very practical to distribute a 2 GB test file.  
Though I might be able to get it to a couple people if someone wanted to really 
study the issue.

Though if it is an integer overflow (or something like that), then I would 
suspect that GZipFile would show corruption most of the time once the files got 
large enough.  For example, it might occur for all files expanding to larger 
than 2^32 bytes (4 GB).  (That's just speculation, I haven't tested it except 
to note that it failed the very first time I tried to use a file this large.)

Perhaps someone familiar with the code could look for places where integers 
might overflow?

--

___
Python tracker 

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



[issue10019] json.dumps with indent = 0 not adding newlines

2010-10-08 Thread Bob Ippolito

Bob Ippolito  added the comment:

I just applied a version of this patch with corrections to the tests here:
http://code.google.com/p/simplejson/source/detail?r=234

--

___
Python tracker 

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



[issue10019] json.dumps with indent = 0 not adding newlines

2010-10-08 Thread Bob Ippolito

Bob Ippolito  added the comment:

The test also repeats an equivalent dict to "h" in the check function.

--

___
Python tracker 

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



[issue10019] json.dumps with indent = 0 not adding newlines

2010-10-08 Thread Bob Ippolito

Bob Ippolito  added the comment:

The test in the patch assumes a specific iteration order for the dict "h", 
changing the dict to have only one key would fix this problem with the test.

--

___
Python tracker 

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