[issue12046] Windows build identification incomplete
Martin v. Löwis mar...@v.loewis.de added the comment: Ned: I agree this is desirable (i.e. the shipped binaries ought to carry proper build identification). I also think this is independent from this issue, though, since the changes to integrate build identification into the window build process won't be unrelated to any autoconf changes we may need. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12046 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12039] test_logging: bad file descriptor on FreeBSD bot
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Senthil: Almost, but not quite. end_headers() needs to be called even if send_header() isn't called (though it may be being called behind the scenes, that's not necessarily obvious to a user). In my original unit-testing code, I had only request.send_response(200) and that caused a failure. My code now has to read request.send_response(200) request.end_headers() No send_header() in sight! Perhaps the end_header() call requirement should also be mentioned in the docs on send_response(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12039 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Waldemar Kornewald wkornew...@gmail.com added the comment: I've tracked it down. It's caused by KB2467174 (http://support.microsoft.com/kb/2467174) and I can reliably reproduce it. Here's how to reproduce it: Install *only* the Microsoft Visual C++ 2008 Redistributable Package (x86) from http://www.microsoft.com/downloads/en/confirmation.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bfdisplaylang=en Then, start Windows Update and click Check for Updates to get the new C++ 2008 Redistributable update and install that patch. Immediately symbolic links stop working. Then uninstall that patch and symlinks work again. We're still trying to figure out what's causing this problem on my friend's computer. He doesn't have the 2008 Redistributable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12039] test_logging: bad file descriptor on FreeBSD bot
Senthil Kumaran sent...@uthcode.com added the comment: Hi Vinay, Normally, when one uses send_response() call, it is most often followed with (multiple) send_header() calls and I updated the documentation keeping that in mind. Just calling of send_response() without any send_header and end_headers was an interesting use-case and I started thinking if http.server's behavior should change in order to support such a use-case. But such a thing does not play well with our recent change of caching and sending the headers. For instance, send_header and end_headers call might still be expected after send_response and in which case, server's sending of headers would break. ( It would send it two '\r\n' separated chunks, which is undesirable). I think, it is best to add a note after send_response that it should be followed by an end_header if the sever does not want to send any more headers. I shall update this information. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12039 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12039] test_logging: bad file descriptor on FreeBSD bot
Roundup Robot devnull@devnull added the comment: New changeset 4651bf40af8d by Senthil Kumaran in branch 'default': issue12039 - update the documentation of send_response method in http.server.rst. http://hg.python.org/cpython/rev/4651bf40af8d -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12039 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9971] Optimize BufferedReader.readinto
STINNER Victor victor.stin...@haypocalc.com added the comment: Le mardi 10 mai 2011 à 19:06 +, John O'Connor a écrit : Victor: AFAIK its not actually downcasting. On Linux 32 bits, size_t is 32 bits, off_t is 64 bits. If the file size is 4 GB, the downcast may truncate the size of 0 byte. It would be safer to use off_t type for the n variable in buffered_readinto(), and maybe cast to size_t on the call to memcpy. At memcpy, it is safe because the maximum possible value of n is PY_SSIZE_T (2^31-1 on a 32 bits system), which fit in a size_t. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12044] subprocess.Popen.__exit__ doesn't wait for process end
Gregory P. Smith g...@krypto.org added the comment: I didn't initially like the idea of __exit__ blocking on another process... but the zombie issue is real does make me think we should reconsider this and have it wait(). It is a backwards incompatible change if anyone has started using the Popen context manager to launch a long running subprocess that they did not want to wait for. That should be exceedingly rare. I say change the behavior to wait() in 3.3, 3.2.1 and 2.7.2. Keep the note in the documentation and turn it into something that stands out better like a note or a warning suggesting that people always call wait() after the Popen context manager exits if they need to be compatible with 2.7.1 or earlier. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12044 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Waldemar Kornewald wkornew...@gmail.com added the comment: That's really strange. We uninstalled Service Pack 1 from my friend's machine and now everything works. What I don't understand is why I don't have Service Pack 1 on my machine and why Windows Update also doesn't offer to install it. Does it have to be installed manually? :-/ Anyway, this means that the problem can be caused either by SP1 or by KB2467174. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12016] Wrong behavior for '\xff\n'.decode('gb2312', 'ignore')
STINNER Victor victor.stin...@haypocalc.com added the comment: I asked if the change is correct on iconv mail list. Here is a copy of an answer. De: Bruno Haible À: [iconv mailing list] Cc: Victor Stinner Sujet: Re: [bug-gnu-libiconv] Invalid byte sequences and multiybyte encodings Date: Tue, 10 May 2011 14:52:09 +0200 Hi, Someone opened an issue in Python bug tracker asking to change how invalid multibyte sequences are handled. http://bugs.python.org/issue12016 For UTF-8 the recommended way of handling malformed input is written down in http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt. But the principle applies to any encoding with a variable number of bytes per character: When an invalid or malformed byte sequence is found, the smallest such byte sequence is transformed to U+FFFD (replacement character). In particular, normally, if the first byte that is considered wrong or invalid is a valid starter byte, the malformed byte sequence should be considered to end before that byte. If it is not a valid starter byte, then use your judgement. For an example implementation, see http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/unistr/u8-mbtouc.c;hb=HEAD Here the return value is the number of bytes consumed. Look carefully when it is 1, 2, 3, or 4. b'\xffabc'.decode('gb2312', 'replace') gives �bc. The 'a' character is seen as part of a multibyte character of 2 bytes. Because {0xFF, 0x61} is invalid in GB2312, the two bytes are replaced by U+FFFD. Is it the right way to to do? It is better to replace only the 0xFF byte with U+FFFD, because 0x61 is a valid first byte (even a complete character). UTF-8 decoder changed recently to ignore a single byte and restart the decoder, so '\xF1\x80\x41\x42\x43' is now decoded �ABC instead �C. Should we do the same for all encodings? Generally, yes. Or at least for asian encodings (gb2312, gbk, gb18030, big5 family, ISO 2202 family, JIS family, EUC_KR, CP949, Big5, CP950, ...)? For stateful encodings of the ISO 2202 family, you may want to ignore/replace a complete escape sequence, where the syntax of escape sequences is defined through general rules. Bruno -- In memoriam Siegfried Rädel http://en.wikipedia.org/wiki/Siegfried_Rädel -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12016 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9971] Optimize BufferedReader.readinto
Antoine Pitrou pit...@free.fr added the comment: On Linux 32 bits, size_t is 32 bits, off_t is 64 bits. If the file size is 4 GB, the downcast may truncate the size of 0 byte. We are not talking about the file size here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12016] Wrong behavior for '\xff\n'.decode('gb2312', 'ignore')
STINNER Victor victor.stin...@haypocalc.com added the comment: Oh, the HZ codec has no test! And what is this horrible BLOB, Lib/test/cjkencodings_test.py? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12016 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12018] No tests for ntpath.samefile, ntpath.sameopenfile
Changes by Sijin Joseph sijinjos...@gmail.com: -- nosy: +sijinjoseph ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12018 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12034] check_GetFinalPathNameByHandle() suboptimal
Changes by Sijin Joseph sijinjos...@gmail.com: -- nosy: +sijinjoseph ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12034 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11882] test_imaplib failed on x86 ubuntu
Changes by Sijin Joseph sijinjos...@gmail.com: -- nosy: +sijinjoseph ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11882 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12045] external shell command executed twice in ctypes.util._get_soname
Changes by Sijin Joseph sijinjos...@gmail.com: -- nosy: +sijinjoseph ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12045 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12055] doctest not working on nested functions
New submission from Dave Abrahams d...@boostpro.com: The attached file demonstrates -- components: Library (Lib) files: bug.py messages: 135770 nosy: dabrahams priority: normal severity: normal status: open title: doctest not working on nested functions versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file21964/bug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12055 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12039] test_logging: bad file descriptor on FreeBSD bot
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12039 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12056] … (HORIZONTAL ELLIPSIS) should be an alternative syntax for ... (FULL STOP FULL STOP FULL STOP)
New submission from Xavier Morel xavier.mo...@masklinn.net: In Python 3, ... became useable as a normal expression, and translates into an ellipsis instance. Unicode defines an ellipsis character … (U+2026 HORIZONTAL ELLIPSIS) which is canonically equivalent to a 3-sequence of FULL STOP [U+002E U+002E U+002E] I think it would be nice if Python supported … as an alternative to ... -- components: Interpreter Core, Unicode messages: 135771 nosy: xmorel priority: normal severity: normal status: open title: … (HORIZONTAL ELLIPSIS) should be an alternative syntax for ... (FULL STOP FULL STOP FULL STOP) type: feature request versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12056 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12056] … (HORIZONTAL ELLIPSIS) should be an alternative syntax for ... (FULL STOP FULL STOP FULL STOP)
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12056 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2857] add codec for java modified utf-8
STINNER Victor victor.stin...@haypocalc.com added the comment: utf_8_java.patch: Implement utf-8-java encoding. * It has no alias * 'a\0b'.encode('utf-8-java') returns b'a\xc0\x80b' * b'a\xc0\x80b'.decode('utf-8-java') returns 'a\x00b' * I added some tests to utf-8 codec (test_invalid, test_null_byte) * I added many tests for utf-8-java codec * I choosed to copy utf8_code_length as utf8java_code_length instead of adding some if to not slow down UTF-8 codec * Decoder: 2 byte sequences may be *a little bit* slower for UTF-8: if ((s[1] 0xc0) != 0x80) is replaced by if ((ch = 0x007F (ch != 0x || !java)) || ch 0x07FF) * Encoder: encode chars in U+-U+007F may be *a little bit* slower for UTF-8: I added (ch == 0x00 java) test For the doc, I just added a line utf-8-java in the codec list, but I did not add a paragraph to explain how this codec is different to utf-8. Does anyone have a suggestion? -- keywords: +patch Added file: http://bugs.python.org/file21965/utf_8_java.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2857 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
New submission from STINNER Victor victor.stin...@haypocalc.com: All CJK codecs have tests except the chinese HZ codec, I don't know why. But to add a test, I need to add data to Lib/test/cjkencodings_test.py and the format of this file is not documented. It is not too difficult to understand the format by reading the code of the tests, but it's hard to maintain these tests (add more tests or change a test). I need tests to be able to patch the codec to fix #12016. My plan is to: - Change Lib/test/cjkencodings_test.py format: use two files for each encoding (one in the tested encoding, one in UTF-8) - Add tests to the HZ codec - Close this issue - Fix #12016 -- components: Library (Lib), Unicode messages: 135773 nosy: cdqzzy, ezio.melotti, haypo, lemburg, terry.reedy priority: normal severity: normal status: open title: HZ codec has no test versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11799] urllib HTTP authentication behavior with unrecognized auth method
Roundup Robot devnull@devnull added the comment: New changeset 6072db001b51 by Senthil Kumaran in branch 'default': Fix closes Issue #11799: urllib.request Authentication Handlers will raise a http://hg.python.org/cpython/rev/6072db001b51 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11799 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Changes by STINNER Victor victor.stin...@haypocalc.com: Added file: http://bugs.python.org/file21966/convert_cjkencodings.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Changes by STINNER Victor victor.stin...@haypocalc.com: -- keywords: +patch Added file: http://bugs.python.org/file21967/cjkencodings.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11799] urllib HTTP authentication behavior with unrecognized auth method
Changes by Senthil Kumaran sent...@uthcode.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11799 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file21967/cjkencodings.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Changes by STINNER Victor victor.stin...@haypocalc.com: Added file: http://bugs.python.org/file21968/cjkencodings.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
STINNER Victor victor.stin...@haypocalc.com added the comment: convert_cjkencodings.py is script to replace Lib/test/cjkencodings_test.py by a Lib/test/cjkencodings/ directory: --- big5hkscs.txt big5hkscs-utf8.txt big5.txt big5-utf8.txt cp949.txt cp949-utf8.txt euc_jisx0213.txt euc_jisx0213-utf8.txt euc_jp.txt euc_jp-utf8.txt euc_kr.txt euc_kr-utf8.txt gb18030.txt gb18030-utf8.txt gb2312.txt gb2312-utf8.txt gbk.txt gbk-utf8.txt johab.txt johab-utf8.txt shift_jis.txt shift_jis-utf8.txt shift_jisx0213.txt shift_jisx0213-utf8.txt --- cjkencodings.patch fixes Lib/test/test_multibytecodec_support.py to use the directoy. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2857] add codec for java modified utf-8
Marc-Andre Lemburg m...@egenix.com added the comment: Thanks for the patch, Victor. Some comments on the patch: * the codec will have to be able to work with lone surrogates (see the wikipedia page explaining this detail), which the UTF-8 codec in Python 3.x no longer does, so another special case is due for this difference * we should not make the standard UTF-8 codec slower just to support a variant of UTF-8 which will only get marginal use; for the decoder, the changes are minimal, so that's fine, but for the decoder you are changing the most often used code branch to check for NUL bytes - we need a better solution for this, even if it means having to use a separte encode_utf8java function Since the ticket was opened in 2008, the common name of the codec appears to have changed from UTF-8 Java to Modified UTF-8 or MUTF-8 as short alias: * http://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8 (change in http://en.wikipedia.org/w/index.php?title=UTF-8diff=nextoldid=291829304) * http://java.sun.com/developer/technicalArticles/Intl/Supplementary/ (scroll down to Modified UTF-8) * http://developer.android.com/reference/java/io/DataInput.html (this is for Android) So I guess we should adapt to the name to the now common name and call it ModifiedUTF8 in the C API and add these aliases: utf-8-modified, mutf-8 and modified-utf-8. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2857 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Changes by STINNER Victor victor.stin...@haypocalc.com: -- dependencies: +HZ codec has no test ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Changes by STINNER Victor victor.stin...@haypocalc.com: -- dependencies: -HZ codec has no test ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12016] Wrong behavior for '\xff\n'.decode('gb2312', 'ignore')
Changes by STINNER Victor victor.stin...@haypocalc.com: -- dependencies: +HZ codec has no test ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12016 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
STINNER Victor victor.stin...@haypocalc.com added the comment: New files should be marked as binary in Mercurial: add Lib/test/cjkencodings/* = BIN in .hgeol. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12056] … (HORIZONTAL ELLIPSIS) should be an alternative syntax for ... (FULL STOP FULL STOP FULL STOP)
Brandon Craig Rhodes bran...@rhodesmill.org added the comment: But if we allow for ellipsis, then would we not also have to start allowing characters like ≥ and ≤ in Python? And the problem with any of these (admittedly very attractive) substitutions is that they seem to abandon the principle of there being One Obvious Way of typing any given expression. Instead there would now be several alternate ways, with different styles in different codebases and, I think, something of a visual and symbolic mess resulting. I like each symbol to have exactly one possible representation. -- nosy: +brandon-rhodes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12056 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12056] … (HORIZONTAL ELLIPSIS) should be an alternative syntax for ... (FULL STOP FULL STOP FULL STOP)
Benjamin Peterson benja...@python.org added the comment: Making such substitutions is a good way to introduce subtle bugs. -- nosy: +benjamin.peterson resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12056 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11968] wsgiref's wsgi application sample code does not work
Roundup Robot devnull@devnull added the comment: New changeset e7c62e0981c7 by Senthil Kumaran in branch 'default': Fix closed Issue #11968 - the start_response header values in wsgiref shoudl be http://hg.python.org/cpython/rev/e7c62e0981c7 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11968 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11968] wsgiref's wsgi application sample code does not work
Changes by Senthil Kumaran sent...@uthcode.com: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11968 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11968] wsgiref's wsgi application sample code does not work
Roundup Robot devnull@devnull added the comment: New changeset 5add0c01933f by Senthil Kumaran in branch '3.2': Issue #11968 - the start_response header values in wsgiref shoudl be str not http://hg.python.org/cpython/rev/5add0c01933f New changeset 482f60d6a687 by Senthil Kumaran in branch 'default': [Merge Branch] Issue #11968 - the start_response header values in wsgiref shoudl be http://hg.python.org/cpython/rev/482f60d6a687 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11968 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Changes by Éric Araujo mer...@netwok.org: -- keywords: +needs review stage: - patch review versions: -Python 2.6, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12013] file /usr/local/lib/python3.1/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found
Éric Araujo mer...@netwok.org added the comment: Is the original bug still present in your new install? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12013 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12044] subprocess.Popen.__exit__ doesn't wait for process end
Charles-François Natali neolo...@free.fr added the comment: I'm re-opening this issue, since Gregory agrees to change the current behaviour. Patch attached (along with test and documentation update). -- components: +Library (Lib) keywords: +patch resolution: rejected - status: closed - open Added file: http://bugs.python.org/file21969/subprocess_zombie.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12044 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12058] Minor edits to comments in faulthandler
New submission from Éric Araujo mer...@netwok.org: I fixed or improved some comments in faulthandler. The only non-trivial change is a replacement of “until” to “before” (until did not make sense). Please review and if you agree, commit. -- files: faulthandler-comments.diff keywords: patch messages: 135784 nosy: eric.araujo, haypo priority: normal severity: normal status: open title: Minor edits to comments in faulthandler versions: Python 3.3 Added file: http://bugs.python.org/file21970/faulthandler-comments.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12058 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Terry J. Reedy tjre...@udel.edu added the comment: Looking at cjkencodings.py the format is pretty clear. The file consists of one statement that creates one dict that maps encoding names to a pair of (encoded) byte strings. The bytes literals are entirely hex escapes, with a maximum of 16 per chunk (line). From the usage you deduced that the first is encoded with named encoding and the second encoded with utf-8. (For anyone wondering, a separate utf-8 strings is needed for each encoding because each other encoding is limited to a different subset of unicode chars.) So I am not completely convinced that pulling the file apart is a complete win. Another entry could be added (the file is formatted with that possibility in mind), but it would certainly be much easier if the original formatting program were available. I do have a couple of questions. 1. Did one of us create the test strings (if so, how) or do they come from an authoritative source (like the unicode site) that created and checked them with their reference implementations. If so, the missing pair *is* a puzzle. Anyway, if so, is there any possibility that we would need to get new test strings from that source? Or are the limitations of these coding definitely fixed. 2. If you create a test file for hz codec with the hz codec, how do we know it is correct? It would only serve to detect changes in the future. -- components: +Tests ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10419] distutils command build_scripts fails with UnicodeDecodeError
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment: I have committed the fix for Distribute: https://bitbucket.org/tarek/distribute/changeset/97f12f8f6bf1 (However Distribute would fail to create entry points scripts if sys.executable contained unencodable characters.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10419 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Marc-Andre Lemburg m...@egenix.com added the comment: Terry J. Reedy wrote: Terry J. Reedy tjre...@udel.edu added the comment: Looking at cjkencodings.py the format is pretty clear. The file consists of one statement that creates one dict that maps encoding names to a pair of (encoded) byte strings. The bytes literals are entirely hex escapes, with a maximum of 16 per chunk (line). From the usage you deduced that the first is encoded with named encoding and the second encoded with utf-8. (For anyone wondering, a separate utf-8 strings is needed for each encoding because each other encoding is limited to a different subset of unicode chars.) So I am not completely convinced that pulling the file apart is a complete win. Another entry could be added (the file is formatted with that possibility in mind), but it would certainly be much easier if the original formatting program were available. I do have a couple of questions. 1. Did one of us create the test strings (if so, how) or do they come from an authoritative source (like the unicode site) that created and checked them with their reference implementations. If so, the missing pair *is* a puzzle. Anyway, if so, is there any possibility that we would need to get new test strings from that source? Or are the limitations of these coding definitely fixed. 2. If you create a test file for hz codec with the hz codec, how do we know it is correct? It would only serve to detect changes in the future. Victor, could you please contact Hye-Shik Chang pe...@freebsd.org before making significant changes to the test suite. Wouldn't it be better to just use example strings from the RFC and keep the design as it is ? http://tools.ietf.org/html/rfc1843 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Roundup Robot devnull@devnull added the comment: New changeset 82cfbe2ddfbb by Kurt B. Kaiser in branch '3.1': Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError. http://hg.python.org/cpython/rev/82cfbe2ddfbb -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1028 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
STINNER Victor victor.stin...@haypocalc.com added the comment: Looking at cjkencodings.py the format is pretty clear. The file consists of one statement that creates one dict that maps encoding names to a pair of (encoded) byte strings. The bytes literals are entirely hex escapes, with a maximum of 16 per chunk (line). From the usage you deduced that the first is encoded with named encoding and the second encoded with utf-8. (For anyone wondering, a separate utf-8 strings is needed for each encoding because each other encoding is limited to a different subset of unicode chars.) So I am not completely convinced that pulling the file apart is a complete win. Another entry could be added (the file is formatted with that possibility in mind), but it would certainly be much easier if the original formatting program were available. With classic plain text files you don't need tools to convert a test case. Use your text editor and you can use command line tools like iconv, to modify an existing testcase or add a new testcase. Example: $ iconv -f utf-8 Lib/test/cjkencodings/gb18030-utf8.txt -t gb18030 -o Lib/test/cjkencodings/gb18030-2.txt $ md5sum Lib/test/cjkencodings/gb18030-2.txt Lib/test/cjkencodings/gb18030.txt f8469bf751a9239a1038217e69d82532 Lib/test/cjkencodings/gb18030-2.txt f8469bf751a9239a1038217e69d82532 Lib/test/cjkencodings/gb18030.txt (Cool, iconv gives the same result :-)) 1. Did one of us create the test strings (if so, how) or do they come from an authoritative source (like the unicode site) that created and checked them with their reference implementations. Each encoding uses a different text, I don't know why. It's difficult to see this fact by reading hexadecimal codes... Anyway, if so, is there any possibility that we would need to get new test strings from that source? Or are the limitations of these coding definitely fixed. I don't understand why different texts are used. Why not just using the same original text for all testcases? One reason can be that some encodings (e.g. ISO 2202) use escape sequences to change the current encoding. Or maybe because the characters are different (chinese vs japanese characters?). Anyway, we can use multiple testcases for each encoding. 2. If you create a test file for hz codec with the hz codec, how do we know it is correct? It would only serve to detect changes in the future. We can use another codec than Python codec. The iconv command line program doesn't know the HZ encoding (but it knows a lot of other encodings). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
STINNER Victor victor.stin...@haypocalc.com added the comment: Le mercredi 11 mai 2011 à 17:27 +, Marc-Andre Lemburg a écrit : Victor, could you please contact Hye-Shik Chang pe...@freebsd.org before making significant changes to the test suite. Good idea, done. Wouldn't it be better to just use example strings from the RFC and keep the design as it is ? http://tools.ietf.org/html/rfc1843 Nice, this RFC contains some useful examples. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11935] MMDF/MBOX mailbox need utime
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: For the record: On Mac OS X 10.6.7, ,HFS, case sensitive` updates st_atime by itself *once only*. It does so ~0.75 seconds after os.utime() (+) was called. A time.sleep(0.8) can be used to detect this automatic update reliably (about 50 tests with changing load all succeeded). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11935 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
STINNER Victor victor.stin...@haypocalc.com added the comment: Lib/test/cjkencodings_test.py was created when CJK were introduced in Python: changeset 31386 by Hye-Shik Chang hyes...@gmail.com. Add CJK codecs support as discussed on python-dev. (SF #873597) Several style fixes are suggested by Martin v. Loewis and Marc-Andre Lemburg. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12058] Minor edits to comments in faulthandler
Roundup Robot devnull@devnull added the comment: New changeset 5f407b5479f5 by Victor Stinner in branch 'default': Issue #12058: Minor edits to comments in faulthandler http://hg.python.org/cpython/rev/5f407b5479f5 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12058 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12059] hashlib does not handle missing hash functions correctly
New submission from Ian Wienand i...@wienand.org: If one of the hash functions isn't defined in _hashlib, the code suggests it should just be skipped === # this one has no builtin implementation, don't define it pass === This doesn't happen however; due to ImportError not being caught the module decides the whole _hashlib module isn't available and tries to fall back to the older individual libraries. You then get thrown an unrelated error about _md5 being unavailable You can easily replicate this --- $ python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. def foo(): ... raise ValueError ... import _hashlib _hashlib.openssl_sha224 = foo import hashlib Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.6/hashlib.py, line 136, in module md5 = __get_builtin_constructor('md5') File /usr/lib/python2.6/hashlib.py, line 63, in __get_builtin_constructor import _md5 ImportError: No module named _md5 --- I think the solution is to catch the ImportError in __get_builtin_constructor and, if caught, consider the hash function unsupported -- files: hashlib.py.diff keywords: patch messages: 135794 nosy: Ian.Wienand priority: normal severity: normal status: open title: hashlib does not handle missing hash functions correctly type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file21971/hashlib.py.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12059 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
STINNER Victor victor.stin...@haypocalc.com added the comment: I'm working on #2857 which adds the Modified UTF-8 (utf-8-java?) codec to Python. We can maybe use it instead of raising an error in 3.3? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1028 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2857] add codec for java modified utf-8
STINNER Victor victor.stin...@haypocalc.com added the comment: See also issue #1028. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2857 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +hyeshik.chang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12016] Wrong behavior for '\xff\n'.decode('gb2312', 'ignore')
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +hyeshik.chang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12016 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12050] unconsumed_tail of zlib.Decompress is not always cleared on decompress() call
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12050 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2857] add codec for java modified utf-8
STINNER Victor victor.stin...@haypocalc.com added the comment: Benchmark: a) ./python -m timeit (b'\xc3\xa9' * 1).decode('utf-8') b)./python -m timeit (''.join( map(chr, range(0, 128)) )*1000).encode('utf-8') c) ./python -m timeit f=open('Misc/ACKS', encoding='utf-8'); acks=f.read(); f.close() acks.encode('utf-8') d) ./python -m timeit f=open('Misc/ACKS', 'rb'); acks=f.read(); f.close() acks.decode('utf-8') Original - patched (smallest value of 3 runs): a) 85.8 usec - 83.4 usec (-2.8%) b) 548 usec - 688 usec (+25.5%) c) 132 usec - 144 usec (+9%) d) 65.9 usec - 67.3 usec (+2.1%) Oh, decode 2 bytes sequences are faster with my patch. Strange :-) But 25% slower to encode a pure ASCII text is not a good news. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2857 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11948] Tutorial/Modules - small fix to better clarify the modules search path
Sandro Tosi sandro.t...@gmail.com added the comment: I first would like to apologize if my comments were interpreted like I'd like to do a poor quality job, that's actually the opposite! I just get caught by surprise how a simple change in a word to better join two paragraphs grows up like this - but that's perfectly fine and understandable we want to be as detailed and precise as possible Here's the fifth version of the patch, including Terry's suggestions - thanks! -- Added file: http://bugs.python.org/file21972/issue11948-v5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11948 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12013] file /usr/local/lib/python3.1/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found
Alex Lai alex_...@scotiacapital.com added the comment: I haven't get time to upgarde my workstation yet. I don't know when I'm going to do it. I compile the software successfully on the other server. and that's enough for me. Thanks, Alex -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12013 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11888] Add C99's log2() function to the math library
STINNER Victor victor.stin...@haypocalc.com added the comment: I wait for the following build to close this issue. http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2507 Oh, it's the wrong build. The correct build is: http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2508 And it passed so I close this issue. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11888 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12044] subprocess.Popen.__exit__ doesn't wait for process end
Changes by Gregory P. Smith g...@krypto.org: -- assignee: - gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12044 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Terry J. Reedy tjre...@udel.edu added the comment: Reading http://tools.ietf.org/html/rfc1843 suggests that the reason that there is no HZ pair in cjkencodings.py is that it is not a cjkencoding. Instead it is a formatter or meta-encoding for intermixing ascii codes and GB2312(-80) codes. (I assume the '-80' suffix means the 1980 version.) In a bytes environment, I believe a strict HZ decoder would simply separate the input bytes into alternating ascii and GB bytes by splitting on the shift chars, changing '~~' to '~', and deleting '~\n' (2 chars). So it would need a special-case test. Python shifts between ascii and GB2312 decoders to produce a unicode stream. Because of the deletion of line-continuation markers, the codec is not 1 to 1. A test sentence should contain both that and an encoded ~. hz=b'''\ This ASCII sentence has a tilde: ~~. The next sentence is in GB.~{:Ky2;S{#,~}~ ~{NpJ)l6HK!#~}Bye.''' hz b'This ASCII sentence has a tilde: ~~.\nThe next sentence is in GB.~{:Ky2;S{#,~}~\n~{NpJ)l6HK!#~}Bye.' HZ = hz.decode('HZ') HZ 'This ASCII sentence has a tilde: ~.\nThe next sentence is in GB.己所不欲,勿施於人。Bye.' # second '\n' deleted HZ.encode('HZ') b'This ASCII sentence has a tilde: ~.\nThe next sentence is in GB.~{:Ky2;S{#,NpJ)l6HK!#~}Bye.' # no '~}~\n~{' in the middle of GC codes. I believe hz and u8=HZ.encode() should work as a test pair for the working of the hz parser itself: u8 = HZ.encode() u8 b'This ASCII sentence has a tilde: ~.\nThe next sentence is in GB.\xe5\xb7\xb1\xe6\x89\x80\xe4\xb8\x8d\xe6\xac\xb2\xef\xbc\x8c\xe5\x8b\xbf\xe6\x96\xbd\xe6\x96\xbc\xe4\xba\xba\xe3\x80\x82Bye.' u8.decode() == hz.decode('HZ') True However, I have no idea what the hz codec is doing with the shifted byte pairs between '~{' and '~}' All the gb codecs decode b':Ky2;S{#,NpJ)l6HK!#' to ':Ky2;S{#,NpJ)l6HK!#' (ie, ascii chars to same unicode chars). And they encode '己所不欲,勿施於人。' to bytes with the high bit set. I figured it out. The 1995 rfc says A GB (GB1 and GB2) code is a two byte code, where the first byte is in the range $21-$77 (hexadecimal), and the second byte is in the range $21-$7E. This was in the days of for 7-bit bytes, at least for safe transmission. Now that we use 8-bit bytes nearly everywhere, the gb specs have probably be updated since 1980. This makes hz rather obsolete, since high-bit unset ascii codes and high-bit set gb codes can be mixed without the hz wrapping. In any case, Python's gb codecs act this way. So the hz codec is setting and unsetting the high bit when passing bytes to and from gb codec (assuming it does not use a modified version internally). hhz = [c - 128 for c in '己所不欲,勿施於人。'.encode('GB2312')] bytes(hhz) b':Ky2;S{#,NpJ)l6HK!#' Perhaps there should be a separate test like the above to be sure that hz really uses GB2312-80, as specified. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Terry J. Reedy tjre...@udel.edu added the comment: Reading http://tools.ietf.org/html/rfc1843 suggests that the reason that there is no HZ pair in cjkencodings.py is that it is not a cjkencoding. Instead it is a formatter or meta-encoding for intermixing ascii codes and GB2312(-80) codes. (I assume the '-80' suffix means the 1980 version.) In a bytes environment, I believe a strict HZ decoder would simply separate the input bytes into alternating ascii and GB bytes by splitting on the shift chars, changing '~~' to '~', and deleting '~\n' (2 chars). So it would need a special-case test. Python shifts between ascii and GB2312 decoders to produce a unicode stream. Because of the deletion of line-continuation markers, the codec is not 1 to 1. A test sentence should contain both that and an encoded ~. hz=b'''\ This ASCII sentence has a tilde: ~~. The next sentence is in GB.~{:Ky2;S{#,~}~ ~{NpJ)l6HK!#~}Bye.''' hz b'This ASCII sentence has a tilde: ~~.\nThe next sentence is in GB.~{:Ky2;S{#,~}~\n~{NpJ)l6HK!#~}Bye.' HZ = hz.decode('HZ') HZ 'This ASCII sentence has a tilde: ~.\nThe next sentence is in GB.己所不欲,勿施於人。Bye.' # second '\n' deleted HZ.encode('HZ') b'This ASCII sentence has a tilde: ~.\nThe next sentence is in GB.~{:Ky2;S{#,NpJ)l6HK!#~}Bye.' # no '~}~\n~{' in the middle of GC codes. I believe hz and u8=HZ.encode() should work as a test pair for the working of the hz parser itself: u8 = HZ.encode() u8 b'This ASCII sentence has a tilde: ~.\nThe next sentence is in GB.\xe5\xb7\xb1\xe6\x89\x80\xe4\xb8\x8d\xe6\xac\xb2\xef\xbc\x8c\xe5\x8b\xbf\xe6\x96\xbd\xe6\x96\xbc\xe4\xba\xba\xe3\x80\x82Bye.' u8.decode() == hz.decode('HZ') True However, I have no idea what the hz codec is doing with the shifted byte pairs between '~{' and '~}' All the gb codecs decode b':Ky2;S{#,NpJ)l6HK!#' to ':Ky2;S{#,NpJ)l6HK!#' (ie, ascii chars to same unicode chars). And they encode '己所不欲,勿施於人。' to bytes with the high bit set. I figured it out. The 1995 rfc says A GB (GB1 and GB2) code is a two byte code, where the first byte is in the range $21-$77 (hexadecimal), and the second byte is in the range $21-$7E. This was in the days of for 7-bit bytes, at least for safe transmission. Now that we use 8-bit bytes nearly everywhere, the gb specs have probably be updated since 1980. This makes hz rather obsolete, since high-bit unset ascii codes and high-bit set gb codes can be mixed without the hz wrapping. In any case, Python's gb codecs act this way. So the hz codec is setting and unsetting the high bit when passing bytes to and from gb codec (assuming it does not use a modified version internally). hhz = [c - 128 for c in '己所不欲,勿施於人。'.encode('GB2312')] bytes(hhz) b':Ky2;S{#,NpJ)l6HK!#' Perhaps there should be a separate test like the above to be sure that hz really uses GB2312-80, as specified. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Changes by Terry J. Reedy tjre...@udel.edu: -- Removed message: http://bugs.python.org/msg135802 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11877] Change os.fsync() to support physical backing store syncs
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Ouch, ouch, ouch!! I'll have to send 11877.7.diff which extends 11877.6.diff. This is necessary because using fcntl(2) with F_FULLFSYNC may fail with ENOTTY (inapprobiate ioctl for device) in situations where a normal fsync(2) succeeds (e.g. STDOUT_FILENO). By the way - i have no idea of Redmoondian Horror at all (except for http://msdn.microsoft.com/en-us/sync/bb887623.aspx). Dropping .5 and .6 - and sorry for the noise. Good night, Europe. -- Added file: http://bugs.python.org/file21973/11877.7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11877 ___diff --git a/Doc/library/os.rst b/Doc/library/os.rst --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -798,7 +798,7 @@ Availability: Unix. -.. function:: fsync(fd) +.. function:: fsync(fd, full_fsync=False) Force write of file with filedescriptor *fd* to disk. On Unix, this calls the native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` function. @@ -807,6 +807,15 @@ ``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all internal buffers associated with *f* are written to disk. + The POSIX standart requires that :c:func:`fsync` must transfer the buffered + data to the storage device, not that the data is actually written by the + device itself. It explicitely leaves it up to operating system implementors + wether users are given stronger guarantees on data integrity or not. Some + systems also offer special functions which overtake the part of making such + stronger guarantees, i.e., Mac OS X and NetBSD. The optional *full_fsync* + argument can be used to enforce usage of these special functions if that is + approbiate for the *fd* in question. + Availability: Unix, and Windows. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2121,13 +2121,50 @@ #ifdef HAVE_FSYNC PyDoc_STRVAR(posix_fsync__doc__, -fsync(fildes)\n\n\ -force write of file with filedescriptor to disk.); - -static PyObject * -posix_fsync(PyObject *self, PyObject *fdobj) -{ -return posix_fildes(fdobj, fsync); +fsync(fildes, full_fsync=False)\n\n +force write of file buffers with fildes to disk;\n +full_fsync forces flush of disk caches in case fsync() alone is not enough.); + +static PyObject * +posix_fsync(PyObject *self, PyObject *args, PyObject *kwargs) +{ +PyObject *fdobj; +int full_fsync = 0; +static char *keywords[] = {fd, full_fsync, NULL }; + +if (!PyArg_ParseTupleAndKeywords(args, kwargs, O|i, keywords, + fdobj, full_fsync)) +return NULL; + +/* See issue 11877 discussion */ +# if ((defined __APPLE__ defined F_FULLFSYNC) || \ + (defined __NetBSD__ defined FDISKSYNC)) +if (full_fsync != 0) { +int res, fd = PyObject_AsFileDescriptor(fdobj); +if (fd 0) +return NULL; +if (!_PyVerify_fd(fd)) +return posix_error(); + +Py_BEGIN_ALLOW_THREADS +# if defined __APPLE__ +/* F_FULLFSYNC is not supported for all types of descriptors, be on the + * safe side and test for inapprobiate ioctl errors */ +res = fcntl(fd, F_FULLFSYNC); +if (res 0 errno == ENOTTY) +res = fsync(fd); +# elif defined __NetBSD__ +res = fsync_range(fd, FFILESYNC|FDISKSYNC, 0, 0); +# endif +Py_END_ALLOW_THREADS + +if (res 0) +return posix_error(); +Py_INCREF(Py_None); +return Py_None; +} else +# endif +return posix_fildes(fdobj, fsync); } #endif /* HAVE_FSYNC */ @@ -9472,7 +9509,8 @@ {fchdir, posix_fchdir, METH_O, posix_fchdir__doc__}, #endif #ifdef HAVE_FSYNC -{fsync, posix_fsync, METH_O, posix_fsync__doc__}, +{fsync, (PyCFunction)posix_fsync, METH_VARARGS|METH_KEYWORDS, +posix_fsync__doc__}, #endif #ifdef HAVE_SYNC {sync,posix_sync, METH_NOARGS, posix_sync__doc__}, ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12049] expose RAND_bytes() function of OpenSSL
STINNER Victor victor.stin...@haypocalc.com added the comment: ssl_rand.patch adds RAND_bytes() and RAND_pseudo_bytes() functions to the ssl module. I moved /dev/urandom to /dev/urandom.xxx and /dev/random to /dev/random.xxx to test RAND_bytes() error path. In this case, RAND_pseudo_bytes() generates non-cryptographic pseudo-random bytes. RAND_pseudo_bytes() returns a tuple (bytes, is_cryptographic). In test_ssl, I used the assertion that RAND_pseudo_bytes() only generates cryptographic numbers if RAND_status() is 1. If the assertion is wrong, the test can be changed to just test the type of is_crytographic. RAND_bytes() and RAND_pseudo_bytes() raise a SSLError on error using ERR_get_errno() as the error code, whereas other ssl functions uses a value of the py_ssl_error enum. I don't know if it is the good choise. -- keywords: +patch Added file: http://bugs.python.org/file21974/ssl_rand_bytes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12049 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11877] Change os.fsync() to support physical backing store syncs
Changes by Steffen Daode Nurpmeso sdao...@googlemail.com: Removed file: http://bugs.python.org/file21924/11877.5.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11877 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11877] Change os.fsync() to support physical backing store syncs
Changes by Steffen Daode Nurpmeso sdao...@googlemail.com: Removed file: http://bugs.python.org/file21953/11877.6.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11877 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9971] Optimize BufferedReader.readinto
John O'Connor tehj...@gmail.com added the comment: I've attached the latest changes based on feedback (issue9971-v5.patch) for i in 1 4 128 256 1024 2048 4069 8192 16384; do echo -n buffer_size=$i ; ./python -m timeit -s f=open('LICENSE','rb');b=bytearray($i) f.seek(0) while f.readinto(b): pass; done buffer_size=1 100 loops, best of 3: 3.96 msec per loop buffer_size=4 1000 loops, best of 3: 1.12 msec per loop buffer_size=128 1 loops, best of 3: 40.1 usec per loop buffer_size=256 1 loops, best of 3: 24.1 usec per loop buffer_size=1024 10 loops, best of 3: 12.2 usec per loop buffer_size=2048 10 loops, best of 3: 10.4 usec per loop buffer_size=4069 10 loops, best of 3: 9.52 usec per loop buffer_size=8192 10 loops, best of 3: 6.04 usec per loop buffer_size=16384 10 loops, best of 3: 4.8 usec per loop -- Added file: http://bugs.python.org/file21975/issue9971-v5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Kurt B. Kaiser k...@shore.net added the comment: r70039 3.1 forward ported 3.2 default. Will be in 3.2.1. -- resolution: accepted - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1028 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1028] Tkinter binding involving Control-spacebar raises unicode error
Kurt B. Kaiser k...@shore.net added the comment: Having a modified utf-8 codec will be useful. That said, it is an error for Tcl/Tk to expose modified utf-8 externally, and that was fixed at some point in Tk8.5. Since Tk is no longer sending 0xC080 for the %A char, switching codecs in _tkinter.c won't accomplish anything. This fix was to correct a long-standing problem in IDLE using Tk8.4, which is most easily solved by catching the leaked invalid null in _tkinter.c. It seems to me that, once you switch to modified utf-8 and allow the embedded nulls, you have to make sure everything you are doing uses the modified utf-8 encoding/decoding. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1028 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12060] Python doesn't support real time signals
New submission from STINNER Victor victor.stin...@haypocalc.com: If a real time signal is raised 2 times whereas the signal is blocked, unblock the signal will call the signal handler twice. The C signal handler of the Python signal module only stores a boolean to say if the Python signal handler should be called or not in Py_CheckSignals(). If the C signal handler is called twice, the Python signal handler is only called once. Attached patch is a draft to fix this issue. The patch is not completly safe. -- components: Interpreter Core files: rt_signal.patch keywords: patch messages: 135808 nosy: haypo priority: normal severity: normal status: open title: Python doesn't support real time signals versions: Python 3.3 Added file: http://bugs.python.org/file21976/rt_signal.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12060 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12060] Python doesn't support real time signals
STINNER Victor victor.stin...@haypocalc.com added the comment: example.py: example to demonstrate the problem. The Python signal handler is only called once, it should be called twice. -- Added file: http://bugs.python.org/file21977/example.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12060 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12060] Python doesn't support real time signals
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12060 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12061] Remove duplicate 'key functions' entry in Glossary
New submission from Sandro Tosi sandro.t...@gmail.com: Hi, only on 2.7 there were 2 entries for 'key function': this patches remove the second occurrence, leaving that part of Glossary equals to the other branches. -- assignee: docs@python components: Documentation files: remove_duplicate_key_functions-2.7.patch keywords: patch messages: 135810 nosy: docs@python, sandro.tosi priority: low severity: normal stage: patch review status: open title: Remove duplicate 'key functions' entry in Glossary versions: Python 2.7 Added file: http://bugs.python.org/file21978/remove_duplicate_key_functions-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12061 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9971] Optimize BufferedReader.readinto
Roundup Robot devnull@devnull added the comment: New changeset a1d77c6f4ec1 by Antoine Pitrou in branch 'default': Issue #9971: Write an optimized implementation of BufferedReader.readinto(). http://hg.python.org/cpython/rev/a1d77c6f4ec1 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9971] Optimize BufferedReader.readinto
Antoine Pitrou pit...@free.fr added the comment: I've committed a minimally modified version of the patch, thank you! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12057] HZ codec has no test
Hyeshik Chang hyes...@gmail.com added the comment: Hello, everyone! The rationale why I chose to encode the test strings into a Python source code was that I wanted for them to be treated as text files which are trackable in CVS or subversion and to keep Python source codes free of any non-ASCII characters. Now I don't feel the need of text file status, STINNER's suggestion works for me. Actually, all stateful encodings supported by cjkcodecs lack of adequate test codes. (There are seven more iso-2022 stateful encodings in addition of hz in Python.) cjkencoding_tests.py is used for random chunk coding tests and most stateful encodings are not compatible with random chunk coding. For those reasons, I didn't include test strings for them there. But they apparently still need appropriate simple string coding and stream coding tests. STINNER Victor wrote: I don't understand why different texts are used. Why not just using the same original text for all testcases? One reason can be that some encodings (e.g. ISO 2202) use escape sequences to change the current encoding. Or maybe because the characters are different (chinese vs japanese characters?). Almost every encoding in cjkcodecs has different set of characters. They support different languages (Chinese, Japanese, Korean), different scripts (Hanja, Kanji, Traditional and Simplified Chinese), different standards (johab and KS X 1001 in Korean), different versions/variants (JIS X 0201 and JIS X 0213 in Japanese). It would be quite striking, actually one of them, gb18030, is a superset of the Unicode so far. Teddy J Reedy wrotes: Perhaps there should be a separate test like the above to be sure that hz really uses GB2312-80, as specified. You're right. By the way, my previous e-mail address pe...@freebsd.org isn't reachable anymore, please send to hyes...@gmail.com when you need. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12044] subprocess.Popen.__exit__ doesn't wait for process end
Roundup Robot devnull@devnull added the comment: New changeset 7a3f3ad83676 by Gregory P. Smith in branch 'default': - Issue #12044: Fixed subprocess.Popen when used as a context manager to http://hg.python.org/cpython/rev/7a3f3ad83676 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12044 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12044] subprocess.Popen.__exit__ doesn't wait for process end
Roundup Robot devnull@devnull added the comment: New changeset b00a64a5cb93 by Gregory P. Smith in branch '3.2': merge - 7a3f3ad83676 Fixes Issue #12044. http://hg.python.org/cpython/rev/b00a64a5cb93 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12044 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12044] subprocess.Popen.__exit__ doesn't wait for process end
Gregory P. Smith g...@krypto.org added the comment: did my commits in the reverse order (default before 3.2), oops. this is fixed. this wasn't ever in 2.7 so no need for the documentation note. i'm not worried about adding a note about 3.2.0 vs 3.2.1 beyond the mention in Misc/NEWS as this was new in 3.2.0 and fixing this behavior is a pretty clear bug fix. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12044 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5723] Incomplete json tests
Ezio Melotti ezio.melo...@gmail.com added the comment: Attached patch refactors the tests to use import_fresh_module and different subclasses for Python and C tests. It also includes a fix to import_fresh_module to make it work with packages (it can be committed separately). -- assignee: bob.ippolito - ezio.melotti keywords: +needs review, patch stage: test needed - commit review versions: +Python 3.2, Python 3.3 -Python 2.6 Added file: http://bugs.python.org/file21979/issue5723.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5723 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12061] Remove duplicate 'key functions' entry in Glossary
Roundup Robot devnull@devnull added the comment: New changeset 534a9e274d88 by Georg Brandl in branch '2.7': #12061: remove duplicate glossary entry. http://hg.python.org/cpython/rev/534a9e274d88 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12061 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12061] Remove duplicate 'key functions' entry in Glossary
Georg Brandl ge...@python.org added the comment: Thanks for the patch! -- nosy: +georg.brandl resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12061 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12058] Minor edits to comments in faulthandler
Changes by Ezio Melotti ezio.melo...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12058 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8824] Improve documentation of exec
Ezio Melotti ezio.melo...@gmail.com added the comment: In 3.x exec is a function, so the reference to 'in' should be removed/updated. On 2.x it might be better to just use ``in`` instead of :keyword:`in`, because the latter probably links to the 'in' operator that checks for containment. -- nosy: +ezio.melotti stage: - patch review versions: +Python 3.3 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8824 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com