[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Errors should not pass silently :-)

Given the buggy behavior, we have several options including just removing the 
implicit conversion and going back to bytes only.

--

___
Python tracker 

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



[issue9333] Expose a way to enable os.symlink on Windows

2010-12-27 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The patch looks good, I only have stylistic remarks:
- We normally don't use windows-specific types in CPython code. Please use int 
instead of BOOL. And C variables are usually lowercase, even module globals. I 
suggest something like "static int win32_can_symlink;"
- the enable_symlink() function should be "static" as well.

--

___
Python tracker 

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

At this point a feature change seems unlikely, but it's not too late to emit a 
DeprecationWarning.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue10786] unittest.TextTextRunner does not respect redirected stderr

2010-12-27 Thread cooyeah

New submission from cooyeah :

The constructor of TextTestRunner class looks like:
def __init__(self, stream=sys.stderr, descriptions=1, verbosity=1)

Since the default parameter is evaluated only once, if sys.stderr is redirected 
later, the test would still use the old stderr when it was first initialized.

--
components: Tests
messages: 124764
nosy: cooyeah
priority: normal
severity: normal
status: open
title: unittest.TextTextRunner does not respect redirected stderr
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue10784] os.getpriority() and os.setpriority()

2010-12-27 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

Patch looks good, just one thing:

In setpriority(), it should be possible to use the Py_RETURN_NONE; macro 
instead of INCREFing manually.

--
components: +Extension Modules
nosy: +rosslagerwall
type:  -> feature request

___
Python tracker 

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



[issue5423] Exception raised when attempting to call set_charset on an email.mime.multipart once sub-parts have been attached

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

Since set_charset should not be valid on a multipart, I don't see a reason to 
have a separate issue for the post-attach case.

Also, although I haven't searched the RFCs, I don't think we can assume that 
set_chaset is valid only on text parts, so I don't think the patch will work as 
a solution.

--
resolution:  -> duplicate
stage: patch review -> committed/rejected
status: open -> closed
superseder:  -> Possible to set invalid Content-Transfer-Encoding on 
email.mime.multipart.MIMEMultipart

___
Python tracker 

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



[issue1823] Possible to set invalid Content-Transfer-Encoding on email.mime.multipart.MIMEMultipart

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

As far as I can tell it is simply wrong per-RFC to put a charset parameter on a 
mulitpart content-type.  So I think this should, indeed, raise an error on the 
Multipart subtype.

If someone sets any charset, the CTE is set wrong.  So code that sets charset 
is already broken, even though tolerant mailers will accept the resulting 
message (but some mailers won't, as described in this issue).

So, I think set_charset on MIMEMultipart should be deprecated and turned into a 
no-op in 3.2.

--
keywords: +easy
nosy: +georg.brandl
stage:  -> needs patch
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



[issue8009] email.parser.Parser is inefficient with large strings

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

Parser is a legacy API, and message_from_string (which uses it) is just a 
convenience function.  If performance is an issue for your application, call 
feedparser directly and optimize the feeding to suit your application.

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



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

2010-12-27 Thread Jacques Grove

Jacques Grove  added the comment:

Another re.compile performance issue (I've seen a couple of others, but I'm 
still trying to simplify the test-cases):

re.compile("(?ui)(a\s?b\s?c\s?d\s?e\s?f\s?g\s?h\s?i\s?j\s?k\s?l\s?m\s?n\s?o\s?p\s?q\s?r\s?s\s?t\s?u\s?v\s?w\s?y\s?z\s?a\s?b\s?c\s?d)")

completes in around 0.01s on my machine using Python 2.6.5 standard regex 
library, but takes around 12 seconds using issue2636-20101228.zip

--

___
Python tracker 

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

>>> struct.pack('2s', 'ha')
   b'ha'
   >>> struct.pack('2s', 'hé')
   b'h\xc3'
   >>> struct.pack('3s', 'hé')
   b'h\xc3\xa9'

That looks like a *buggy* api to me, too.  I don't see how we can let that 
stand.

--

___
Python tracker 

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



[issue6210] Exception Chaining missing method for suppressing context

2010-12-27 Thread Matthew Barnett

Matthew Barnett  added the comment:

Regarding syntax, I'm undecided between:

raise with new_exception

and:

raise new_exception with caught_exception

I think that the second form is clearer:

try:
...
exception SomeException as ex:
raise SomeOtherException() with ex

(I'd prefer 'with' to Steven's 'from') but the first form doesn't force you to 
provide a name:

try:
...
exception SomeException:
raise with SomeOtherException()

and the syntax also means that you can't chain another exception like this:

try:
...
exception SomeException as ex:
raise SomeOtherException() with YetAnotherException()

although perhaps Python should just rely on the programmer's good judgement. :-)

--

___
Python tracker 

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



[issue3080] Full unicode import system

2010-12-27 Thread STINNER Victor

Changes by STINNER Victor :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue3080] Full unicode import system

