[issue35568] Expose the C raise() function in the signal module, for use on Windows

2018-12-22 Thread Nathaniel Smith
Nathaniel Smith added the comment: Vladimir Matveev pointed out that there's already a wrapper in _testcapimodule.c: https://github.com/python/cpython/blob/f06fba5965b4265c42291d10454f387b76111f26/Modules/_testcapimodule.c#L3862-L3879 So if we do add this to signalmodule.c, we can drop

[issue35568] Expose the C raise() function in the signal module, for use on Windows

2018-12-22 Thread Nathaniel Smith
Nathaniel Smith added the comment: It probably doesn't matter too much either way, but almost all the signal-related wrappers are in signal. os.kill is the only exception AFAIK. -- ___ Python tracker

[issue33661] urllib may leak sensitive HTTP headers to a third-party web site

2018-12-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35568] Expose the C raise() function in the signal module, for use on Windows

2018-12-22 Thread Steve Dower
Steve Dower added the comment: Sounds fine to me. Any particular reason to put it in signal rather than os/posixmodule? If it's just to avoid treating os/posixmodule like a dumping ground for C89/POSIX APIs... well... too late :) I say keep dumping them there. But I don't have a strong

[issue35568] Expose the C raise() function in the signal module, for use on Windows

2018-12-22 Thread Nathaniel Smith
New submission from Nathaniel Smith : Suppose we want to test how a program responds to control-C. We'll want to write a test that delivers a SIGINT to our process at a time of our choosing, and then checks what happens. For example, asyncio and Trio both have tests like this, and Trio even

[issue35565] Add detail to an assertion failure message in wsgiref

2018-12-22 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +patch pull_requests: +10523 stage: -> patch review ___ Python tracker ___ ___

[issue33661] urllib may leak sensitive HTTP headers to a third-party web site

2018-12-22 Thread Katsuhiko YOSHIDA
Katsuhiko YOSHIDA added the comment: Hi, I agree with this suggestion. First, section 6.4. "Redirection 3xx" of RFC 7231 doesn't explicitly explain whether to send all headers (including Authorization). I have confirmed that some third-party-library, tool, Programing Language and web

[issue35566] DOC: Add links to annotation glossary term

2018-12-22 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +patch pull_requests: +10521 stage: -> patch review ___ Python tracker ___ ___

[issue35567] Convert membership test from dict-of-constants to a set

2018-12-22 Thread Raymond Hettinger
New submission from Raymond Hettinger : On line 164 in Lib/wsgiref/utils.py, there is a dictionary called *_hoppish* that should be a set object. -- assignee: cheryl.sabella components: Library (Lib) keywords: easy messages: 332380 nosy: cheryl.sabella, rhettinger priority: normal

[issue35566] DOC: Add links to annotation glossary term

2018-12-22 Thread Cheryl Sabella
New submission from Cheryl Sabella : Add links to glossary term when `annotation` is used. -- assignee: docs@python components: Documentation messages: 332379 nosy: cheryl.sabella, docs@python priority: normal severity: normal status: open title: DOC: Add links to annotation glossary

[issue35565] Add detail to an assertion failure message in wsgiref

2018-12-22 Thread Raymond Hettinger
New submission from Raymond Hettinger : On line 236 in Lib/wsgiref/handlers.py, we get the assertion message, "Hop-by-hop headers not allowed". That message should should show the *name* and *value* that triggered the failure. Otherwise, it is difficult to know which header caused the

[issue35557] Allow lowercase hexadecimal characters in base64.b16decode()

2018-12-22 Thread Dylan Houlihan
Dylan Houlihan added the comment: Karthikeyan, Thank you for taking the time to respond so thoroughly. In particular, in the future I'll be more careful to qualify and quantify potential performance improvements using `timeit` or `perf`. That being said, as I mentioned the primary

[issue35557] Allow lowercase hexadecimal characters in base64.b16decode()

2018-12-22 Thread Dylan Houlihan
Change by Dylan Houlihan : -- type: performance -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35557] Allow lowercase hexadecimal characters in base64.b16decode()

2018-12-22 Thread Dylan Houlihan
Change by Dylan Houlihan : -- versions: -Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___ ___

[issue35548] memoryview needlessly (?) requires represented object to be hashable

2018-12-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Mark, do you have thoughts on the subject? > Perhaps another path is optionally allow hashing of memoryviews > (all current conditions - hashability of the original object) > via a parameter? Like unsafe_hash like in dataclass. I suspect this would open

