[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

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

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

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

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

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

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

[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

[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)") complet

[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. -- _

[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() wit

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

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

[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

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

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

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

[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

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

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

[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/se

[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

[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

[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

[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

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

[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

[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

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

[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

[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

[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

[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

[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

[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.py

[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 ___ __

[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 ___ P

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

[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 ___ ___ Pyt

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

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

[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

[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. -- __

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

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

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

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

[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: dab

[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

[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

[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

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

[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 ___ __

[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://mai

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

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

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

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

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

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

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

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

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

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

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

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

[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 ___ _

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

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

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

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

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

[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

[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

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

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

[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://

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

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

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