2010-12-27 Thread STINNER Victor

STINNER Victor  added the comment:

Issue #10785 prepares the work for this issue: store input filename as a 
unicode string, instead of a byte string, in the parser.

--

___
Python tracker 

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



[issue10785] parser: store the filename as an unicode object

2010-12-27 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file20180/parser_filename_obj.patch

___
Python tracker 

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



[issue10785] parser: store the filename as an unicode object

2010-12-27 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file20179/parse_filename_obj.patch

___
Python tracker 

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



[issue10785] parser: store the filename as an unicode object

2010-12-27 Thread STINNER Victor

New submission from STINNER Victor :

The Python parser stores the filename as a byte string. But it decodes the 
filename on error because most Python functions now use unicode strings. 
Instead of decoding the filename at error, which may raise a new error, I 
propose to decode the filename on the creation of the parser object and only 
store the filename as unicode.

This issue would prepare the last part of the full unicode support (#3080).

--
components: Interpreter Core, Unicode
files: parse_filename_obj.patch
keywords: patch
messages: 124755
nosy: haypo
priority: normal
severity: normal
status: open
title: parser: store the filename as an unicode object
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file20179/parse_filename_obj.patch

___
Python tracker 

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



[issue10784] os.getpriority() and os.setpriority()

2010-12-27 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue9333] Expose a way to enable os.symlink on Windows

2010-12-27 Thread Brian Curtin

Brian Curtin  added the comment:

(hit enter too soon, sorry)

The patch makes os.symlink always available on Windows machines, but it will 
only have an effect when privileged. Windows XP and Windows 2003 will still 
receive NotImplementedError, as the underlying calls aren't available there. On 
Vista and 7 for non-privileged users, OSError will be raised.

--

___
Python tracker 

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



[issue9333] Expose a way to enable os.symlink on Windows

2010-12-27 Thread Brian Curtin

Brian Curtin  added the comment:

Here's a patch. I think this works more like what you guys are looking for. 
Tests pass on Windows 7 and I checked it on a Mac to be sure, and it's good 
there too.

--
Added file: http://bugs.python.org/file20178/issue9333_v3.diff

___
Python tracker 

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



[issue10784] os.getpriority() and os.setpriority()

2010-12-27 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Forgot to attach the patch.

--
Added file: http://bugs.python.org/file20177/getsetpriority.patch

___
Python tracker 

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



[issue10784] os.getpriority() and os.setpriority()

2010-12-27 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

After having implemented a similar thing in psutil ( 
http://code.google.com/p/psutil/issues/detail?id=142 ) I decided to contribute 
a patch for Python which exposes getpriority() and setpriority() POSIX calls in 
the os module.

They can be used to get/set process niceness/priority in a fashion similar to 
os.nice() but extended to *all* processes instead of just os.getpid():
http://linux.die.net/man/2/setpriority

--
assignee: giampaolo.rodola
keywords: patch
messages: 124751
nosy: giampaolo.rodola, loewis, pitrou
priority: normal
severity: normal
status: open
title: os.getpriority() and os.setpriority()
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



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

2010-12-27 Thread Matthew Barnett

Matthew Barnett  added the comment:

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

Sorry for the delay, the fix took me a bit longer than I expected. :-)

