[issue32554] random.seed(tuple) uses the randomized hash function and so is not reproductible

2018-06-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is what I meant. Emit a deprecation warning for input types other than explicitly supported types (but I didn't think about float), and raise an error in future. -- ___ Python tracker

[issue33933] Error message says dict has no len

2018-06-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this is an exact duplicate of issue32500. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> PySequence_Length() raises TypeError on dict type ___ Python tracker

[issue32142] heapq.heappop - documentation misleading or doesn't work

2018-06-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: We could apply David Murray's suggested wording but I don't think it would actually help anyone. There are worked out examples from basic to advanced and a detailed section on the theory as well. ISTM, that prior to reading the docs, the OP likely alread

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Tal Einat
Tal Einat added the comment: You can know that the semaphore tracker is running by sending it an invalid command and seeing the error written to stderr. The semaphore tracker either inherits sys.stderr from the parent process (if possible) or uses its own. This is a bit of a hack, but migh

[issue33468] Add try-finally contextlib.contextmanager example

2018-06-24 Thread Tal Einat
Tal Einat added the comment: A possible concrete example: Capturing sys.stdout and/or sys.stderr for testing, as in test.support.captured_output. -- nosy: +taleinat ___ Python tracker __

[issue33466] Distutils does not support the compilation of Objective-C++ (“.mm”) files

2018-06-24 Thread Ronald Oussoren
Ronald Oussoren added the comment: Patch looks good to me, and back porting to 3.6/3.7 should be safe enough. I haven't merged yet because I need to study the devguid a bit before I do so (especially w.r.t. back porting) -- components: +macOS nosy: +ned.deily, ronaldoussoren ___

[issue33468] Add try-finally contextlib.contextmanager example

2018-06-24 Thread Nick Coghlan
Nick Coghlan added the comment: Similar to closing, we have dedicated context managers for stdout and stderr redirection now: https://docs.python.org/3/library/contextlib.html#contextlib.redirect_stdout Redirecting stdin could be a good example though, since we've so far chosen not to provi

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-24 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Pablo, while this patch should fix both problems, I'm not sure how to write a regression test for this, `assert_python_ok` in https://github.com/python/cpython/pull/7865/files#diff-7d4645839a05727ebdf39226fd56e29cR97 forks the interpreter so I'm not sure I c

[issue33468] Add try-finally contextlib.contextmanager example

2018-06-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The entirely abstract example LGTM. As for concrete real word examples, the possible one is changing the current working directory: cwd = os.getcwd() try: os.chdir(target_dir) yield finally: os.chdir(cwd) -- __

[issue33833] ProactorEventLoop raises AssertionError

2018-06-24 Thread twisteroid ambassador
Change by twisteroid ambassador : -- pull_requests: +7500 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-06-24 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +7501 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: @taleinat Sadly, if the semaphore_tracker receives an invalid command, it raises and dies, making the test impossible: cmd, name = line.strip().split(b':') if cmd == b'REGISTER': cache.

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: We can easily add a 'NOOP' command to the semaphore tracker if it helps solve that issue. -- ___ Python tracker ___

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Sorry, I was wrong, it does not die. I am investigating this solution using stderr. -- ___ Python tracker ___ ___

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Additionally, as I commented in the PR, apart from the race condition I think the test should be modified so it fails if the warning is raised and not expected: >The problem is that the test was silently failing when SIGINT was >being >delivered as t

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: @pitrou I think that should be ideal. The reason is that if we send an invalid command the cache is not cleared and the semaphore tracker will warn when the process finishes which is precisely what the test is avoiding. -- ___

[issue33711] Could not find externals/db-* in msi.py on license generation

2018-06-24 Thread Anselm Kruis
Anselm Kruis added the comment: I'm build msi installers regularly and I can confirm the issue. PR 7241 is ok and should be merged. -- nosy: +anselm.kruis ___ Python tracker _

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Tal Einat
Tal Einat added the comment: For the "no-op" we'll need a way to know that it was processed. To that end, I'd make the semaphore tracker recognize a new command e.g. "PING", upon which it would write something e.g. "PONG" into its end of the pipe. -- ___

[issue33945] concurrent.futures ProcessPoolExecutor submit() blocks on results being written

2018-06-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure what happens exactly in your workload, but waiting 20 seconds when posting some data on an unbounded queue sounds enormous. -- nosy: +tomMoral ___ Python tracker _

[issue33945] concurrent.futures ProcessPoolExecutor submit() blocks on results being written

2018-06-24 Thread Thomas Moreau
Thomas Moreau added the comment: This behavior results from the fact that in 3.6, the result_queue is used to pass messages to the queue_manager_thread. This behavior has been changed in 3.7 as we rely on a _ThreadWakeup object. In 3.6, when the result_queue is filled with many large objects

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have updated the PR implementing a PONG command in the semaphore and updating the test. I have tested on the failing buildbots (gcc110.fsffrance.org) and it works. Notice that a new pipe for the child to write was needed as the child is continuously

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-06-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: Would it be reasonable for me to get started with a "mostly good enough" version using scaling and Kahan summation? from operator import sub from math import sqrt, fabs def kahan_summation(seq): # https://en.wikipedia.org/wiki/Kahan_summation_algorith

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Is it possible to notify the ping / noop reply on stderr instead of introducing a new pipe? -- ___ Python tracker ___ __

[issue31861] aiter() and anext() built-in functions

2018-06-24 Thread Joshua Bronson
Change by Joshua Bronson : -- nosy: +jab ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The process seems to use its own stderr and it cannot be captured from the parent without modifying it AFAIK. -- ___ Python tracker _

[issue32554] random.seed(tuple) uses the randomized hash function and so is not reproductible

2018-06-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm thinking of something like this: $ git diff diff --git a/Lib/random.py b/Lib/random.py index 1e0dcc87ed..f479e66ada 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -136,12 +136,17 @@ class Random(_random.Random): x ^= len(a)

[issue33951] IDLE test failing only when called by itself: HighPageTest.test_highlight_target_text_mouse

2018-06-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 2af9f5d334eeca58887d177faf0012c63a03 by Terry Jan Reedy (Tal Einat) in branch 'master': bpo-33951: IDLE test_configdialog: call page.update in setUpClass (GH-7892) https://github.com/python/cpython/commit/2af9f5d334eeca58887d177faf0012c6

[issue33951] IDLE test failing only when called by itself: HighPageTest.test_highlight_target_text_mouse

2018-06-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +7502 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue33951] IDLE test failing only when called by itself: HighPageTest.test_highlight_target_text_mouse