[issue24390] Python 3.4.3 64 bits is not "high dpi aware"

2018-12-22 Thread Cheryl Sabella
Cheryl Sabella added the comment: IDLE added a call to the Windows API in #33656. Other than that, as Amaury stated, there isn't any UI in Python, so closing this as not a bug. -- nosy: +cheryl.sabella resolution: -> not a bug stage: -> resolved status: open -> closed

[issue35548] memoryview needlessly (?) requires represented object to be hashable

2018-12-22 Thread Ilya Kulakov
Ilya Kulakov added the comment: Perhaps another path is optionally allow hashing of memoryviews (all current conditions - hashability of the original object) via a parameter? Like unsafe_hash like in dataclass. -- status: pending -> open ___

[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think performance of base16 encoding is important enough to increase import times. I would recommend rejection. -- ___ Python tracker

[issue35564] [DOC] Sphinx 2.0 will require master_doc variable set in conf.py

2018-12-22 Thread jfbu
New submission from jfbu : When building CPython doc with master branch of dev repo of Sphinx (future Sphinx 2.0) one gets this warning: WARNING: Since v2.0, Sphinx uses "index" as master_doc by default. Please add "master_doc = 'contents'" to your conf.py. Fix will be to do as Sphinx says

[issue23057] [Windows] asyncio: support signal handlers on Windows (feature request)

2018-12-22 Thread Cheryl Sabella
Change by Cheryl Sabella : -- pull_requests: +10519 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35514] Docs on reference count detail. enhancement.

2018-12-22 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +patch pull_requests: +10518 stage: -> patch review ___ Python tracker ___ ___

[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-22 Thread Cheryl Sabella
Change by Cheryl Sabella : -- pull_requests: +10517 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-22 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +patch pull_requests: +10516 stage: -> patch review ___ Python tracker ___ ___

[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-22 Thread Cheryl Sabella
Change by Cheryl Sabella : -- pull_requests: -10516 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28791] update SQLite libraries for Windows and macOS installers

2018-12-22 Thread Zachary Ware
Change by Zachary Ware : -- priority: -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28791] update SQLite libraries for Windows and macOS installers

2018-12-22 Thread Zachary Ware
Zachary Ware added the comment: Since we have a more recent "update SQLite" issue in bpo-35360, I'm going to go ahead and close this one. -- assignee: benjamin.peterson -> resolution: -> fixed stage: patch review -> resolved status: pending -> closed

[issue2771] Test issue

2018-12-22 Thread Ezio Melotti
Ezio Melotti added the comment: test message via email -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35563] Doc: warnings.rst - add links to references

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: You can bring this up at https://python.zulipchat.com/#narrow/stream/116501-workflow and someone might help. -- ___ Python tracker

[issue35558] venv: running activate.bat gives ' parameter format not correct - 65001'

2018-12-22 Thread Nils Lindemann
Change by Nils Lindemann : -- resolution: -> duplicate stage: -> resolved status: -> closed ___ Python tracker ___ ___

[issue35555] IDLE: Gray out Code Context on non-editor windows

2018-12-22 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +patch pull_requests: +10515 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue35563] Doc: warnings.rst - add links to references

2018-12-22 Thread Cheryl Sabella
Cheryl Sabella added the comment: @xtreak, maybe it's related to the maintenance Ernest did yesterday on the bugs.python.org server? Not sure the best way to ping him. -- ___ Python tracker

[issue35563] Doc: warnings.rst - add links to references

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: @cheryl.sabella You're welcome. PR was not automatically added to couple of my issues too today though the PR description and issue number check was updated by bedevere-bot. I don't know if it's a random issue. -- nosy: +xtreak

[issue35563] Doc: warnings.rst - add links to references

2018-12-22 Thread Cheryl Sabella
Cheryl Sabella added the comment: @xtreak, thanks for adding the PR link. I was going to ask you how to do it, but I see it now. Completely missed it before. -- ___ Python tracker

[issue35563] Doc: warnings.rst - add links to references

2018-12-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- keywords: +patch pull_requests: +10514 stage: -> patch review ___ Python tracker ___ ___

[issue30698] asyncio sslproto do not shutdown ssl layer cleanly

2018-12-22 Thread Manjusaka
Manjusaka added the comment: Ping! Agree with Wei-Cheng. The leak still bothers me for times, and still bother for third-party like https://aiohttp.readthedocs.io/en/stable/client_reference.html#tcpconnector Yury, I think it's worth working on it. Using uvloop should not be a good idea

