[issue34922] hashlib segmentation fault

2018-10-07 Thread shuoz
shuoz added the comment: I send this to secur...@python.org. Victor Stinner response me. "import hashlib; hashlib.shake_128().hexdigest((-1)&2**64-1)" can crash python3.7 and master ``` fan@fan:~/github/new$ ./py3.7/bin/python3 Python 3.7.1rc1+ (heads/3.7:c59e75c, Oct 8 2018, 08:53:13)

[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-07 Thread Ned Deily
Ned Deily added the comment: Both 3.7.1rc2 and 3.6.7rc2 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34925] 25% speed-up to common case bisect()

2018-10-07 Thread Raymond Hettinger
New submission from Raymond Hettinger : The common case for bisect calls is to have two positional arguments and no keyword arguments. For this case, PyArg_ParseTupleAndKeywords() is unnecessarily expensive. Timings --- $ pytime -r 11 -s 'from bisect import bisect' -s

[issue34925] 25% speed-up to common case for bisect()

2018-10-07 Thread Raymond Hettinger
Change by Raymond Hettinger : -- title: 25% speed-up to common case bisect() -> 25% speed-up to common case for bisect() ___ Python tracker ___

[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: >> The only thing here is that '-I' returns '-s -E -I' unlike other options >> where args can be used for comparison logic in check_options. > Karthikeyan, do you happen to have a use case where this might come into > action? I don't have a use

[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-07 Thread Ned Deily
Ned Deily added the comment: Is there any reason this issue needs to remain open? Or can we at least remove the "release blocker" priority? -- ___ Python tracker ___

[issue34925] 25% speed-up to common case bisect()

2018-10-07 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +9139 stage: -> patch review ___ Python tracker ___ ___

[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Benjamin, I'm dubious about this going forward, but it is up to you. -- assignee: -> benjamin.peterson ___ Python tracker ___

[issue34924] inspect.signature isn't aware that types.MethodType can wrap any callable

2018-10-07 Thread Dan Snider
New submission from Dan Snider : I actually noticed this due to it confusingly breaking IDLE call tips and code completion. >>> import inspect >>> from types import MethodType >>> bound_len = MethodType(len, 'abc') >>> bound_len() 3 >>> inspect.signature(bound_len) >>>

[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-07 Thread Yury Selivanov
Yury Selivanov added the comment: Closing it now, Ned, thanks! I assume it will make it into 3.7.1rc2, right? -- priority: release blocker -> normal resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue34751] Hash collisions for tuples

2018-10-07 Thread Tim Peters
Tim Peters added the comment: Here's htest.py output from git pull https://github.com/jdemeyer/cpython.git bpo34751 and a variation. The number of collisions in the variation appear in square brackets at the end of each line. 32-bit build: range(100) by 3; 32-bit hash codes; mean 116.42

[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-07 Thread Danish Prakash
Danish Prakash added the comment: You're right Karthikeyan, although I personally think that returning ['-s', '-E', '-I'] should be a plausible solution here since it has been stated explicitly that it implies '-s' and '-E' but I'm still waiting for what Victor has to say on this. > The

[issue30588] Missing documentation for codecs.escape_decode

2018-10-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: -1 Internal function means: you can use it on your risk but the function can be changed or even removed in any Python release. I see no point in documenting and making it public. -- nosy: +asvetlov ___ Python

[issue22232] str.splitlines splitting on non-\r\n characters

2018-10-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't like the idea of adding a second bool parameter to splitlines. Guido has a rough rule of thumb (which I agree with) of "no constant bool parameters". If people will typically call a function with some sort of "mode" parameter using a hard-coded

[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread Ismo Toijala
New submission from Ismo Toijala : The following example should work but does not. Note that it does work without the future import. from __future__ import annotations import typing def f() -> typing.NoReturn: pass typing.get_type_hints(f) Traceback (most recent call last): File

[issue28716] Fractions instantiation revisited

2018-10-07 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34831] Asyncio Tutorial

2018-10-07 Thread Caleb Hattingh
Caleb Hattingh added the comment: I set up a basic structure under "Doc/library/asyncio-tutorial" as suggested, and opened a PR to show you how that looks. When I make more progress on a section, I'll post an update here. -- ___ Python tracker

[issue34920] PYTHONWARNINGS entries are escaped

2018-10-07 Thread Nikolaus Rath
New submission from Nikolaus Rath : According to https://docs.python.org/3/library/warnings.html#describing-warning-filters: "The meaning of each of these fields [of PYTHONWARNINGS] is as described in ." The description of the "The Warnings filter" says "module is a string containing a

[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-07 Thread Danish Prakash
Danish Prakash added the comment: Thanks for the concise explanation, that makes sense. > Also there will be no binary releases and only source releases for security > only branches. Is there any particular reason as to why this happens? IS it just to make it easier for the team to focus

[issue34831] Asyncio Tutorial

2018-10-07 Thread Caleb Hattingh
Caleb Hattingh added the comment: I tested the Python 3.7.0 release version for Mac, the download called "macOS 64-bit installer" with checksum ae0717a02efea3b0eb34aadc680dc498 on this page: https://www.python.org/downloads/release/python-370/ I downloaded, installed that on a mac, and the

[issue34922] hashlib segmentation fault

2018-10-07 Thread shuoz
New submission from shuoz : python hashlib a signd overflow maybe cause a memory over read. python version: Python 3.6.7rc1+ (heads/3.6:cb0bec3, Oct 1 2018, 02:19:39) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. ```