2018-06-24 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have modified the PR to avoid creating an extra pipe in the tracker (the pipe is created as part of the test). To allow testing with the -R option: ./python -m test test_multiprocessing_fork -v -m test_semaphore_tracker_sigint -R 3:3 I had to assur

[issue33951] IDLE test failing only when called by itself: HighPageTest.test_highlight_target_text_mouse

2018-06-24 Thread miss-islington
miss-islington added the comment: New changeset b3bac968fe5beb6e6e334903519b2c8ce5bb366b by Miss Islington (bot) in branch '3.7': bpo-33951: IDLE test_configdialog: call page.update in setUpClass (GH-7892) https://github.com/python/cpython/commit/b3bac968fe5beb6e6e334903519b2c8ce5bb366b ---

[issue33951] IDLE test failing only when called by itself: HighPageTest.test_highlight_target_text_mouse

2018-06-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +7503 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue33944] Deprecate and remove pth files

2018-06-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would also add that editable installs should not break in the process. They are important. -- nosy: +pitrou ___ Python tracker ___ ___

[issue33951] IDLE test failing only when called by itself: HighPageTest.test_highlight_target_text_mouse

2018-06-24 Thread miss-islington
miss-islington added the comment: New changeset cef5da5441776090026c735ca1c9fa277f8b9931 by Miss Islington (bot) in branch '3.6': bpo-33951: IDLE test_configdialog: call page.update in setUpClass (GH-7892) https://github.com/python/cpython/commit/cef5da5441776090026c735ca1c9fa277f8b9931 ---

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-06-24 Thread Tim Peters
Tim Peters added the comment: Raymond, I'd say scaling is vital (to prevent spurious infinities), but complications beyond that are questionable, slowing things down for an improvement in accuracy that may be of no actual benefit. Note that your original "simple homework problems for kids to

[issue33711] Could not find externals/db-* in msi.py on license generation

2018-06-24 Thread Zachary Ware
Zachary Ware added the comment: New changeset b18f09835720e14ac7d4cca1815fdcdcecd5d8d4 by Zachary Ware (native-api) in branch '2.7': bpo-33711: Fix license generation error in installer build script (GH-7241) https://github.com/python/cpython/commit/b18f09835720e14ac7d4cca1815fdcdcecd5d8d4

[issue33711] Could not find externals/db-* in msi.py on license generation

2018-06-24 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the patch, Ivan, and the review, Anselm! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue24567] random.choice IndexError due to double-rounding