[issue35563] Doc: warnings.rst - add links to references

2018-12-22 Thread Cheryl Sabella
Cheryl Sabella added the comment: I created a pull request for this, but it didn't attach it: https://github.com/python/cpython/pull/11289 -- ___ Python tracker ___

[issue35563] Doc: warnings.rst - add links to references

2018-12-22 Thread Cheryl Sabella
New submission from Cheryl Sabella : In the docs for the warnings module, there is some text referencing other areas of the documentation that would be more helpful as links. -- assignee: docs@python components: Documentation messages: 332362 nosy: cheryl.sabella, docs@python

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > min_width сan be large negative number, and there are subtractions from it. > It may be safer to replace the assert with something like min_width = > Py_MAX(0, min_width). Or ensure that it is non-negative before calling >

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35562] Issue in sizeof() function

2018-12-22 Thread Ammar Askar
Ammar Askar added the comment: Iterating over _fields_ and adding up the sizeof() for each type could be one solution. -- ___ Python tracker ___

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: min_width сan be large negative number, and there are subtractions from it. It may be safer to replace the assert with something like min_width = Py_MAX(0, min_width). Or ensure that it is non-negative before calling _PyUnicode_InsertThousandsGrouping().

[issue35562] Issue in sizeof() function

2018-12-22 Thread Amir Aslan Haghrah
Amir Aslan Haghrah added the comment: Thank you for your response. I noticed this issue while working with 'mmap' and memory sharing. As you said I check it in 'C++' and I got the same result for my struct as Python. - I

[issue35562] Issue in sizeof() function

2018-12-22 Thread Ammar Askar
Ammar Askar added the comment: This has to do with C struct packing and alignment. You are likely on a 64-bit computer and thus your structs are aligned to 8 byte (64 bit) boundaries. https://docs.python.org/2/library/ctypes.html#structure-union-alignment-and-byte-order Create an equivalent

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > This bug is not new, and this is the first report for it. It can be treated > as a security issue if an application allows user to specify format string. > But using a format string from untrusted source causes a security issue > itself, because

[issue35562] Issue in sizeof() function

2018-12-22 Thread Amir Aslan Haghrah
New submission from Amir Aslan Haghrah : If you define a structure which contains an 'c_int' and a 'c_double' member. Then run the sizeof() function for it you get 16 as result as follows: - from ctypes import c_int from ctypes import c_double from

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This bug is not new, and this is the first report for it. It can be treated as a security issue if an application allows user to specify format string. But using a format string from untrusted source causes a security issue itself, because this allows to

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Sure, I will create one shortly. There were some other cases with different values of negative numbers that I will add since I couldn't see any tests failing on my debug builds. * Are there chances that bugs like these are present since I guess

[issue35561] Valgrind reports Syscall param epoll_ctl(event) points to uninitialised byte(s)

2018-12-22 Thread Nikolaus Rath
Nikolaus Rath added the comment: $ ./configure CFLAGS="-O0 -g" --with-valgrind && make -j8 still gives ==13281== Memcheck, a memory error detector ==13281== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==13281== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for

[issue35561] Valgrind reports Syscall param epoll_ctl(event) points to uninitialised byte(s)

2018-12-22 Thread Stefan Krah
Stefan Krah added the comment: "--with-valgrind --with-pydebug" looks suspicious, it essentially mixes two different memory checkers. 1) CFLAGS="-O0 -g" --without-pymalloc 2) CFLAGS="-O0 -g" --with-valgrind should both work. Can you try if this fixes the error? -- nosy: +skrah

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, seems the simplest way to fix this issue is to remove that assert. Do you mind to create a PR? Tests should be added to cover this case. -- ___ Python tracker

[issue35561] Valgrind reports Syscall param epoll_ctl(event) points to uninitialised byte(s)

2018-12-22 Thread Nikolaus Rath
Nikolaus Rath added the comment: Same error with 3.7.1 and 3.6.7 (though line numbers differ slightly). -- ___ Python tracker ___

[issue35561] Valgrind reports Syscall param epoll_ctl(event) points to uninitialised byte(s)

