[issue36030] add internal API function to create tuple without items array initialization

2019-02-19 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : PyTuple_New() fills items array with NULLs to make usage of Py_DECREF() safe even when array is not fully filled with real items. There are multiple cases when this initialization step can be avoided to improve performance. For example it gives such speed-

[issue36030] add internal API function to create tuple without items array initialization

2019-02-19 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +11952 stage: -> patch review ___ Python tracker ___ ___ Python-bugs

[issue36030] add internal API function to create tuple without items array initialization

2019-02-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue35126] Mistake in FAQ about converting number to string.

2019-02-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- keywords: +easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: [Au Vo] > Python2 produces 10.0 as the answers for all of the above calculation. Can you double check this, and confirm which Python version and operating system you're using? Like others, I'm not seeing any difference between Python 2 and Python 3, and as

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: > Can you double check this, and confirm which Python version and operating > system you're using? Sorry; I missed the screenshots. It looks as though you labelled those the wrong way around, BTW: I think "Screen Shot 2019-02-18 at 9.07.37 PM.png" is the Py

[issue35954] Incoherent type conversion in configparser

2019-02-19 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Other methods validate explicitly their arguments with _validate_value_types for example. Here it raises KeyError which does not seem to be the appropriate exception. ConfigParser implementing the mapping protocol it seems weird to me to have >>> a = 123

[issue36026] Different error message when sys.settrace is used (regressions)

2019-02-19 Thread SylvainDe
Change by SylvainDe : -- type: -> behavior versions: +Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : There are several cases in CPython sources when PyList_AsTuple() is used with just created list and immediately after that this list is Py_DECREFed. This operation can be performed more effectively since refcount of items is not changed. For example it gi

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki
INADA Naoki added the comment: > Thus, even if this eventually deserves to be closed as a non-issue, I'd > rather go on the safe side and double check if this is the desirable > behaviour or if something went wrong with the commits previously mentioned. As Serhiy mentioned, this error messa

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: > Unfortunately, there's little information about how Trinket is implemented. > Is it CPython-based? >From a little playing around, Trinket only provides a subset of Python (one >might say "batteries not included"), and it's not clear what its basis is. >No