2018-06-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: Attaching a patch for 3.6 and 3.7. Haven't had a chance to run timings yet. Since it involves adding code to the inner loop, presumably it will have a noticeable affect on speed. Am not sure how to test this (I don't seem to be able to reproduce the OP

[issue33944] Deprecate and remove pth files

2018-06-24 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 23, 2018, at 18:56, Nick Coghlan wrote: > > My request (wearing my "BDFL-delegate for packaging interoperability > standards" hat) is that proponents of the change resist the temptation to > view the problem that way :) > > Path files are used exten

[issue24567] random.choice IndexError due to double-rounding

2018-06-24 Thread Tim Peters
Tim Peters added the comment: There are a couple bug reports here that have been open for years, and it's about time we closed them. My stance: if any platform still exists on which "double rounding" is still a potential problem, Python _configuration_ should be changed to disable double r

[issue33952] doc Fix typo in str.upper() documentation

2018-06-24 Thread Andrés Delfino
New submission from Andrés Delfino : Doc says: Note that str.upper().isupper() might be False if s... Should say: Note that s.upper().isupper() might be False if s... PR fixes this. -- assignee: docs@python components: Documentation messages: 320395 nosy: adelfino, docs@python priori

[issue33952] doc Fix typo in str.upper() documentation

2018-06-24 Thread Andrés Delfino
Change by Andrés Delfino : -- keywords: +patch pull_requests: +7504 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue33897] Add a restart option to logging.basicConfig()

2018-06-24 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset cf67d6a934b51b1f97e72945b596477b271f70b8 by Vinay Sajip (Dong-hee Na) in branch 'master': bpo-33897: Add a 'force' keyword argument to logging.basicConfig(). (GH-7873) https://github.com/python/cpython/commit/cf67d6a934b51b1f97e72945b596477b271f70b

[issue33897] Add a restart option to logging.basicConfig()

2018-06-24 Thread Vinay Sajip
Change by Vinay Sajip : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-24 Thread Nicolas Hainaux
Nicolas Hainaux added the comment: I understand that the statement "when python starts, it runs using the C locale..." should not be correct anymore (and the doc should then be updated), but in fact this statement is still true on the systems I tested; only, the output of locale.getlocale() a

[issue31861] aiter() and anext() built-in functions

2018-06-24 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue33943] doc Add references to logging.basicConfig

2018-06-24 Thread Tal Einat
Tal Einat added the comment: New changeset a8ddf85a84364d2c660e6670a7e06621993d1fdc by Tal Einat (Andrés Delfino) in branch 'master': bpo-33943: Add references in the docs for logging.basicConfig (GH-7858) https://github.com/python/cpython/commit/a8ddf85a84364d2c660e6670a7e06621993d1fdc

[issue33943] doc Add references to logging.basicConfig

2018-06-24 Thread Tal Einat
Change by Tal Einat : -- versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue33943] doc Add references to logging.basicConfig

2018-06-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +7505 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue33943] doc Add references to logging.basicConfig

2018-06-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +7506 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue33943] doc Add references to logging.basicConfig

2018-06-24 Thread Tal Einat
Tal Einat added the comment: New changeset 66d77d8af8f7c3ebd604ad1e802b8e5006d79d8f by Tal Einat (Miss Islington (bot)) in branch '3.7': bpo-33943: Add references in the docs for logging.basicConfig (GH-7858) (GH-7900) https://github.com/python/cpython/commit/66d77d8af8f7c3ebd604ad1e802b8e50

[issue33943] doc Add references to logging.basicConfig

2018-06-24 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +7507 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue33943] doc Add references to logging.basicConfig

2018-06-24 Thread Tal Einat
Tal Einat added the comment: New changeset 73848e028de58e7fb2b38bddb1638ca2323561a9 by Tal Einat (Miss Islington (bot)) in branch '3.6': bpo-33943: Add references in the docs for logging.basicConfig (GH-7858) (GH-7899) https://github.com/python/cpython/commit/73848e028de58e7fb2b38bddb1638ca2

[issue33943] doc Add references to logging.basicConfig

2018-06-24 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +7508 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue33943] doc Add references to logging.basicConfig

2018-06-24 Thread Tal Einat
Tal Einat added the comment: New changeset aa770b7096c004abdf3c27bc361d6b60a4b668af by Tal Einat in branch '2.7': [2.7] bpo-33943: Add references in the docs for logging.basicConfig (GH-7858) (GH-7902) https://github.com/python/cpython/commit/aa770b7096c004abdf3c27bc361d6b60a4b668af --