--
Added file: http://bugs.python.org/file20176/issue2636-20101228.zip

___
Python tracker 

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



[issue6210] Exception Chaining missing method for suppressing context

2010-12-27 Thread Ethan Furman

Ethan Furman  added the comment:

> There is already support for this in the traceback module (see the
> "chain" parameter to various funcs).

I'm not sure how that's going to help as I don't want my library code to be 
responsible for printing out exceptions, I just want them to print reasonably 
-- and it seems very unreasonable to have the exception I'm converting /from/ 
show up in the traceback.

--

___
Python tracker 

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread STINNER Victor

STINNER Victor  added the comment:

This "feature" was introduced in a big commit from Guido van Rossum (made 
before Python 3.0): r55500. The changelog is strange because it starts with 
"Make test_zipfile pass. The zipfile module now does all I/O in binary mode 
using bytes." but ends with "The _struct needed a patch to support bytes, str8 
and str for the 's' and 'p' formats.". Why was _struct patched at the same time?

Implicit conversion bytes and str is a very bad idea, it is the root of all 
confusion related to Unicode. The experience with Python 2 demonstrated that it 
should be changed, and it was changed in Python 3.0. But "Python 3.0" is a big 
project, it has many modules. Some modules were completly broken in Python 3.0, 
it works better with 3.1, and we hope that it will be even better with 3.2.

Attached patch removes the implicit conversion for 'c', 's' and 'p' formats. I 
did a similar change in ctypes, 5 months ago: issue #8966.

If a program written for Python 3.1 fails because of the patch, it can use 
explicit conversion to stay compatible with 3.1 and 3.2 (patched). I think that 
it's better to use explicit conversion.

Implicit conversion on 'c' format is really weird and it was not documented 
correctly: the note (1) is attached to "b" format, not to the "c" format. 
Example:

   >>> struct.pack('c', 'é')
   struct.error: char format requires bytes or string of length 1
   >>> len('é')
   1

There is also a length issue with the s format: struct.pack() truncates unicode 
string to a length in bytes, not in character, it is confusiong.

  >>> struct.pack('2s', 'ha')
   b'ha'
   >>> struct.pack('2s', 'hé')
   b'h\xc3'
   >>> struct.pack('3s', 'hé')
   b'h\xc3\xa9'

Finally, I don't like implicit conversion from unicode to bytes on pack, 
because it's not symmetrical.

   >>> struct.pack('3s', 'hé')
   b'h\xc3\xa9'
   >>> struct.unpack('3s', b'h\xc3\xa9')
   (b'h\xc3\xa9',)

(str -> pack() -> unpack() -> bytes)

--
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file20175/struct.patch

___
Python tracker 

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



[issue6210] Exception Chaining missing method for suppressing context

2010-12-27 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> A person writing an exception handler should have control over what
> the user sees.

There is already support for this in the traceback module (see the
"chain" parameter to various funcs).

--

___
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-12-27 Thread Jacques Grove

Jacques Grove  added the comment:

Testing issue2636-20101224.zip:

Nested modifiers seems to hang the regex compilation when used in a 
non-capturing group e.g.:

re.compile("(?:(?i)foo)")

or

re.compile("(?:(?u)foo)")


No problem on stock Python 2.6.5 regex engine.

The unnested version of the same regex compiles fine.

--

___
Python tracker 

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread David Beazley

David Beazley  added the comment:

Actually, here's another one of my favorite examples:

>>> import struct
>>> struct.pack("s","\xf1")
b'\xc3'
>>> 

Not only does this not encode the correct value, it doesn't even encode the 
entire UTF-8 encoding (just the first byte of it).   Like I said, pity the poor 
bastard who puts something that in their code and they spend the whole day 
trying figure out where in the hell '\xf1' magically got turned into '\xc3'.

--

___
Python tracker 

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



[issue10780] Fix filename encoding in PyErr_SetFromWindowsErrWithFilename() (and PyErr_SetExcFromWindowsErrWithFilename())

