[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-11-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 494f736f5945 by Victor Stinner in branch 'default': Issue #19424: PyUnicode_CompareWithASCIIString() normalizes memcmp() result http://hg.python.org/cpython/rev/494f736f5945 -- ___ Python tracker

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-11-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2ed8d500e113 by Victor Stinner in branch 'default': Issue #19424: Fix a compiler warning on comparing signed/unsigned size_t http://hg.python.org/cpython/rev/2ed8d500e113 -- ___ Python tracker

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-11-03 Thread Vajrasky Kok
Vajrasky Kok added the comment: Py_ssize_t is signed long. size_it is unsigned long. In this case, I suppose we should avoid unsigned as much as possible in comparison with signed. So I think Zachary's patch is reasonable. What do you think, Victor? -- ___

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 52ec6a3eeda5 by Victor Stinner in branch 'default': Issue #19424: Fix a compiler warning http://hg.python.org/cpython/rev/52ec6a3eeda5 -- ___ Python tracker __

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-30 Thread Zachary Ware
Zachary Ware added the comment: Adding to Vajrasky's report, the same commit also adds 3 warnings when building on Windows: ..\Objects\unicodeobject.c(10588): warning C4018: '>' : signed/unsigned mismatch [P:\Projects\OSS\Python\cpython\PCbuild\pythoncore.vcxproj] ..\Objects\unicodeobject.c(10

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Vajrasky Kok
Vajrasky Kok added the comment: Victor, I found out that this commit http://hg.python.org/cpython/rev/34e166d60f37 gives me compiler warning. Objects/unicodeobject.c: In function ‘PyUnicode_CompareWithASCIIString’: Objects/unicodeobject.c:10583:22: warning: pointer targets in initialization di

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- stage: -> committed/rejected ___ Python tracker ___ ___ Python-bugs-list mailing

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread STINNER Victor
STINNER Victor added the comment: Oops, while fixing this issue, I found a new issue related to warnings: I opened issue #19442 "Python crashes when a warning is emitted during shutdown". This issue can now be fixed. -- resolution: -> fixed status: open -> closed

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 05e8dde3229c by Victor Stinner in branch 'default': Issue #19424: Fix test_warnings for locale encoding unable to encode http://hg.python.org/cpython/rev/05e8dde3229c -- ___ Python tracker

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread STINNER Victor
STINNER Victor added the comment: @Serhiy: Thanks for your review. I modified warnings.warn_explicit() to reject types different than str for the filename. I also removed the useless optimization for PyUnicode_Substring() when i=0. -- ___ Python tra

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset c7326aa0b69c by Victor Stinner in branch 'default': Issue #19424: Fix the warnings module to accept filename containing surrogate http://hg.python.org/cpython/rev/c7326aa0b69c -- ___ Python tracker

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread STINNER Victor
STINNER Victor added the comment: "Well, it looks reasonable. But an action should be ASCII only string. So perhaps we should first check PyUnicode_IS_ASCII() and then use PyUnicode_1BYTE_DATA() and strcpy()." Such optimizations in warnings seem overkill, performances are not critical in this

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 34e166d60f37 by Victor Stinner in branch 'default': Issue #19424: Optimize PyUnicode_CompareWithASCIIString() http://hg.python.org/cpython/rev/34e166d60f37 -- nosy: +python-dev ___ Python tracker

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Well, it looks reasonable. But an action should be ASCII only string. So perhaps we should first check PyUnicode_IS_ASCII() and then use PyUnicode_1BYTE_DATA() and strcpy(). -- ___ Python tracker

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread STINNER Victor
STINNER Victor added the comment: > I don't see a benefit from this patch. Oh, sorry, I forgot to explain the motivation. Performances of the warnings module are not critical module. The motivation here is to avoid to encoding string to UTF-8 for correctness. For example, _PyUnicode_AsString(f

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't see a benefit from this patch. _PyUnicode_AsString() is very fast in most cases (because source lines are mostly ASCII only). On other hand, the patch replaces one-time _PyUnicode_AsString() by multiple less effective (even for ASCII strings) operati

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-28 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-28 Thread STINNER Victor
New submission from STINNER Victor: Attached patch removes usage of _PyUnicode_AsString() to not convert strings from/to UTF-8. -- components: Unicode files: warnings.patch keywords: patch messages: 201558 nosy: ezio.melotti, haypo priority: normal severity: normal status: open title: _