[issue34920] PYTHONWARNINGS entries are escaped

2018-10-07 Thread Nikolaus Rath
Nikolaus Rath added the comment: yes, this is a duplicate. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34919] Crash caused by certain characters in a string

2018-10-07 Thread cwickens
New submission from cwickens : Clone the following repo and follow the repro steps described in the readme: https://github.com/oTree-org/py37bug It seems that using certain non-ASCII characters in parts of a string crashes Python. In the README I listed the strings that are OK and those that

[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2018-10-07 Thread Nikolaus Rath
Change by Nikolaus Rath : -- nosy: +nikratio title: -W option does not accept module regexes -> -W option and PYTHONWARNINGS env variable does not accept module regexes ___ Python tracker

[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-07 Thread Danish Prakash
Danish Prakash added the comment: > I expect to get: ['-I'] instead of ['-s', '-E', '-I'] >From what I understand, this can be done in one of two ways. First, we could >edit >https://github.com/python/cpython/blob/ad73a9cf97770023665a1bb1c6390a3c99478139/Modules/main.c#L430 > and not

[issue34831] Asyncio Tutorial

2018-10-07 Thread Caleb Hattingh
Change by Caleb Hattingh : -- keywords: +patch pull_requests: +9134 stage: -> patch review ___ Python tracker ___ ___

[issue34920] PYTHONWARNINGS entries are escaped

2018-10-07 Thread Martin Panter
Martin Panter added the comment: Déjà vu. Maybe duplicate of Issue 34624? -- nosy: +martin.panter superseder: -> -W option does not accept module regexes ___ Python tracker

[issue34861] Improve cProfile standard output

2018-10-07 Thread Anders Hovmöller
Anders Hovmöller added the comment: Output before this patch: 3666 function calls (3556 primitive calls) in 0.005 seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function) 20.0000.0000.0020.001

[issue33084] Computing median, median_high an median_low in statistics library

2018-10-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: I want to revisit this for 3.8. I agree that the current implementation-dependent behaviour when there are NANs in the data is troublesome. But I don't think that there is a single right answer. I also agree with Mark that if we change median, we ought to

[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: >> Also there will be no binary releases and only source releases for security >> only branches. > Is there any particular reason as to why this happens? IS it just to make it > easier for the team to focus on the development of current versions

[issue34751] Hash collisions for tuples

2018-10-07 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: I updated PR 9471 with a tuple hash function based on xxHash. The only change w.r.t. the official xxHash specification is that I'm not using parallellism and just using 1 accumulator. Please have a look. -- ___

[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-07 Thread Pranav Devarakonda
Pranav Devarakonda added the comment: > One possibility is to add a type check to the generated code, "send(x)" -> > send(x.encode() if type(x)==bytes else x)" That would have solved the problem. However we cannot check the type of the object while the parsing is going on. For example,

[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread noah
Change by noah : -- keywords: +patch pull_requests: +9136 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-07 Thread Pranav Devarakonda
Pranav Devarakonda added the comment: I am sorry. I got you completely wrong with this > "One possibility is to add a type check to the generated code" I thought you were asking to check the type in the fixer itself. I get it now. So you meant to add the type check for the changed/generate

[issue34922] hashlib segmentation fault

2018-10-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +9138 stage: -> patch review ___ Python tracker ___ ___

[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread noah
noah added the comment: Is this a feature request? Because it doesn't look like a bug to me. Where NoReturn is defined it says it's supposed to fail in static type checkers. Anyway, I'm not entirely sure on the whole process of contributing but here goes: The code ultimately fails at

[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-07 Thread Ned Deily
Ned Deily added the comment: The question remains if Christian's and Victor's concern with 3.7 compatibility have been satisfied by Serihy's response in msg322798. While there is plenty of time to resolve concerns about what was merged into master by PR 8346, we shouldn't release the PR

[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have reviewed PR 8346 yet one time. No documented working behavior was changed. Some documentation was updated to match the code, some code was updated to match the documentation, and other minor errors were fixed. I don't think this change breaks

[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Other variant of the crash in issue34922 still is reproducible in 3.7. -- ___ Python tracker ___

[issue34903] strptime %d handling of single digit day of month

2018-10-07 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +9133 stage: -> patch review ___ Python tracker ___ ___

[issue6721] Locks in the standard library should be sanitized on fork

2018-10-07 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 3b699932e5ac3e76031bbb6d700fbea07492641d by Gregory P. Smith (Miss Islington (bot)) in branch '3.7': bpo-6721: Hold logging locks across fork() (GH-4071) (#9291)

[issue34898] add mtime argument to gzip.compress

2018-10-07 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34922] hashlib segmentation fault

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

[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-07 Thread miss-islington
miss-islington added the comment: New changeset c59e75ccf0ea8d882738214e0385f41eed51e3c7 by Miss Islington (bot) in branch '3.7': bpo-34901: add isolated (-I) flag to sys.flags (GH-9708) https://github.com/python/cpython/commit/c59e75ccf0ea8d882738214e0385f41eed51e3c7 -- nosy:

[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-07 Thread miss-islington
Change by miss-islington : -- pull_requests: +9135 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34922] hashlib segmentation fault

2018-10-07 Thread Ned Deily
Change by Ned Deily : -- priority: normal -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34922] hashlib segmentation fault

2018-10-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Sorry Ned, my comment seems to have changed the priority while submitting the comment. I would also propose adding the attached report as a unit test. -- ___ Python tracker

[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > From what I understand, this can be done in one of two ways. First, we could > edit > https://github.com/python/cpython/blob/ad73a9cf97770023665a1bb1c6390a3c99478139/Modules/main.c#L430 > and not incrementing -s and -E. But I believe this would

[issue34923] Decimal Multiplication problems: Wrong solution

2018-10-07 Thread Shadow Raven
New submission from Shadow Raven : Some decimals, when multiplied with others, give wrong solutions: 6.23*5 = 31.152 6.89*5 = 34.446 There are more but I can't list all. -- messages: 327290 nosy: Shadow Raven priority: normal severity: normal status: open

[issue34923] Decimal Multiplication problems: Wrong solution

2018-10-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report. I think this a known limitation and not a bug. Please read more about floating point limitation at https://docs.python.org/3/tutorial/floatingpoint.html . I would propose closing this. Similar issue reported few days back :

[issue34923] Decimal Multiplication problems: Wrong solution

2018-10-07 Thread Shadow Raven
Shadow Raven added the comment: Oh okay thanks -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report. I am adding Ivan who might have a better explanation since this is related to typing and type(NoReturn) has with __future__ import and without __future__. Ivan, feel free to remove yourself if this irrelevant. --

[issue34922] hashlib segmentation fault

2018-10-07 Thread Ned Deily
Ned Deily added the comment: See also Issue33729. We need this addressed for 3.6.7. -- nosy: +christian.heimes, ned.deily, serhiy.storchaka priority: normal -> release blocker ___ Python tracker

[issue34831] Asyncio Tutorial

2018-10-07 Thread Ned Deily
Ned Deily added the comment: Yury, based on the file paths, you appear to be running a MacPorts python3.7. Like many other third-party distributors (but unlike the python.org installers), MacPorts separates Tkinter support into a separately-installable component. Try: port install

[issue34922] hashlib segmentation fault

2018-10-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report. Interesting, this is not reproducible on master and latest 3.7 branches though both have different errors but reproducible in latest 3.6 and v3.7.0 . As Ned noted this seems to have been fixed with issue33729 but still there

[issue34831] Asyncio Tutorial

2018-10-07 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury, based on the file paths, you appear to be running a MacPorts python3.7. > Like many other third-party distributors (but unlike the python.org > installers), MacPorts separates Tkinter support into a separately-installable > component. Try:

[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-07 Thread Ned Deily
Ned Deily added the comment: OK. This is now blocking the release of 3.7.1rc2 and 3.6.7rc2. See also Issue34922. -- priority: normal -> release blocker ___ Python tracker

[issue34919] Crash caused by certain characters in a string

2018-10-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report. Can you please try this with 3.7.0 RC1 to see if it's reproducible? I think this similar to issue34087 that was present only in 3.7 and master which also has a Django project. There was a similar report with issue34241 with

[issue34922] hashlib segmentation fault

2018-10-07 Thread Ned Deily
Ned Deily added the comment: No problem; that's something to watch out for when you get an update conflict message from the bug tracker! Regarding this issue, I believe Serhiy is going to do a PR but perhaps you can work with him on providing the test case. --

[issue34923] Decimal Multiplication problems: Wrong solution

2018-10-07 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> not a bug ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I have tweaked that fixer to handle the pointed cases > and a few additional ones too Playing whack-a-mole with a few cases will always fall short of being able to guarantee correct transformations and not break existing code that is working

[issue34922] hashlib segmentation fault

2018-10-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka components: +Extension Modules -Demos and Tools type: security -> crash versions: +Python 3.7, Python 3.8 ___ Python tracker

[issue34922] hashlib segmentation fault

2018-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The original crash is nor reproducible in 3.7 and master, but Victor found other example that causes a crash in 3.7 and master. import hashlib; hashlib.shake_128().hexdigest(2*64-10) Use 2*32-10 on 32-bit platforms. I suppose that passing 2**29 on

[issue34922] hashlib segmentation fault

2018-10-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34795] loop.sock_recv failure because of delayed callback handling

2018-10-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: Yuri, do you mean `socket._io_refs` manipulations? -- ___ Python tracker ___ ___

[issue22232] str.splitlines splitting on non-\r\n characters

2018-10-07 Thread Neil Schemenauer
Neil Schemenauer added the comment: I too would prefer a new method name rather than overloading splitlines() with more keyword args (passed as hardcoded constants, usually). Again, I think we want: list(open(..).read().()) == list(open(..)) readlines() returns a list but I think this

[issue34795] loop.sock_recv failure because of delayed callback handling

2018-10-07 Thread Yury Selivanov
Yury Selivanov added the comment: yes -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34795] loop.sock_recv failure because of delayed callback handling

2018-10-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: Looks like a hack but we have no choice -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue34751] Hash collisions for tuples

2018-10-07 Thread Tim Peters
Tim Peters added the comment: Attaching htest.py so we have a common way to compare what various things do on the tests that have been suggested. unittest sucks for that. doctest too. Here's current code output from a 32-bit build; "ideally" we want "got" values not much larger than

[issue34849] Drop logging when asyncio waits in selector.select()

2018-10-07 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___