2010-12-27 Thread STINNER Victor

STINNER Victor  added the comment:

Fixed by r87519.

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread David Beazley

David Beazley  added the comment:

I encountered this issue is in the context of distributed 
computing/interprocess communication involving binary-encoded records (and 
encoding/decoding such records using struct). At its core, this is all about 
I/O--something where encodings and decoding matter a lot.  Frankly, it was 
quite surprising that a unicode string would silently pass through struct and 
turn into bytes.  IMHO, the fact that this is even possible encourages a sloppy 
usage of struct that favors programming convenience over correctness--something 
that's only going to end badly for the poor soul who passes non-ASCII 
characters into struct without knowing it. 

A default encoding might be okay as long as it was set to something like ASCII 
or Latin-1 (not UTF-8).  At least then you'd get an encoding error for 
characters that don't fit into a byte.

--

___
Python tracker 

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

A possible answer to "why is this encoding at all" was probably to make it 
easier to transition code from python 2.x where strings were usually ascii and 
it would make no difference in output if encoded in utf-8.  The 2-to-3 fixer 
was good at handling name changes but not bytes/text issues.  That is just a 
guess at what the developer may have been thinking.

--

___
Python tracker 

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Many of these kind of "decisions" were made quickly, haphazardly, and with 
almost no discussion and were made by contributors who were new to Python core 
development (no familiar with the API norms).

Given the rats nest of bytes/text problems in Py3.0 and Py3.1, I think it is 
fair game to fix it now.  The APIs have not been shaken-out and battle-tested 
through wide-spread adoption, so it was fair to expect that the first 
experienced user to come along would find these rough patches.  

ISTM, this should get fixed.  The most innocuous way to do it is to add a 
warning for the implicit conversion.  That way, any existing 3.x code (probably 
precious little) would continue to run.  Another option is to just finish the 
job by adding an encoding parameter that defaults to utf-8.

--

___
Python tracker 

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread David Beazley

David Beazley  added the comment:

Why is it even encoding at all?  Almost every other part of Python 3 forces you 
to be explicit about bytes/string conversion.  For example:

struct.pack("10s", x.encode('utf-8'))

Given that automatic conversion is documented, it's not clear what can be done 
at this point.  However, there are very few other parts of Python 3 that 
perform implicit string-byte conversions like this (at least that I know of 
off-hand).

--

___
Python tracker 

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



[issue8719] buildbot: segfault on FreeBSD (signal 11)

2010-12-27 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue6210] Exception Chaining missing method for suppressing context

2010-12-27 Thread Matthew Barnett

Changes by Matthew Barnett :


--
nosy: +mrabarnett

___
Python tracker 

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Can we at least offer an optional choice of encoding?

--
nosy: +rhettinger

___
Python tracker 

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



[issue6210] Exception Chaining missing method for suppressing context

2010-12-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I agree with the OP that we need a way to either suppress chaining or have it 
turned-off by default.  A person writing an exception handler should have 
control over what the user sees.

--
nosy: +rhettinger

___
Python tracker 

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



[issue8719] buildbot: segfault on FreeBSD (signal 11)

2010-12-27 Thread David Bolen

David Bolen  added the comment:

Wouldn't that module have to be put into the actual source tree, since the 
tests run beneath the interpreter/libraries that are built for the test?

That may be what you meant, but "installed on this host" made me think I could 
do something external on the buildbot which I don't think would work given that 
the module has to be called from within the tests themselves?

-- David

--

___
Python tracker 

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



[issue10782] Not possible to cross-compile due to poor detection of %lld support in printf

2010-12-27 Thread Roumen Petrov

Roumen Petrov  added the comment:

Use config.cache to set ac_cv_have_long_long_format

--
nosy: +rpetrov

___
Python tracker 

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



[issue6210] Exception Chaining missing method for suppressing context

2010-12-27 Thread Ethan Furman

Ethan Furman  added the comment:

I like MRAB's suggestion best:

MRAB wrote:
> Suggestion: an explicit 'raise' in the exception handler excludes the
> context, but if you want to include it then 'raise with'. For example:
>
> # Exclude the context
> try:
> command_dict[command]()
> except KeyError:
> raise CommandError("Unknown command")
>
> # Include the context
> try:
> command_dict[command]()
> except KeyError:
> raise with CommandError("Unknown command")

I think we can even strike off the verbiage "in the exception handler"... that 
way, raise always does the same thing -- raise KeyError will raise a KeyError, 
always, not sometimes a KeyError and sometimes a KeyError nested in a 
WhatEverError.

--

___
Python tracker 

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



[issue4212] email.LazyImporter does not use absolute imports

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

LazyImporter isn't used in Python3.  Without someone motivated to propose a 
patch this isn't going to be changed, so I'm closing the issue.

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

But clearly intentional, and now enshrined in released code.

--
nosy: +mark.dickinson, r.david.murray
resolution:  -> invalid
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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread David Beazley

David Beazley  added the comment:

Hmmm. Well, the docs seem to say that it's allowed and that it will be encoded 
as UTF-8.  

Given the treatment of Unicode/bytes elsewhere in Python 3, all I can say is 
that this behavior is rather surprising.

--

___
Python tracker 

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



[issue10778] decoding_fgets() (tokenizer.c) decodes the filename from the wrong encoding

2010-12-27 Thread STINNER Victor

STINNER Victor  added the comment:

Fixed by r87518.

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread David Beazley

David Beazley  added the comment:

Note: This is what happens in Python 2.6.4:

>>> import struct
>>> struct.pack("10s",u"Jalape\u00f1o")
Traceback (most recent call last):
  File "", line 1, in 
struct.error: argument for 's' must be a string
>>>

--

___
Python tracker 

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



[issue7056] regrtest runtest_inner calls findtestdir unnecessarily

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

Committed (redid, actually) 2nd patch in r87516.  I may or may not backport it.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions:  -Python 2.6, 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



[issue10779] Change filename encoding to FS encoding in PyErr_WarnExplicit()

2010-12-27 Thread STINNER Victor

STINNER Victor  added the comment:

Fixed by r87517.

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



[issue10783] struct.pack() and Unicode strings

2010-12-27 Thread David Beazley

New submission from David Beazley :

Is the struct.pack() function supposed to automatically encode Unicode strings 
into binary?  For example:

>>> struct.pack("10s","Jalape\u00f1o")
b'Jalape\xc3\xb1o\x00'
>>>

This is Python 3.2b1.

--
components: Library (Lib)
messages: 124727
nosy: dabeaz
priority: normal
severity: normal
status: open
title: struct.pack() and Unicode strings
type: behavior
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



[issue9893] Usefulness of the Misc/Vim/ files?

2010-12-27 Thread Brett Cannon

Brett Cannon  added the comment:

But if you have a local copy of the Vim files from the community what is 
preventing you from editing them for new keywords and sending a patch to the 
maintainer so that the rest of the community is brought up to speed that much 
faster?

I suspect that not many people beyond core devs use the Misc/Vim file while 
more people in the community use the vim.org files.

--

___
Python tracker 

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



[issue6210] Exception Chaining missing method for suppressing context

2010-12-27 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +stoneleaf

___
Python tracker 

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



[issue8719] buildbot: segfault on FreeBSD (signal 11)

2010-12-27 Thread STINNER Victor

STINNER Victor  added the comment:

https://github.com/haypo/faulthandler/wiki can be tried on this buildbot to get 
more information about this issue. But the module have to be installed on this 
host.

--

___
Python tracker 

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



[issue1379416] email.Header encode() unicode P2.6

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

Committed to 2.7 in r87515.  On second thought there's no reason to forward 
port the test because Python3 doesn't have the equivalent type-promotion issues.

--
nosy:  -BreamoreBoy
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
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



[issue10753] request_uri method of wsgiref module does not support RFC1808 params.

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

If the RFC says they are safe it seems like we should include them in the safe 
list.

--

___
Python tracker 

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



