[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: > but why it is forced to encoded to utf-8, > I think it should be encoded by the locale related encodings,not always utf-8, > for example,in GBK locale,it should use GBK to encode the unicode > object,right? Wrong. Exec'ing Unicode strings has been specified

[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-23 Thread wjm251
wjm251 added the comment: but why it is forced to encoded to utf-8, I think it should be encoded by the locale related encodings,not always utf-8, for example,in GBK locale,it should use GBK to encode the unicode object,right? -- ___ Python tracker

[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: Oops, I meant a = "大" -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: This is not a bug, but intentional. a is a Unicode string; it does not have an encoding internally (not GBK, not UTF-8). Then, the string being exec'ed also becomes a Unicode string. exec'ing Unicode strings is confusing; try to avoid this. The semantics of

[issue7696] Improve Memoryview/Buffer documentation

2010-10-23 Thread R. David Murray
R. David Murray added the comment: Antoine, is there more that remains to be done on this, or can it be closed? -- nosy: +r.david.murray ___ Python tracker ___ __

[issue9228] Make changes in the path and pathext on installation

2010-10-23 Thread R. David Murray
R. David Murray added the comment: Modifying the path has be definitely rejected by python-dev. I don't know enough about windows to comment on the other two, but I suspect that everything that it is reasonable to do automatically is already being done. -- nosy: +loewis, r.david.murr

[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-10-23 Thread R. David Murray
R. David Murray added the comment: My best guess currently is that the failing test is a bug in difflib, but I haven't dug into that code yet to prove it. It's still possible it's something stupid in my code, but as far as I can see there's no character over where that - is in the difflib ou

[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-23 Thread wjm251
wjm251 added the comment: in windows English Version and ubuntu 10.04(locale is utf-8) all have the same the behavior, am I wrong? -- ___ Python tracker ___ ___

[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-23 Thread wjm251
New submission from wjm251 : windows Xp chinese version see the attached file, the header was set to GBK,and the file is GBK encoded, but why the output was '\xe5\xa4\xa7'(it is utf-8 encoded of Chinese character "大") -- components: Library (Lib) files: test.py messages: 119482 nosy:

[issue10186] Invalid SyntaxError pointer offset

2010-10-23 Thread Benjamin Peterson
Benjamin Peterson added the comment: r85814 -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker ___ _

[issue10155] Add fixups for encoding problems to wsgiref

2010-10-23 Thread And Clover
And Clover added the comment: Ah, sorry, submitted wrong patch against 3.2, disregard. Here's the 'proper' version (the functionality isn't changed, just the former patch had an unused and-Falsed out clause for reading environb, which in the end I decided not to use as the surrogateescape app

[issue10186] Invalid SyntaxError pointer offset

2010-10-23 Thread Alex
Changes by Alex : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue10155] Add fixups for encoding problems to wsgiref

2010-10-23 Thread And Clover
Changes by And Clover : Removed file: http://bugs.python.org/file19303/wsgiref-patches-3.2a3.patch ___ Python tracker ___ ___ Python-bugs-list

[issue10186] Invalid SyntaxError pointer offset

2010-10-23 Thread Alex
New submission from Alex : Builtin SyntaxError formatter does never point to char before last in wrong source line. traceback.format_exception() is not affected. *** Example: >>> raise SyntaxError('', ('', 0, 3, 'hello')) ... hello ^ SyntaxError: test >>> raise SyntaxError('', ('', 0,

[issue1349106] email.Generator does not separate headers with "\r\n"

2010-10-23 Thread R. David Murray
R. David Murray added the comment: Committed in r85811. -- resolution: -> accepted stage: commit review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue10178] PEP 378 uses replace where translate may work better

2010-10-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, the text needs to stand as-is. It is supposed to be a hint of what can be done, nothing more. The technique of t=x; x=y; y=t is somewhat basic and has general applicability -- there's nothing "complex" about it. Also, for short strings such as the

[issue10030] Patch for zip decryption speedup

2010-10-23 Thread Shashank
Shashank added the comment: >the C module should be private and therefore called _zipdecrypt done >if you want to avoid API mismatch, you could give a tp_call to your C >>decrypter object, rather than a "decrypt" method done >- you can put all initialization code in zipdecrypt_new and avoid t

[issue10180] File objects should not pickleable

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I don't see why Buffered or TextIO's shouldn't be pickleable, ISTM > their pickleability should be based on what the underlying file obj > is. That could be. Right now, though, pickling them gives nonsensical results and I think it would be better to give an

[issue10180] File objects should not pickleable

2010-10-23 Thread Georg Brandl
Georg Brandl added the comment: What would be the use case for that? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue10180] File objects should not pickleable

2010-10-23 Thread Alex
Alex added the comment: I don't see why Buffered or TextIO's shouldn't be pickleable, ISTM their pickleability should be based on what the underlying file obj is. -- nosy: +alex ___ Python tracker ___

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

2010-10-23 Thread R. David Murray
Changes by R. David Murray : -- assignee: -> r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue10185] Py_hash_t declaration needed in _testcapimodule

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed in r85810, thank you. -- nosy: +pitrou resolution: -> fixed status: open -> closed versions: -Python 3.3 ___ Python tracker ___ ___

[issue10180] File objects should not pickleable

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The patch modifies _io.TextIOWrapper, but not _pyio.TextIOWrapper. Is > there a reason? Yes, two of them: - modifying _pyio.Buffered* is enough to trigger the TypeError - _pyio.StringIO inherits from TextIOWrapper, and it must be pickleable -- _

[issue10180] File objects should not pickleable

2010-10-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch modifies _io.TextIOWrapper, but not _pyio.TextIOWrapper. Is there a reason? -- ___ Python tracker ___

[issue10185] Py_hash_t declaration needed in _testcapimodule

2010-10-23 Thread Case Van Horsen
New submission from Case Van Horsen : While researching errors in issue 9778, I found a variable in _testcapimodule.c that should be declared Py_hash_t instead of long. Patch is attached. -- components: Interpreter Core files: py_hash_t_testcapimodule.diff keywords: patch messages: 119

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: I recommend to declare this issue closed, and keep it closed unless somebody wants to propose to revert the change (widening the hash type) completely. Any remaining issues that people want to attribute to this change (correctly or incorrectly) should be rep

[issue10184] tarfile touches directories twice

2010-10-23 Thread Martin v . Löwis
New submission from Martin v. Löwis : When extracting, the time stamps of directories are modified twice: once when creating the directories, and then once in reverse order when done. The first utimes call is redundant; it also causes issues with a buggy NFS server, see http://www.python.org/d

[issue10183] test_concurrent_futures failure on Windows

2010-10-23 Thread Antoine Pitrou
New submission from Antoine Pitrou : I get this failure quite reliably on a Windows 7 VM, in both 32-bit and 64-bit builds: == FAIL: test_map_timeout (test.test_concurrent_futures.ProcessPoolExecutorTest) --

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: The test_capi problem is not 64-bit-specific (see issue9116). As for test_concurrent_futures, I also have a failure (not the same one) in both 32-bit and 64-bit builds here. I'm gonna open a separate issue. -- ___

[issue10169] socket.sendto raises incorrect exception when passed incorrect types

2010-10-23 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Case Van Horsen
Case Van Horsen added the comment: On Win64, I get two unexpected failures: I terminated test_capi after a Windows exception box popped up. [ 37/349] test_capi test test_capi failed -- Traceback (most recent call last): File "C:\svn\py3k\lib\test\test_capi.py", line 50, in test_no_FatalErro

[issue5178] Add context manager for temporary directory

2010-10-23 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Personally I would like to have a unique tempfile.mkdtemp which can be used as both a function and a context manager, as it happens for open() and others. Not sure how to do that though, unless tempfile.mkdtemp gets turned into a class. There would be objec

[issue10182] match_start truncates large values

2010-10-23 Thread Martin v . Löwis
New submission from Martin v. Löwis : _sre.c:match_start currently uses Py_BuildValue("i") to return the start index, which itself is of type Py_ssize_t. This will get truncated on x64 Windows if the start is > 2**31. PyInt_FromSsize_t should be used instead. Other usages of Py_BuildValue shou

[issue10179] os.stat fails on mapped network drive

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Can you try my patch in #10027? Does this also fail? No, your patch seems to fix the issue. -- ___ Python tracker ___ __

[issue10181] get_shape0 in memoryobject.c not checked for error return

2010-10-23 Thread Roger Upole
New submission from Roger Upole : There are a number of places in memoryobject.c where get_shape0 is used without the return value being checked. If it fails, this leads to hanging exceptions and crashes. -- components: Interpreter Core messages: 119460 nosy: rupole priority: normal s

[issue10180] File objects should not pickleable

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch, but issue10173 must probably be fixed first. -- dependencies: +Don't pickle TestCase instances in test_multiprocessing keywords: +patch Added file: http://bugs.python.org/file19344/pickleio.patch ___

[issue10179] os.stat fails on mapped network drive

2010-10-23 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Can you try my patch in #10027? Does this also fail? -- ___ Python tracker ___ ___ Python-bugs-l

[issue10180] File objects should not pickleable

2010-10-23 Thread Georg Brandl
Georg Brandl added the comment: Sounds like a good idea to me. -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mai

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I've committed them in r85808. -- status: open -> pending ___ Python tracker ___ ___ Python-bugs

[issue10179] os.stat fails on mapped network drive

2010-10-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: I think something like this is worth adding. I'd like to see two changes implemented: - GetLastError should be checked for the "not implemented or some such" error that you got, and the fallback only performed if its this error - a comment explaining the moti

[issue8777] Add threading.Barrier

2010-10-23 Thread Georg Brandl
Georg Brandl added the comment: Ping -- is this something you want in 3.2, Kristjan? -- nosy: +georg.brandl ___ Python tracker ___ ___

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: These changes also look all reasonable to me. -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue5178] Add context manager for temporary directory

2010-10-23 Thread Georg Brandl
Georg Brandl added the comment: Ping... soon it's too late for 3.2 too :) -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bug

[issue6518] Enable 'with' statement in ossaudiodev module

2010-10-23 Thread Georg Brandl
Georg Brandl added the comment: Applied (with new test, and docs) in r85807. I also removed the AttributeError catch. -- nosy: +georg.brandl resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue10180] File objects should not pickleable

2010-10-23 Thread Antoine Pitrou
New submission from Antoine Pitrou : In Python 3, pickle accepts to serialize a file object, but the result is nonsensical when unpickled. I think we should explicitly forbid pickling of FileIO, Buffered{Reader,Writer} and TextIOWrapper objects. -- components: IO, Library (Lib) message

[issue6011] python doesn't build if prefix contains non-ascii characters

2010-10-23 Thread STINNER Victor
STINNER Victor added the comment: > Same errors. Please describe exactly how you reproduced the error (write each command). r85805 fixes another bug related to this problem. Is it a better fix than distutils_makefile_encoding.patch: use surrogateescape error handler to decode the Makefile fi

[issue7761] telnetlib Telnet.interact fails on Windows but not Linux

2010-10-23 Thread Stefan Krah
Stefan Krah added the comment: The patch works. I agree that no test is needed, since no one will attempt to revert this. :) -- ___ Python tracker ___ ___

[issue6058] Add cp65001 to encodings/aliases.py

2010-10-23 Thread David-Sarah Hopwood
David-Sarah Hopwood added the comment: Oops, false alarm. python -c "import os; print repr(os.getcwdu())" works as expected, so the exception is part of issue 1602. (My command about there being no need to distinguish this codepage from UTF-8 stands.) --

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: This patch seems to fix all aforementioned failures. -- Added file: http://bugs.python.org/file19343/hashw64.patch ___ Python tracker ___ __

[issue10178] PEP 378 uses replace where translate may work better

2010-10-23 Thread samwyse
samwyse added the comment: The text in question is also talking about the problems with using 'replace' to swap pairs of characters, so a better, alternate, process would be valuable, especially for anyone unaware of the translate method. -- ___ Py

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue6058] Add cp65001 to encodings/aliases.py

