[issue30869] regrtest: Add .idlerc to saved_test_environment

2017-07-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: #27534 is about reducing run's imports. I believe that the current patch may remove one path by which config is indirectly imported. While writing msg297983 of #30868, I remembered that config files are not the only files put in .idlerc. So a solution to

[issue30879] os.listdir(bytes) gives a list of bytes, but os.listdir(buffer) gives a list of unicodes

2017-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, I forgot that this feature already is deprecated! -- ___ Python tracker ___

[issue30868] IDLE: Improve configuration tests with mock Save.

2017-07-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: This issue began with #27173 which added test_config with CurrentColorKeysTest to test the new IdleConf.current_colors_and_keys. Those tests never called any user parser.Save, but I knew I had to remove the possibility that any future test would touch

[issue30878] The staticmethod doesn't properly reject keyword arguments

2017-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report Kay and thank you for your patch SylvainDe. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue30878] The staticmethod doesn't properly reject keyword arguments

2017-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 9648088e6ccd6d0cc04f450f55628fd8eda3784c by Serhiy Storchaka (Sylvain) in branch 'master': bpo-30878: Fix error message when keyword arguments are passed (#2635) https://github.com/python/cpython/commit/9648088e6ccd6d0cc04f450f55628fd8eda3784c

[issue30876] SystemError on importing module from unloaded package

2017-07-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- title: SystemError on importing module that deletes itself from sys.modules -> SystemError on importing module from unloaded package ___ Python tracker

[issue30880] PCG random number generator

2017-07-08 Thread Tim Peters
Tim Peters added the comment: I agree closing was appropriate at this time. I quite like PCG, but as Raymond said it's more a template for creating PRNGs than a specific generator. So even if a compelling case could be made, there's still a long way to having specific code in mind. In the

[issue30821] unittest.mock.Mocks with specs aren't aware of default arguments

2017-07-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: No need to spend time making a PR until there is a decision about whether this is something we want to do. -- assignee: -> michael.foord nosy: +rhettinger ___ Python tracker

[issue10438] list an example for calling static methods from WITHIN classes

2017-07-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: I also don't think this is worth it. The extra wording will likely cause more confusion that it clears up. Also, calling a staticmethod from within a class isn't a common thing to do. The principal use case for Python's static methods is to attach a

[issue30880] PCG random number generator

2017-07-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, the previous discussions on the MersenneTwister have all resulted in a decision to stick with it. The PCG family of PRNG is relatively new. IIRC, the paper for it was never accepted for publication and some of its bolder claims haven't been proven.

[issue8231] Unable to run IDLE without write-access to home directory

2017-07-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: #27534 is about reducing the imports into the user runcode process. Without rechecking the reason for each import, I think it possible that this might result in config not being indirectly imported. -- dependencies: +IDLE: Reduce number and time for

[issue30868] IDLE: Improve configuration tests with mock Save.

2017-07-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: Very helpful. Is there a git equivalent to hg annotate, or did you have to trudge through the commit log? -- ___ Python tracker

[issue1612262] Class Browser doesn't show internal classes

2017-07-08 Thread Cheryl Sabella
Cheryl Sabella added the comment: I created issue 30881 to add docstrings to browser.py to make creating user tests easier. -- ___ Python tracker ___

[issue30881] IDLE: add docstrings to browser.py

2017-07-08 Thread Cheryl Sabella
Changes by Cheryl Sabella : -- pull_requests: +2703 ___ Python tracker ___ ___

[issue30881] IDLE: add docstrings to browser.py

2017-07-08 Thread Cheryl Sabella
New submission from Cheryl Sabella: Add docstrings to browser.py to aid to unit test creation. -- assignee: terry.reedy components: IDLE messages: 297973 nosy: csabella, terry.reedy priority: normal severity: normal status: open title: IDLE: add docstrings to browser.py type:

[issue29854] Segfault when readline history is more then 2 * history size

2017-07-08 Thread Nir Soffer
Changes by Nir Soffer : -- pull_requests: +2702 ___ Python tracker ___ ___ Python-bugs-list

[issue29854] Segfault when readline history is more then 2 * history size

2017-07-08 Thread Nir Soffer
Changes by Nir Soffer : -- pull_requests: +2701 ___ Python tracker ___ ___ Python-bugs-list

[issue27068] Add a detach() method to subprocess.Popen

2017-07-08 Thread Martin Panter
Martin Panter added the comment: Personally, I haven’t needed this feature. But I still think it may be a decent solution for the “webbrowser” module, potentially your “asyncio” problem, and other cases that could now trigger an unwanted ResourceWarning. --

[issue30878] The staticmethod doesn't properly reject keyword arguments

2017-07-08 Thread SylvainDe
Changes by SylvainDe : -- pull_requests: +2700 ___ Python tracker ___ ___

[issue30876] SystemError on importing module that deletes itself from sys.modules

2017-07-08 Thread ppperry
Changes by ppperry : -- title: SystemError on import -> SystemError on importing module that deletes itself from sys.modules ___ Python tracker

[issue30880] PCG random number generator

2017-07-08 Thread Evelyn Mitchell
Evelyn Mitchell added the comment: Mark, thanks for the background links. My suggestion is much more constrained than the territory covered by those links. -- ___ Python tracker

[issue30868] IDLE: Improve configuration tests with mock Save.

2017-07-08 Thread Cheryl Sabella
Cheryl Sabella added the comment: If it's helpful, here's some history on Save and save_as in configdialog. -- Item: Code change which added the lines to always save 'highlight' and 'keys'. November 16, 2004, commit 5acdf9308191b6356fb3ed4ba691ba5cd391f202 commit message: Saving

[issue30878] The staticmethod doesn't properly reject keyword arguments

2017-07-08 Thread SylvainDe
SylvainDe added the comment: I have a fix ready but I'll look if other functions using _PyArg_NoKeywords may have the same defect before submitting it. -- ___ Python tracker

[issue30880] PCG random number generator

2017-07-08 Thread Mark Dickinson
Mark Dickinson added the comment: Some previous discussions: "Time for a change of random number generator": https://mail.python.org/pipermail/python-dev/2016-February/143268.html "Should our default random number generator be secure?": (warning: long)

[issue30870] IDLE: configdialog/fonts: change font when select by key up/down

2017-07-08 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> patch review type: -> enhancement versions: +Python 3.6 ___ Python tracker ___

[issue29854] Segfault when readline history is more then 2 * history size

2017-07-08 Thread Berker Peksag
Berker Peksag added the comment: New changeset 04f77d4677e7508b6ec8de9d0331fdabbcd11d30 by Berker Peksag (Nir Soffer) in branch '3.6': [3.6] bpo-29854: Fix segfault in call_readline() (GH-728) https://github.com/python/cpython/commit/04f77d4677e7508b6ec8de9d0331fdabbcd11d30 --

[issue30814] Import dotted name as alias breaks with concurrency

2017-07-08 Thread Brett Cannon
Brett Cannon added the comment: I just wanted to say thanks to everyone who helped to fix this bug. The locking situation in import is probably the trickiest part of it and has also been tweaked the most as of late and so solving these kinds of issues is tricky. --

[issue30841] A shadowing variable naming emitted for Python-ast.c

2017-07-08 Thread Brett Cannon
Changes by Brett Cannon : -- type: compile error -> enhancement ___ Python tracker ___ ___

[issue30841] A shadowing variable naming emitted for Python-ast.c

2017-07-08 Thread Brett Cannon
Changes by Brett Cannon : -- priority: normal -> low ___ Python tracker ___ ___

[issue30876] SystemError on import

2017-07-08 Thread Brett Cannon
Brett Cannon added the comment: So this is very old semantics from the Python 2 days. I think Nick's idea of transforming the import to `import pkg.mod` when pkg isn't in sys.modules is probably the simplest, cleanest solution if we're going to change this. --

[issue30876] SystemError on import

2017-07-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: I concur with Serhiy: SystemError is a smell that C code isn't taking appropriate precautions before dealing with user code or data. -- nosy: +pitrou ___ Python tracker

[issue30879] os.listdir(bytes) gives a list of bytes, but os.listdir(buffer) gives a list of unicodes

2017-07-08 Thread Armin Rigo
Armin Rigo added the comment: I've also been pointed to https://bugs.python.org/issue26800 . -- ___ Python tracker ___

[issue30880] PCG random number generator

2017-07-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Extension Modules nosy: +mark.dickinson, rhettinger versions: +Python 3.7 ___ Python tracker

[issue30879] os.listdir(bytes) gives a list of bytes, but os.listdir(buffer) gives a list of unicodes

2017-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good catch Armin! PR 2634 fixes this inconsistency. Maybe it is worth to deprecate support of other bytes-like object except bytes. open(), os.fspath() and os.path functions don't support them. -- nosy: +serhiy.storchaka stage: -> patch review

[issue30879] os.listdir(bytes) gives a list of bytes, but os.listdir(buffer) gives a list of unicodes

2017-07-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +2699 ___ Python tracker ___ ___

[issue30880] PCG random number generator

2017-07-08 Thread Evelyn Mitchell
New submission from Evelyn Mitchell: John Cook tested the quality of the PCG Random Number generator (http://www.pcg-random.org/index.html) and it appears to have good performance. His report is at: https://www.johndcook.com/blog/2017/07/07/testing-the-pcg-random-number-generator/ This is a

[issue30879] os.listdir(bytes) gives a list of bytes, but os.listdir(buffer) gives a list of unicodes

2017-07-08 Thread Alex Gaynor
Changes by Alex Gaynor : -- nosy: +alex ___ Python tracker ___ ___ Python-bugs-list

[issue30879] os.listdir(bytes) gives a list of bytes, but os.listdir(buffer) gives a list of unicodes

2017-07-08 Thread Armin Rigo
New submission from Armin Rigo: The ``os`` functions generally accept any buffer-supporting object as file names, and interpret it as if ``bytes()`` had been called on it. However, ``os.listdir(x)`` uses the type of ``x`` to know if it should return a list of bytes or a list of

[issue30875] round(number[, digits]) does not return value with >12 decimal places

2017-07-08 Thread john Forgue
john Forgue added the comment: I found a programming issue that circumvented the round function. As for the terminal "verification" I reported I'm not sure what I did and cannot repeat. Sorry for the false alarm. John -- resolution: -> works for me stage: -> resolved status:

[issue29854] Segfault when readline history is more then 2 * history size

2017-07-08 Thread Nir Soffer
Changes by Nir Soffer : -- pull_requests: +2698 ___ Python tracker ___ ___ Python-bugs-list

[issue30875] round(number[, digits]) does not return value with >12 decimal places

2017-07-08 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___

[issue30522] Allow replacing a logging.StreamHandler's stream

2017-07-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Vinay, yes, that sounds fine to me. -- ___ Python tracker ___ ___

[issue30522] Allow replacing a logging.StreamHandler's stream

2017-07-08 Thread Vinay Sajip
Vinay Sajip added the comment: How about this as an API? def setStream(self, stream): """ Sets the StreamHandler's stream to the specified value, if it is different. Returns the old stream, if the stream was changed, or None if it wasn't. """

[issue30444] Add ability to change "-- more --" text in pager module

2017-07-08 Thread Gautam krishna.R
Gautam krishna.R added the comment: Thank you! closing this due to inncativity.. -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29854] Segfault when readline history is more then 2 * history size

2017-07-08 Thread Berker Peksag
Berker Peksag added the comment: New changeset aa6a4d6ed881f79c51fb91dd928ed9496737b420 by Berker Peksag (Nir Soffer) in branch 'master': bpo-29854: Skip history-size test on older readline (GH-2621) https://github.com/python/cpython/commit/aa6a4d6ed881f79c51fb91dd928ed9496737b420 --

[issue30873] `SystemError: returned NULL without setting an error` from importing _pickle on Windows

2017-07-08 Thread ppperry
Changes by ppperry : -- title: `SystemError: returned NULL without setting an error` from importing _pickle -> `SystemError: returned NULL without setting an error` from importing _pickle on Windows ___ Python tracker

[issue30873] `SystemError: returned NULL without setting an error` from importing _pickle

2017-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, this is Windows-only _imp.create_builtin(). -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker

[issue30873] `SystemError: returned NULL without setting an error` from importing _pickle

2017-07-08 Thread ppperry
ppperry added the comment: Interesting. For you, `_pickle` seems to be an extension module, which is thus trying to call `imp.create_dynamic`, whereas for me it is a builtin module. Perhaps that explains why you get a KeyError and I get a SystemError (my traceback ends with): File

[issue30877] possibe typo in json/scanner.py

2017-07-08 Thread c-fos
c-fos added the comment: Test independent from _json library: import unittest from json.decoder import JSONDecoder from json.scanner import py_make_scanner class Memo_Test(unittest.TestCase): def test_for_empty_memo(self): json_str = '{"a": 1}' decoder = JSONDecoder()

[issue30877] possibe typo in json/scanner.py

2017-07-08 Thread c-fos
c-fos added the comment: The possible test: import unittest from json.decoder import JSONDecoder class Memo_Test(unittest.TestCase): def test_for_empty_memo(self): json_str = '{"a": 1}' decoder = JSONDecoder() decoder.decode(json_str)

[issue26528] NameError for built in function open when re-raising stored exception from yielded function

2017-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The interpreter makes a copy of the builtins module dict at startup and restores it at shutdown. open() is imported from the io module after making the copy, and therefore it is absent in restored module. -- nosy: +haypo, pitrou, serhiy.storchaka

[issue10438] list an example for calling static methods from WITHIN classes

2017-07-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___

[issue30877] possibe typo in json/scanner.py

2017-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good catch c-fos! The scan_once() wrapper was introduced in issue7451, but py_make_scanner() still returns unwrapped _scan_once(). Is it possible to write a test that catches this bug? -- nosy: +pitrou, serhiy.storchaka stage: -> patch review

[issue30878] The staticmethod doesn't properly reject keyword arguments

2017-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is similar to recently fixed issue30534 and issue30627. The solution is simple as for issue30627. -- keywords: +easy (C) nosy: +SylvainDe, serhiy.storchaka stage: -> needs patch type: -> enhancement versions: +Python 3.7 -Python 3.6

[issue30876] SystemError on import

2017-07-08 Thread Nick Coghlan
Nick Coghlan added the comment: If there are intermittent concurrent problems associated with this behaviour, I think that may be a sign that the current management of the per-module import locks is inadequate, since it isn't adequately accounting for direct manipulation of sys.modules in

[issue30878] The staticmethod doesn't properly reject keyword arguments

2017-07-08 Thread Kay Hayen
New submission from Kay Hayen: Check out this: python3.6 -c "staticmethod(function=1)" Traceback (most recent call last): File "", line 1, in TypeError: staticmethod expected 1 arguments, got 0 python3.6 -c "staticmethod()" Traceback (most recent call last): File "", line 1, in

[issue30877] possibe typo in json/scanner.py

2017-07-08 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +2697 ___ Python tracker ___

[issue30877] possibe typo in json/scanner.py

2017-07-08 Thread PilatFirst
New submission from PilatFirst: Should "py_make_scanner" return "scan_once" function rather than "_scan_once"? -- components: Library (Lib) messages: 297945 nosy: PilatFirst priority: normal severity: normal status: open title: possibe typo in json/scanner.py type: enhancement versions:

[issue30876] SystemError on import

2017-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't know other way to provoke SystemError by Python code. Always if SystemError was leaked this considered a bug and was fixed. When unload package you need to remove its name and names of its submodules from sys.modules. This is a common case. If the

[issue30876] SystemError on import

2017-07-08 Thread Nick Coghlan
Nick Coghlan added the comment: To summarise what the attached source archive is doing, module1.py is essentially: import sys del sys.modules(__package__) from . import module2 So the only way to trigger this is by corrupting the import state, which seems like an appropriate use

[issue30876] SystemError on import

2017-07-08 Thread Nick Coghlan
Nick Coghlan added the comment: I don't think we're that strict with SystemError - once folks are messing about with deleting things from the sys module, they *are* writing their own system level code, and may end up provoking SystemError if they corrupt the interpreter state in the process.