[issue9298] binary email attachment issue with base64 encoding

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


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



[issue9967] encoded_word regular expression in email.header.decode_header()

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


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



[issue8769] Straightforward usage of email package fails to round-trip

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


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



[issue1025395] email.Utils.parseaddr fails to parse valid addresses

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


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



[issue795081] email.Message param parsing problem II

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.3 -Python 2.7

___
Python tracker 

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



[issue634412] RFC 2112 in email package

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue740495] API enhancement: poplib.MailReader()

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue10782] Not possible to cross-compile due to poor detection of %lld support in printf

2010-12-27 Thread Ben Gamari

New submission from Ben Gamari :

Configure.in assumes that %lld is not supported by printf if cross-compiling. 
This causes build errors in pyport.h,

In file included from Include/Python.h:58:0,
 from Parser/parser.c:8:
Include/pyport.h:243:13: error: #error "This platform's pyconfig.h needs to 
define PY_FORMAT_LONG_LONG"
...

What is one supposed to do about this short of changing the configure script to 
assume support by default.

--
components: Build
messages: 124722
nosy: bgamari
priority: normal
severity: normal
status: open
title: Not possible to cross-compile due to poor detection of %lld support in 
printf
type: compile error
versions: Python 2.7

___
Python tracker 

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



[issue10753] request_uri method of wsgiref module does not support RFC1808 params.

2010-12-27 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I agree that semi-colon separated segments (params) can be in PATH portion of 
the url. I was trying to find out, how a path;params would be useful in wsgiref 
request_uri's PATH_INFO variable , wherein I assumed PATH_INFO should be a 
file-system path or a method name.

After doing a bit of study, I find that ';' can be part of PATH_INFO in wsgiref 
compliant servers. I find a couple of bugs related to issues where ';' in 
PATH_INFO is not handled properly in other systems - http://bit.ly/g4UHhX

So, I think, we can have ';' as safe character so that it is prevented from 
quoting.

Also, RFC 3986 in Section 3.3 says that ';' '=' and ',' can be considered safe 
in the PATH component. Should we include those too?

--

___
Python tracker 

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



[issue6533] Make test_xmlrpc_net functional in the absence of time.xmlrpc.com

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

The skip was added and the service is back and has been for a while, so I'm 
closing this, but see also issue 6027.

--
resolution:  -> out of date
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



[issue10764] sysconfig and alternative implementations

2010-12-27 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Yes that's what we said we would do, and was the second step after the 
extraction of sysconfig from distutils.

--

___
Python tracker 

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



[issue1043706] External storage protocol for large email messages

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue9864] email.utils.{parsedate, parsedate_tz} should have better return types

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue1162477] Parsing failures in parsedate_tz

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

Somehow I missed this in my pre-beta feature request review :(

--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue10764] sysconfig and alternative implementations

2010-12-27 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue3244] multipart/form-data encoding

2010-12-27 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue1243730] Big speedup in email message parsing

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

Since this is a performance hack and is considerably invasive of the feedparser 
code (and needs updating), I'm deferring it to 3.3.

--
stage: unit test needed -> patch review
versions: +Python 3.3 -Python 2.7, 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



[issue10781] minidom Node.writexml method doesn't manage encoding parameter correctly

2010-12-27 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> The last sentence has nothing to do with the report, it was just a general 
> remark that 
> it would be nice if minidom could support unicode string directly.

minidom most certainly supports Unicode directly. All element names,
attribute names, and text nodes carry Unicode objects.

> Should I send a mail to d...@python.org to report the doc issue, 
> or this one is sufficient ?

This one is sufficient.

--

___
Python tracker 

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



[issue1685453] email package should work better with unicode

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

Now that we are primarily focused on Python3 development, collecting "unicode" 
issues is not really all that useful (at least not to me, and I'm currently 
doing the email maintenance), so I'm closing this.  All the relevant issues are 
assigned to me anyway, so I'll be dealing with them by and by.