2018-12-22 Thread Nikolaus Rath
New submission from Nikolaus Rath : With current git master, configured --with-valgrind --with-pydebug, I get: ==31074== Command: /home/nikratio/clones/cpython/python /home/nikratio/in-progress/pyfuse3/test/../examples/hello.py /tmp/pytest-of-nikratio/pytest-11/test_hello_hello_py_0

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Looking into the code min_width is returned as -2 and hence the assert fails. spec->n_min_width is passed as min_width to _PyUnicode_InsertThousandsGrouping that is used in the assert statement and I came across below comment that min_width can go

[issue32326] Update Build projects to version 10.0.16299.0 of the Windows 10 SDK.

2018-12-22 Thread Cheryl Sabella
Cheryl Sabella added the comment: The PR was closed as not needed, so should this ticket also be closed? Thanks! -- nosy: +cheryl.sabella __ Python tracker

[issue35553] Test

2018-12-22 Thread Ernest W. Durbin III
Change by Ernest W. Durbin III : -- stage: -> resolved status: open -> closed __ Python tracker __ ___

[issue35548] memoryview needlessly (?) requires represented object to be hashable

2018-12-22 Thread Stefan Krah
Stefan Krah added the comment: The reason is that unfortunately readonly != immutable, as the following example shows: >>> import numpy as np >>> x = np.array([1,2,3], dtype='B') >>> y = x[:] >>> y.flags['WRITEABLE'] = False >>> m = memoryview(y) >>> m.readonly True >>> m.tolist() [1, 2, 3]

[issue35548] memoryview needlessly (?) requires represented object to be hashable

2018-12-22 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.8 -Python 3.4, Python 3.5, Python 3.6 __ Python tracker __ ___

[issue35533] argparse standard error usage for exit / error

2018-12-22 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +bethard versions: +Python 3.8 __ Python tracker __ ___ Python-bugs-list

[issue35514] Docs on reference count detail. enhancement.

2018-12-22 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +serhiy.storchaka __ Python tracker __ ___ Python-bugs-list mailing list

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the feedback. I personally prefer 'expected' than 'expect' though it comes at the cost that this cannot be aligned with 'actual'. Other places use 'expected' and it reads more natural in test case scenarios. --

[issue35553] Test

2018-12-22 Thread Ernest W. Durbin III
New submission from Ernest W. Durbin III : Test -- messages: 332304 nosy: EWDurbin priority: normal severity: normal status: open title: Test __ Python tracker

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: We don't usually wrap error messages, but this is plausible. With the addition to the first line, we don't need to repeat 'call'. We can line things up without violating the PEP 8 recommendation against doing so with spaces. Also, the convention is to

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2018-12-22 Thread Kay Hayen
Change by Kay Hayen : -- nosy: -Kay.Hayen __ Python tracker __ ___ Python-bugs-list mailing list Unsubscribe:

[issue35121] Cookie domain check returns incorrect results

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Looking further into this the domain validation makes it little more stricter and can have wider implications. For example requests library uses cookiejar to maintain cookies between sessions. One more case is that `domain` can be empty so only

[issue34823] libffi detection doesn’t work in my setup

2018-12-22 Thread Daniel Fetchinson
Daniel Fetchinson added the comment: I have the exact same issue, trying to compile 3.7.1 with a custom libffi location. Note that I must build libffi from source and can't install binaries provided by my distro, I believe this is the origin of the problem. Probably the python build system

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2018-12-22 Thread Matthew McCormick
Matthew McCormick added the comment: > What current 3.x versions have this issue? This issue was opened against 2.7. Yes, this is just for 2.7. -- versions: -Python 3.8 __ Python tracker

[issue35540] dataclasses.asdict breaks with defaultdict fields

2018-12-22 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi __ Python tracker __ ___ Python-bugs-list mailing list

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-12-22 Thread STINNER Victor
STINNER Victor added the comment: multiprocessing.Pool destructor now emits a ResourceWarning if it is still running: if .close() nor .terminate() have been called, see bpo- 35424. It is a first alarm that the problematic example is wrong. Should reconsider to fix this bug in the master

[issue34823] libffi detection doesn’t work in my setup

2018-12-22 Thread Daniel Fetchinson
Daniel Fetchinson added the comment: It would be really great if this could be sorted out because at the moment this bug prevents me from using numpy/scipy with python 3.7.1 (they need _ctypes). -- __ Python tracker

[issue35547] email.parser / email.policy does not correctly handle multiple RFC2047 encoded-word tokens across RFC5322 folded headers

2018-12-22 Thread R. David Murray
R. David Murray added the comment: Here's a patch that makes the example work correctly. This is not a fix, a real fix will be more complicated. This just demonstrates the kind of thing that needs fixing and where. The existing parser produces a sub-optimal parse tree as its result...the

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2018-12-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: What current 3.x versions have this issue? This issue was opened against 2.7. This was changed to 3.3 in 2013 (3.3 should have just been added with control-click). I reverted to 2.7 and tentatively added 3.8, but this needs to be checked. The PR is

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2018-12-22 Thread Steve Dower
Steve Dower added the comment: The change in PR 880 looks fine to me. I dislike defining names without a Py prefix in public headers. And PRs are not where we do general discussion or ping for attention. Make sure the nosy list includes the relevant experts (in this case probably me) and

[issue2771] Test issue

2018-12-22 Thread Ernest W. Durbin III
Ernest W. Durbin III added the comment: Testing after hosting migration completion -- __ Python tracker __ ___

[issue35548] memoryview needlessly (?) requires represented object to be hashable

2018-12-22 Thread Stefan Krah
Stefan Krah added the comment: I'll leave the issue up for a couple of days in case someone supports it, but I think this one of the rare cases where all core devs would reject the feature unanimously. -- resolution: -> not a bug status: open -> pending type: -> enhancement

[issue35548] memoryview needlessly (?) requires represented object to be hashable

2018-12-22 Thread Stefan Krah
Stefan Krah added the comment: Sorry I meant the above example to use a dict, which currently does not work: >>> d = {m: "1"} Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'numpy.ndarray' Then the feature would allow to change the dict key.

[issue35548] memoryview needlessly (?) requires represented object to be hashable

2018-12-22 Thread Stefan Krah
Stefan Krah added the comment: The feature would violate fundamental Python invariants. If you modify the example above: >>> t = (m,) >>> b"\001\002\003" in t True >>> x[0] = 100 >>> b"\001\002\003" in t False This is simply never supposed to happen in Python. If an immutable object

[issue35432] str.format and string.Formatter bug with French (and other) locale

2018-12-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : I was looking into format issues and came across msg99839 . The example causes segfault in master, 3.7 and 3.6 branches. This used to pass in 3.7 and 3.6. I searched for open issues and cannot come across an issue for this. I guess this is

[issue24307] [Python 2] pip error on windows whose current user name contains non-ascii characters

2018-12-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> third party stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue30455] Generate all tokens related code and docs from Grammar/Tokens

2018-12-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks Serhiy, the other issue noted about performance improvement removing casefold and I thought re.search per call to be inefficient. My bad that I didn't consider the cost of moving the compilation to module level that affects import time and

[issue35009] argparse throws UnicodeEncodeError for printing help with unicode choices

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks Serhiy, I have limited knowledge of unicode and hence I thought this to be a fix. I am closing this as per msg332337 and the PR I opened for issue24307 (Feel free to close issue24307 as per Victor's resolution if needed) --

[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: According to your results, you will save 0.94 us per call of b16decode, but loss 126 us at import time. You will get a benefit if b16decode is used more than 130 time. Currently, if the performance is critical, the user can use binascii.unhexlify()

[issue35009] argparse throws UnicodeEncodeError for printing help with unicode choices

2018-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Even if you encode default values for output, you can not pass unicode values from command line. You can pass a 8-bit string '\xe6\x97\xa9\xe4\xb8\x8a\xe5\xa5\xbd' which differs from a Unicode string u"早上好". Even after resolving the output issue, unicode

[issue24307] [Python 2] pip error on windows whose current user name contains non-ascii characters

2018-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Even if you encode the Unicode default for output, the user can not specify the same value, unless you use custom converter. For example, if you encode u"早上好" as string "\xe6\x97\xa9\xe4\xb8\x8a\xe5\xa5\xbd" (in UTF-8), the user can only specify the

[issue13927] Extra spaces in the output of time.ctime

2018-12-22 Thread Antti Haapala
Antti Haapala added the comment: This should be added to `asctime` too. The space-padded behaviour complies with the C standard which was the intent - after all, before it was using C `asctime` directly, and says that unlike C asctime, it doesn't have the newline character, meaning that as

[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > How this affects the import time (use -X importtime)? Is there reliable way to benchmark this? On multiple runs with regex for python3 -X importtime -c 'import base64' import time: 677 | 11151 | base64 On multiple runs without regex

[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks @scoder . I took the convention since most of the places I have seen capitalized variable ending with PAT but this looks more readable to me. I have made the changes in my PR. -- ___ Python