[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +11953 stage: -> patch review ___ Python tracker ___ ___ Python-bugs

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread SylvainDe
SylvainDe added the comment: Thanks for the investigation. I'm fine with the explanation provided. -- ___ Python tracker ___ ___ Py

[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Amit Amely
New submission from Amit Amely : This is the tutorial text: >>> prefix = 'Py' >>> prefix 'thon' # can't concatenate a variable and a string literal ... SyntaxError: invalid syntax >>> ('un' * 3) 'ium' ... SyntaxError: invalid syntax This is the actual result: >>> prefix = 'Py' >>> prefix

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: not a bug -> third party ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you provide more real world examples? Optimizing just one artificial example does not look impressive. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: >From a little more digging, it seems that Trinket's Python 2 is based on >Skulpt (so is a JavaScript implementation of a subset of Python), while the >Python 3 "trinket" connects to an Ubuntu Linux server running CPython 3.6.6. -- _

[issue36029] Use consistent case for HTTP header fields

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Thank you for your contribution and your issue, it's really appreciated. I had a doubt about this point and I wanted to verify about the HTTP headers. But in the previous version of this RFC7230: https://www.w3.org/Protocols/rfc2616/rfc2616.html Here is the

[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The output in tutorial is correct. "..." means omitted output (we don't want to clutter examples with insignificant details). -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed __

[issue35859] Capture behavior depends on the order of an alternation

2019-02-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -11700 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue35689] IDLE: Docstrings and test for colorizer

2019-02-19 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue35859] Capture behavior depends on the order of an alternation

2019-02-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -11701 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue35126] Mistake in FAQ about converting number to string.

2019-02-19 Thread miss-islington
miss-islington added the comment: New changeset c611db4942a07c81f54e6584615bbddc51034a77 by Miss Islington (bot) (Stéphane Wirtel) in branch '2.7': [2.7] bpo-35126: Fix a mistake in FAQ about converting number to string (GH-11911) https://github.com/python/cpython/commit/c611db4942a07c81f54e6

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki
INADA Naoki added the comment: Is this make sense? >>> set.add(0) Traceback (most recent call last): File "", line 1, in TypeError: descriptor 'add' for type 'set' doesn't apply to type 'int' >>> set.add.__get__(0) Traceback (most recent call last): File "", line 1, in TypeError: descrip

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki
Change by INADA Naoki : -- keywords: +patch pull_requests: +11954 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-lis

[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Amit Amely
Amit Amely added the comment: But it also contains an error message part which has nothing to do with this example (marked in dark green) This only works with two literals though, not with variables or expressions: >>> prefix = 'Py'>>> prefix 'thon' # can't concatenate a variable and a strin

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread SylvainDe
SylvainDe added the comment: This looks good to me :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I consider this as a minor regression in 3.7, unless there were reasons to change error messages. I think that in this case the change that restores error messages should be backported to 3.7. -- ___ Python trac

[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: @serhiy I think Amit wants to say there is no triple point in these examples of the tutorial. -- nosy: +matrixise ___ Python tracker ___ __

[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: and when you execute the examples, the REPL does not generate the triple points. For me, the examples of the tuto are correct and we don't need to add '...' in the examples. -- ___ Python tracker

[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: Does this look like more real world example? Before: $ python -m perf timeit -s "t = (1, 2, 3)" "(*t, 4, 5)" . Mean +- std dev: 95.7 ns +- 2.3 ns After: $ python -m perf timeit -s "t = (1, 2, 3)" "(*t, 4, 5)" . Mean +-

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki
INADA Naoki added the comment: @Serhiy Error messages are not changed in 3.7. They are different from 3.6. Optimization in 3.7 changed "code path", not error message. So it's difficult to fix this without breaking existing behavior. Python 3.6.7 (default, Dec 18 2018, 17:32:18) [GCC 4.2.1 Com

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki
INADA Naoki added the comment: BTW, should we have different error message for class methods and instance mehtods? * method: "descriptor 'X' for 'Y' objects doesn't apply to a 'Z' object" * classmethod: "descriptor 'X' for 'Y' types doesn't apply to a 'Z' type" Currently, classmethod notice

[issue36024] ctypes: test_ctypes test_callbacks() crash on AArch64 with SELinux enabled

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: Florian Weimer wrote a fix for libffi, so the bug is in libffi and not Python/ctypes. I close the issue. There are enough open issues to track this bug :-) https://github.com/libffi/libffi/issues/470 -- resolution: -> third party stage: -> resolved

[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- keywords: +patch pull_requests: +11955 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue36027] Consider adding modular multiplicative inverse to the math module

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: +1 for the pow(value, -1, modulus) spelling. It should raise `ValueError` if `value` and `modulus` are not relatively prime. It would feel odd to me _not_ to extend this to `pow(value, n, modulus)` for all negative `n`, again valid only only if `value` is re

[issue36027] Consider adding modular multiplicative inverse to the math module

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: Here's an example of some code in the standard library that would have benefited from the availability of `pow(x, n, m)` for arbitrary negative n: https://github.com/python/cpython/blob/e7a4bb554edb72fc6619d23241d59162d06f249a/Lib/_pydecimal.py#L957-L960

[issue36030] add internal API function to create tuple without items array initialization

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: Sergey Fedoseev wrote similar change for list: bpo-34151. -- ___ Python tracker ___ ___ Python-bu

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-02-19 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: It turns out having this fix would be useful for proceeding with issue17561, which right now cannot support dual-stack IPv4/6 on Windows because IPPROTO_IPV6 is missing, see my comment: https://github.com/python/cpython/pull/11784#issuecomment-465078646 -

[issue36033] logging.makeLogRecord should update "rv" using a dict defined with bytes instead of strings

2019-02-19 Thread Rodolfo Alonso
New submission from Rodolfo Alonso : When using Pycharm to execute unit/functional tests (OpenStack development), oslo_privsep.daemon._ClientChannel.out_of_band retrieves the record from the input arguments. Pycharm arguments are stored in a dictionary using bytes instead of strings. When lo

[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2019-02-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +11957 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +11956 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +11958 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -11956 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue36012] Investigate slow writes to class variables

2019-02-19 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue33944] Deprecate and remove pth files

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: > 3. I realize that PEPs are needed for any change and even to define what > that change might look like, but is there any value in adding > PendingDeprecationWarnings for 3.8 if that's a possible action that will > happen? As I understand it, it would be

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: > if (PyOS_setsig(SIGINT, SIG_DFL) == SIG_ERR) { >perror("signal"); /* Impossible in normal environments. */ In my experience, Python is were impossible things happen. Would it be possible to write a better error message to explain what happened? I expe

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-02-19 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: @eryksun I tried your patch (https://bugs.python.org/issue29515#msg287477) on Windows 10 and it looks good. It introduces the following new constants: IPPROTO_IGMP IPPROTO_GGP IPPROTO_PUP IPPROTO_IDP IPPROTO_ND IPPROTO_MAX IPPROTO_HOPOPTS IPPROTO_IPV4 IPPR

[issue27632] build on AIX fails when builddir != srcdir, more than bad path to ld_so_aix

2019-02-19 Thread Michael Felt
Michael Felt added the comment: As far as 'master' is concerned, this has been resolved, so I'll close it myself. -- stage: -> resolved status: open -> closed versions: +Python 3.8 -Python 3.4 ___ Python tracker

[issue29757] The loop in utility `socket.create_connection()` swallows previous errors

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: I propose the close the issue as WONTFIX. I don't see how the current behavior is an issue. I expect a very large traceback just because a server is down/reject connections. I'm not sure that I want that by default. > ## The problem > So currently the loop

[issue35773] test_bdb fails on AIX bot (regression)

2019-02-19 Thread Michael Felt
Michael Felt added the comment: Again - after switching the env variable LANG to the 'default' everything works as expected. Leaving it open as a regression - because everything was working with a non-default setting. When I have more time I'll do a git bisect to try and establish the chang

[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread INADA Naoki
INADA Naoki added the comment: @Amit Please confirm docs.python.org before submitting issue. #33460 fixed it already. -- nosy: +inada.naoki ___ Python tracker ___

[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2019-02-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +11959 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread INADA Naoki
INADA Naoki added the comment: Uh! You meant Python 2.7!! It doesn't make sense to improve Python 2.7 tutorial. If you're reading Python 2 tutorial, please read 3.7 tutorial instead!!! -- ___ Python tracker ___

[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2019-02-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8e79e6e56f516385ccb761e407dfff3a39253180 by Serhiy Storchaka in branch 'master': Fix syntax warnings in tests introduced in bpo-15248. (GH-11932) https://github.com/python/cpython/commit/8e79e6e56f516385ccb761e407dfff3a39253180 -- _

[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +11961 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2019-02-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +11960 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8d01eb49fc7ff914feeb2e2090d1d6ef15c932ab by Serhiy Storchaka in branch 'master': Fix syntax warnings in tests introduced in bpo-35942. (GH-11934) https://github.com/python/cpython/commit/8d01eb49fc7ff914feeb2e2090d1d6ef15c932ab -- _

[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +11962 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue36034] Suprise halt caused by -Werror=implicit-function-declaration in ./Modules/posixmodule.c

2019-02-19 Thread Michael Felt
New submission from Michael Felt : On a system using an older version of gcc (v5.7.4) I get an error: (also AIX 6.1) gcc -pthread -Wno-unused-result -Wsign-compare -g -O0 -Wall -O -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=impl

[issue36035] pathlib.Path().rglob() breaks with broken symlinks

2019-02-19 Thread Jörg Stucke
New submission from Jörg Stucke : When using rglob() to iterate over the files of a directory containing a broken symlink (a link pointing to itself) rglob breaks with "[Errno 40] Too many levels of symbolic links" (OS: Linux). Steps to reproduce: mkdir tmp touch foo ls -s foo tmp/foo cd tmp

[issue36034] Suprise halt caused by -Werror=implicit-function-declaration in ./Modules/posixmodule.c

2019-02-19 Thread Michael Felt
Michael Felt added the comment: correction - gcc version is v4.7.4 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread miss-islington
miss-islington added the comment: New changeset a8834905df853510f38d4e2d628bed8229fd7482 by Miss Islington (bot) in branch '3.7': Fix syntax warnings in tests introduced in bpo-35942. (GH-11934) https://github.com/python/cpython/commit/a8834905df853510f38d4e2d628bed8229fd7482 -- __

[issue36035] pathlib.Path().rglob() breaks with broken symlinks

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: I confirm this issue with python 3.7 but your script is wrong (you declare f and use x in your script) /tmp$ mkdir demo /tmp$ cd demo/ /t/demo$ mkdir tmp

[issue36035] pathlib.Path().rglob() breaks with broken symlinks

2019-02-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: @vstinner, all the tests pass on AppVeyor and Travis, I check if the resource is local (file://) or not, and if the given path is a file (c:\\windows\\system32\\calc.exe), I check if this one is an executable. --

[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: After a small test, os.access() on a text file is True, and it's wrong in my case. -- ___ Python tracker ___ ___

[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread Nick Coghlan
Nick Coghlan added the comment: Paolo: it still won't be completely clear, since there's still the subtle issue that __new__ is a static method rather than a class method, so the correct calls up to the base class are respectively: super(Singleton, cls).__new__(cls) # Static method, cls

[issue36036] Add method to get user defined command line arguments in unittest.main

2019-02-19 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- components: +Library (Lib) versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36036] Add method to get user defined command line arguments in unittest.main

2019-02-19 Thread Rémi Lapeyre
New submission from Rémi Lapeyre : Hi, I'm working on issue 18765 (running pdb.post_mortem() on failing test cases) where I need to control the behavior of a TestCase based on some outside input. For this issue, I want to add a new --pdb option to turn this feature on when enabled. As of toda

[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 5105483acb3aca318304bed056dcfd7e188fe4b5 by Nick Coghlan (Sanyam Khurana) in branch 'master': bpo-31506: Clarify error messages for object.__new__ and object.__init__ (GH-11641) https://github.com/python/cpython/commit/5105483acb3aca318304bed056d

[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +11963 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread miss-islington
miss-islington added the comment: New changeset 64ca72822338e0ba6e4f14d0a1cd3a9dcfa6c9ac by Miss Islington (bot) in branch '3.7': bpo-31506: Clarify error messages for object.__new__ and object.__init__ (GH-11641) https://github.com/python/cpython/commit/64ca72822338e0ba6e4f14d0a1cd3a9dcfa6c

[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread Nick Coghlan
Nick Coghlan added the comment: The revised behaviour now makes the error messages consistent with each other: >>> class TooManyArgs(): ... def __new__(cls): ... super().__new__(cls, 1) ... >>> TooManyArgs() Traceback (most recent call last): File "", line 1, in File "", line

[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- nosy: +mdk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: @vstinner Could we imagine to create a whitelist just for the html file? like that, we could open an html file and reject an executable file. -- ___ Python tracker ___

[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a)

2019-02-19 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: Getting those failures on RHEL8 as well, which can be worked around by setting the env OPENSSL_CONF=/non-existing-file == ERROR: test_protocol_sslv23 (test.test_ssl.ThreadedTests) Con

[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor
New submission from STINNER Victor : RHEL8 uses a strict crypto policy by default. For example, SSLContext uses TLS 1.2 as the minimum version by default. Attached PR fix test_ssl for RHEL8. The PR is not specific to RHEL8. It should also fix test_ssl on Debian: see bpo-35925 and bpo-36005.

[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +11964 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +cstratak, gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: On Python 2.7.16rc, similar tests are failing on RHEL8: ERROR: test_protocol_sslv23 (test.test_ssl.ThreadedTests) ERROR: test_protocol_tlsv1_1 (test.test_ssl.ThreadedTests) ... But right now, Python 2.7 doesn't give access to minimum_version/maximum_version

[issue36027] Consider adding modular multiplicative inverse to the math module

2019-02-19 Thread Berry Schoenmakers
Berry Schoenmakers added the comment: Agreed, extending pow(value, n, modulus) to negative n would be a great addition! To have modinv(value, modulus) next to that also makes a lot of sense to me, as this would avoid lots of confusion among users who are not so experienced with modular arit

[issue36038] ^ used in inaccurate example in regex-howto

2019-02-19 Thread Louis Michael
New submission from Louis Michael : at https://docs.python.org/3/howto/regex.html#regex-howto and https://docs.python.org/3.8/howto/regex.html#regex-howto https://docs.python.org/3.7/howto/regex.html#regex-howto https://docs.python.org/3.6/howto/regex.html#regex-howto https://docs.python.org/3.5

[issue35126] Mistake in FAQ about converting number to string.

2019-02-19 Thread Cheryl Sabella
Change by Cheryl Sabella : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: @vstinner I have a whitelist where the HTML files (.html, .html, .dhtml, .xhtml, ...) are allowed. For the rest, I do not execute os.startfile() -- ___ Python tracker

[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: > RHEL8 uses a strict crypto policy by default. For example, SSLContext uses > TLS 1.2 as the minimum version by default. Ah, I forgot to mention that a workaround is to use OPENSSL_CONF=/ environment variable to ignore RHEL crypto policy (don't load system

[issue36027] Consider adding modular multiplicative inverse to the math module

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: > it's still a bit subtle that you have to use pow(a, -1,p) instead of pow(a, > p-2, p) to let the modular inverse be computed efficiently That's not 100% clear: the binary powering algorithm used to compute `pow(a, p-2, p)` is fairly efficient; the extended

[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: Parsing an URL and deciding if an URL is "safe" or not is hard. For example, PR 11931 denies "file://" URLs, but I don't see the issue with opening such URL: file:///home/vstinner/prog/GIT/github.io/output/index.html (local path to a HTML file) The problem h

[issue36019] test_urllib fail in s390x buildbots: http://www.example.com/

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: ok for me if you prefer to use a function test with pythontest.net -- ___ Python tracker ___ ___

[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: PR 11931 experimented other tests: return os.path.isfile(path) and os.access(path, os.X_OK) and: is_exe = False with open(path, 'rb') as fp: s = fp.read(2) is_exe = s != b'MZ' return os.path.isfile(pa

[issue36033] logging.makeLogRecord should update "rv" using a dict defined with bytes instead of strings

2019-02-19 Thread SilentGhost
Change by SilentGhost : -- components: +Library (Lib) nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue34053] Support localization of unicode descriptions

2019-02-19 Thread Pander
Pander added the comment: As discussed on python-ideas, created scripts at https://github.com/OpenTaal/python-unicodedata_l10n that provide a starting point. -- ___ Python tracker _

[issue36039] Replace append loops with list comprehensions

2019-02-19 Thread Lukas Geiger
New submission from Lukas Geiger : Lib uses loops to append to a new list in quite a few places. I think it would be better to replace those with list comprehensions. Benefits of this change: - List comprehensions are generally more readable than appending to a newly created list - List co

[issue36039] Replace append loops with list comprehensions

2019-02-19 Thread Paul Ganssle
Paul Ganssle added the comment: I think I'm -1 on a general project or policy to replace all for-append loops with list comprehensions, but I'm generally positive about individual improvements to the code base, on a case-by-case basis. I can't speak for anyone but myself, but I imagine that

[issue36019] test_urllib fail in s390x buildbots: http://www.example.com/

2019-02-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Here is the list of the external resources that we use in the tests. test_issue16464 (test.test_urllib2.MiscTests) ... skipped "Resource 'http://www.example.com/' is not available" test_close (test.test_urllib2net.CloseSocketTest) ... skipped "Resource 'http

[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: Python 2.7 and 3.6 have no SSLContext.minimum_version attribute (even with OpenSSL 1.1.1). I think that we will workaround this issue in Fedora and RHEL8 spec file (recipe to build RPM packages) using "export OPENSSL_CONF=/non-existing-file". -- __

[issue35153] Allow to set headers in xmlrpc.client.ServerProxy

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset beda52ed36e701e45f22903fc4d3bec0d085b25b by Victor Stinner (Cédric Krier) in branch 'master': bpo-35153: Add headers parameter to xmlrpc.client.ServerProxy (GH-10308) https://github.com/python/cpython/commit/beda52ed36e701e45f22903fc4d3bec0d085b2

[issue36035] pathlib.Path().rglob() breaks with broken symlinks

2019-02-19 Thread Jörg Stucke
Jörg Stucke added the comment: A possible solution for python 3.7+ could be to add "ELOOP" to _IGNORED_ERROS in pathlib but I'm not exactly sure of the side effects. -- ___ Python tracker ___

  1   2   3   >