--
dependencies:  -Add decode_header_as_string method to email.utils, Add utf8 
alias for email charsets, Unicode email address helper, email package and 
Unicode strings handling, email.Header (via add_header) encodes non-ASCII 
content incorrectly, email.Header encode() unicode P2.6, email.header unicode 
fix, email.parser: impossible to read messages encoded in a different encoding, 
email/base64mime.py cannot work, email/charset.py convert() patch, smtplib is 
broken in Python3, unicode in email.MIMEText and email/Charset.py
resolution:  -> out of date
stage: unit 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



[issue8898] The email package should defer to the codecs module for all aliases

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

Too late for 3.2, will implement for 3.3.

--
title: The email package should defer to the codecs module for  all aliases -> 
The email package should defer to the codecs module for all aliases
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue8889] test_support.transient_internet fails on Freebsd because socket has no attribute EAI_NODATA

2010-12-27 Thread R. David Murray

R. David Murray  added the comment:

I never forward ported this, but it was fixed in a different way in python3 
during a complete rewrite of transient_internet for other reasons.

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

___
Python tracker 

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



[issue10781] minidom Node.writexml method doesn't manage encoding parameter correctly

2010-12-27 Thread Goffi

Goffi  added the comment:

Thanks for your quick reply

The last sentence has nothing to do with the report, it was just a general 
remark that it would be nice if minidom could support unicode string directly.

Should I send a mail to d...@python.org to report the doc issue, or this one is 
sufficient ?

--

___
Python tracker 

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



[issue10781] minidom Node.writexml method doesn't manage encoding parameter correctly

2010-12-27 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

The documentation is incorrect; writexml does not support an encoding 
parameter. Only Document nodes support the encoding parameter in writexml, and 
it is intentional that its only effect is to fill out the XML declaration.

I don't understand the last sentence in your report: what is it that you want 
to see supported, and how is that related to this issue?

--
assignee:  -> d...@python
components: +Documentation
nosy: +d...@python, loewis

___
Python tracker 

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



[issue10781] minidom Node.writexml method doesn't manage encoding parameter correctly

2010-12-27 Thread Goffi

New submission from Goffi :

G'day,

While translating my software to french, I realised that minidom's writexml 
method doesn't handle "encoding" parameter correctly: it changes the header of 
the resulting xml, but not the encoding itself (which it should according to 
the documentation: http://docs.python.org/library/xml.dom.minidom.html).

The given example doesn't work with writexml; but if I save by myself using the 
toxml's encoding parameter (like in the commented line), it works as expected.

Anyway, it would be better if minidom could handle unicode string directly.

--
components: XML
files: test_minidom.py
messages: 124709
nosy: Goffi
priority: normal
severity: normal
status: open
title: minidom Node.writexml method doesn't manage encoding parameter correctly
versions: Python 2.6
Added file: http://bugs.python.org/file20174/test_minidom.py

___
Python tracker 

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



[issue10626] Bad interaction between test_logging and test_concurrent_futures

2010-12-27 Thread Vinay Sajip

Vinay Sajip  added the comment:

The reason for the bad interaction is that some of the tests in test_logging 
disable all existing loggers (due to the configuration tests - disabling of 
existing loggers is explicitly tested for), but as a side effect this also 
disabled the concurrent.futures logger.

I've made a change to test_logging which preserves the disabled state of all 
existing loggers across tests, and now all is well when testing

regrtest.py test_concurrent_futures test_logging test_concurrent_futures

after applying Brian's patch of 24 Dec 2010.

The change has been checked into py3k (r87513). However, this raises the wider 
issue of other loggers in stdlib and the effect on them of logging 
configuration calls. I'll raise this on python-dev for discussion.

--

___
Python tracker 

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



[issue10774] test_logging leaves temp files

2010-12-27 Thread Vinay Sajip

Vinay Sajip  added the comment:

Fix checked into py3k (r87512).

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



[issue10771] descriptor protocol documentation has two different definitions of "owner" class

2010-12-27 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I agree that the "owner" terminology imprecise.
Will work on a doc fix when I get chance.

--
assignee: d...@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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