2010-10-23 Thread David-Sarah Hopwood
David-Sarah Hopwood added the comment: I meant to say that the os.getcwdu() test in msg119440 was done with Windows native Python 2.6.2. -- ___ Python tracker ___ __

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Case's patch fixes test_builtin and test_complex failures on Windows 7 64-bit. But there's still a failure in test_dictviews: == FAIL: test_items_set_operations (test.test_dictviews.DictSetTes

[issue9778] Make hash values the same width as a pointer (or Py_ssize_t)

2010-10-23 Thread Benjamin Peterson
Benjamin Peterson added the comment: Thank you. Applied in r85803. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue6058] Add cp65001 to encodings/aliases.py

2010-10-23 Thread David-Sarah Hopwood
David-Sarah Hopwood added the comment: I said: "There is only one correct way to encode/decode UTF-8". This is true modulo differences in the treatment of initial byte order marks. -- ___ Python tracker __

[issue6058] Add cp65001 to encodings/aliases.py

2010-10-23 Thread David-Sarah Hopwood
David-Sarah Hopwood added the comment: This problem causes {{{os.getcwdu()}}} to fail when the console code page is set to 65001 (always, I think): {{{ t:\>ver Microsoft Windows [Version 6.0.6002] t:\>chcp Active code page: 65001 t:\>python -c "import os; print os.getcwdu()" Traceback (most

[issue10179] os.stat fails on mapped network drive

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: This patch seems to do the trick, although I'm not sure it warrants including in Python. -- keywords: +patch Added file: http://bugs.python.org/file19342/osstat.patch ___ Python tracker

[issue10179] os.stat fails on mapped network drive

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, indeed. It was critical before I found out that it's VirtualBox-specific. -- priority: critical -> normal ___ Python tracker ___ _

[issue10179] os.stat fails on mapped network drive

2010-10-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: Let me guess: It's GetFinalPathNameByHandle that is failing. Put some debug output right after the call to verify. Why is this critical? Not being able to stat VirtualBox folders doesn't sound that critical to me. -- nosy: +loewis _

[issue10176] telnetlib.Telnet.read_very_eager() performance

2010-10-23 Thread R. David Murray
R. David Murray added the comment: Well, perhaps when you ran the test with the sleep the target server had an unusually long startup delay. If you are going to use read_very_eager you are going to have to deal with the possibility of not getting back what you expected, so it doesn't really

[issue10153] Memory leak in pythonrun.c

2010-10-23 Thread Stefan Krah
Changes by Stefan Krah : -- resolution: -> duplicate stage: patch review -> committed/rejected status: open -> closed superseder: -> Refleaks in pythonrun.c ___ Python tracker

[issue10157] Refleaks in pythonrun.c

2010-10-23 Thread Stefan Krah
Stefan Krah added the comment: After taking the scenic route through half of the tree[1], I finally found another leak in pythonrun.c. I'm closing #10153, merging those two leaks into the new patch. Does it look ok? [1] Valgrind stack traces should be approached with caution. -- sta

[issue10176] telnetlib.Telnet.read_very_eager() performance

2010-10-23 Thread ptz
ptz added the comment: Strange. I was certain that I tried inserting a time.sleep() in the function and it still didn't work, but I tried it just now and it does work as expected. Sorry, and thanks for your answer, at least I learned something. --

[issue6668] locale.py: can't parse sr...@latin locale

2010-10-23 Thread R. David Murray
R. David Murray added the comment: Python 3.2a3+ (py3k:85670:85675M, Oct 17 2010, 20:27:19) [GCC 4.4.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale(locale.LC_ALL) 'lc_ctype=sr...@latin;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=

[issue10179] os.stat fails on mapped network drive

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hmm, it looks like this is actually VirtualBox-specific. It works with another network drive mapped on Y: >>> os.stat(r"y:") nt.stat_result(st_mode=16895, st_ino=0, st_dev=0, st_nlink=0, st_uid=0, st_gid=0, st_size=0, st_atime=1287784175, st_mtime=1281439296,

[issue10179] os.stat fails on mapped network drive

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: And 3.1 works fine. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue10179] os.stat fails on mapped network drive

2010-10-23 Thread Antoine Pitrou
New submission from Antoine Pitrou : This network drive is actually mapped through the VirtualBox guest additions. Under Python 2.7 (official 64-bit MSI installer), this works fine: >>> s = 'Z:\\__svn__\\Lib\\test\\keycert.pem' >>> os.stat(s) nt.stat_result(st_mode=33206, st_ino=0L, st_dev=0, s

[issue10178] PEP 378 uses replace where translate may work better

2010-10-23 Thread R. David Murray
R. David Murray added the comment: The text in question is talking about 'replace' as a general mechanism for 'fixing' the separator character, and as such I don't think introducing translate would enhance the exposition. I suppose it could be added in a footnote. -- nosy: +eric.smi

[issue7761] telnetlib Telnet.interact fails on Windows but not Linux

2010-10-23 Thread R. David Murray
R. David Murray added the comment: The attached patch should fix the problem. It replicates the bytes/string changes made for the unix branch in the windows branch. It would be nice to come up with a unit test for this, but in this case that's a lot more complicated than figuring out the fix

[issue10178] PEP 378 uses replace where translate may work better

2010-10-23 Thread samwyse
New submission from samwyse : PEP 378 states; format(n, "6,f").replace(",", "X").replace(".", ",").replace("X", ".") This is complex and relatively slow. A better technique, which IMHO the proposal should high-lighted, would be: swap_commas_and_periods = bytes.maketrans(b',.', b'.,') f

[issue10118] Tkinter does not find font

2010-10-23 Thread R. David Murray
R. David Murray added the comment: Terry meant 2.6 is in security fix only mode. 2.7 will get bug fixes for an extended period. -- nosy: +r.david.murray ___ Python tracker ___

[issue10176] telnetlib.Telnet.read_very_eager() performance

2010-10-23 Thread R. David Murray
R. David Murray added the comment: Presumably the difference is that there is a pause between the two statement executions at the interactive prompt (even if you cut and paste) that does not exist in the function. -- nosy: +r.david.murray resolution: -> invalid stage: -> committed/r

[issue10177] PyUnicode_AsWideCharString and PyMem_Free

2010-10-23 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto : Hello. I found several codes using PyMem_Free to free allocated memory via PyUnicode_AsWideCharString. In PyUnicode_AsWideCharString, memory is allocated with PyMem_MALLOC. Is it OK to use PyMem_Free not PyMem_FREE? Thank you. -- keywords: easy mes

[issue10176] telnetlib.Telnet.read_very_eager() performance

2010-10-23 Thread ptz
New submission from ptz : In Python 2.4, Assuming we've imported telnetlib, the following works: >>> f = telnetlib.Telnet("some_text_based_server") >>> f.read_very_eager() The last call outputs the text that the server outputs upon connection (e.g. "login: "). However, if we put this

[issue10174] multiprocessing expects sys.stdout to have a fileno/close method.

2010-10-23 Thread Ask Solem
Ask Solem added the comment: Please add the traceback, I can't seem to find any obvious places where this would happen now. Also, what version are you currently using? I agree with the fileno, but I'd say close is a reasonable method to implement, especially for stdin/stdout/stderr --

[issue10174] multiprocessing expects sys.stdout to have a fileno/close method.

2010-10-23 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- components: +Library (Lib) -None nosy: +asksol, jnoller versions: +Python 3.1, Python 3.2 -Python 2.6 ___ Python tracker ___ __

[issue10077] Python 3.1: site error is not logged

2010-10-23 Thread STINNER Victor
STINNER Victor added the comment: Commited to Python 3.1 (r85802). -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue6011] python doesn't build if prefix contains non-ascii characters

2010-10-23 Thread Éric Araujo
Éric Araujo added the comment: Same errors. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth