[issue22707] Idle: changed options should take effect immediately

2017-08-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: I looked at the how the num_spaces and current General options are defined, set, and updated. editor-on-startup: local name in pyshell.main. width, height: used in text_options, passed to MultiCallCreator(Text). (Width is EW() attribute, initialized in

[issue31297] Unpickleable ModuleImportError in unittest patch not backported to 2.7

2017-08-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +pitrou ___ Python tracker ___ ___

[issue31291] zipimport.zipimporter.get_data() crashes when path.replace() returns a non-str

2017-08-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oren already fixed several similar problems and he is aware of difference between a crash and an exception. The problem is Windows specific. The current code uses Unicode C API with the result of calling the replace method. This can cause a segfault (or may

[issue22707] Idle: changed options should take effect immediately

2017-08-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: To expand on the initial statement, changes can take effect a) when IDLE start (the initial window option), b) when a new editor window is created (the initial size option), c) immediately for all editors (indent size and most others), and d) immediately for

[issue31298] Error when calling numpy.astype

2017-08-28 Thread Daniel
New submission from Daniel: Ubuntu 16.04.3 Python 3.5.2 Numpy version 1.11.0 Running the following two commands causes Python to crash: import numpy as np np.array([[1, 2],[3,4]]).astype(np.dtype([("a", np.float), ("b", np.str_)])) The error occurs when running in an interactive session and

[issue31297] Unpickleable ModuleImportError in unittest patch not backported to 2.7

2017-08-28 Thread Rachel Tobin
New submission from Rachel Tobin: When running the unittest runner in parallel with an module import error present in your code, this exception is raised: _pickle.PicklingError: Can't pickle : attribute lookup ModuleImportFailure on unittest.loader failed unittest should be raising standard

[issue31296] support pty.fork and os.forkpty actions in posix subprocess module

2017-08-28 Thread Gregory P. Smith
New submission from Gregory P. Smith: The PyPI pexpect.spawn API is incompatible with multithreaded code thanks to its dependency on pty.fork() and running non async signal safe code between fork() and exec(). https://github.com/pexpect/ptyprocess/issues/43

[issue31291] zipimport.zipimporter.get_data() crashes when path.replace() returns a non-str

2017-08-28 Thread Brett Cannon
Changes by Brett Cannon : -- title: an assertion failure in zipimport.zipimporter.get_data() -> zipimport.zipimporter.get_data() crashes when path.replace() returns a non-str ___ Python tracker

[issue31291] an assertion failure in zipimport.zipimporter.get_data()

2017-08-28 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: rejected -> stage: resolved -> status: closed -> open ___ Python tracker ___

[issue31291] an assertion failure in zipimport.zipimporter.get_data()

2017-08-28 Thread Brett Cannon
Brett Cannon added the comment: Could you paste in what the crash looks like? E.g. is it a segfault, SystemError, etc.? And you can tweak the PR or just open a new one if you would rather that fixes the crash itself without taking away duck typing. --

[issue31291] an assertion failure in zipimport.zipimporter.get_data()

2017-08-28 Thread Oren Milman
Oren Milman added the comment: just checked, and indeed on my Windows 10 the original code I posted here crashes the interpreter. The patch in the PR undermines duck-typing, and that's why I added a comment there, stating I wasn't sure about the patch. an alternate solution would be to simply

[issue31291] an assertion failure in zipimport.zipimporter.get_data()

2017-08-28 Thread Brett Cannon
Brett Cannon added the comment: If it will crash the interpreter then that's different. If that turns out to be the case then please come back here and we can rework the issue and PR to prevent that by being better about checking return values or resulting exception cases. --

[issue31295] typo in __hash__ docs

2017-08-28 Thread R. David Murray
R. David Murray added the comment: No, it is correct as worded. It is talking about the default methods. With the default methods, x == y implies that x is y. -- nosy: +r.david.murray resolution: -> not a bug stage: -> resolved status: open -> closed

[issue31291] an assertion failure in zipimport.zipimporter.get_data()

2017-08-28 Thread Oren Milman
Oren Milman added the comment: I understand that our goal is to make Python better, not to make me happier :) anyway, I haven't checked, but I am quite sure that similar code might crash the interpreter on a release build of Python. (just wanted to clarify that, as you used the term

[issue31291] an assertion failure in zipimport.zipimporter.get_data()

2017-08-28 Thread Brett Cannon
Brett Cannon added the comment: I don't think this is a bad thing. This is duck-typing at work to be flexible where the type doesn't really matter, just the provided interface. If someone happens to provide an object that doesn't do the right thing then that's their fault for using the wrong

[issue31295] typo in __hash__ docs

2017-08-28 Thread Antony Lee
New submission from Antony Lee: In https://docs.python.org/3.7/reference/datamodel.html#object.__hash__ I think x.__hash__() returns an appropriate value such that x == y implies both that x is y and hash(x) == hash(y). should be x.__hash__() returns an appropriate value such that x == y and

[issue31294] ZeroMQSocketListener and ZeroMQSocketHandler examples in the Logging Cookbook not working

2017-08-28 Thread Pablo
New submission from Pablo: There are two documentation issues regarding the ZeroMQSocketListener and ZeroMQSocketHandler examples in the Logging Cookbook: The first issue is that in the 'init' method for the 'ZeroMQSocketListener' the base class 'init' is never called and therefore the

[issue16217] Tracebacks are unnecessarily verbose when using 'python -m'

2017-08-28 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: Since runpy also handles the execution of directories and zip files, I think it would be reasonable to clean up tracebacks in these cases, too. The ignore_modules argument would be a great addition to the traceback module. Should I create a separate

[issue31293] crashes in multiply_float_timedelta() and in truedivide_timedelta_float()

2017-08-28 Thread Oren Milman
Oren Milman added the comment: I guess you meant for me to check whether the following has any problem: import decimal class BadFloat(float): def as_integer_ratio(self): return 1 << 1000 decimal.Decimal.from_float(BadFloat()) so it doesn't crash. if IIUC, this is because the C

[issue31293] crashes in multiply_float_timedelta() and in truedivide_timedelta_float()

2017-08-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please check if there is similar issue with Decimal. -- ___ Python tracker ___

[issue30737] Update devguide link to the new URL

2017-08-28 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- stage: needs patch -> patch review versions: -Python 3.5 ___ Python tracker ___

[issue3037] in output

2017-08-28 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: -3271 ___ Python tracker ___ ___

[issue30737] Update devguide link to the new URL

2017-08-28 Thread Lisa Hewus
Changes by Lisa Hewus : -- pull_requests: +3272 ___ Python tracker ___ ___ Python-bugs-list

[issue3037] in output

2017-08-28 Thread Lisa Hewus
Changes by Lisa Hewus : -- pull_requests: +3271 ___ Python tracker ___ ___ Python-bugs-list

[issue30421] argparse: relative include of config files

2017-08-28 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +bethard versions: -Python 3.5 ___ Python tracker ___

[issue31293] crashes in multiply_float_timedelta() and in truedivide_timedelta_float()

2017-08-28 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +3270 ___ Python tracker ___ ___

[issue31293] crashes in multiply_float_timedelta() and in truedivide_timedelta_float()

2017-08-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't know if there is a list, but definitely the parser, the compiler, the evaluation loop, builtin types and few builtin modules (like builtins and sys) are interpreter core. The _datetime module is an accelerator of the datetime module. It is optional

[issue31293] crashes in multiply_float_timedelta() and in truedivide_timedelta_float()

2017-08-28 Thread Oren Milman
Oren Milman added the comment: i am working on a patch. BTW, is there anywhere a list of what counts as an extension module, and what counts as the interpreter core? -- ___ Python tracker

[issue31293] crashes in multiply_float_timedelta() and in truedivide_timedelta_float()

2017-08-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Extension Modules -Interpreter Core ___ Python tracker ___

[issue31293] crashes in multiply_float_timedelta() and in truedivide_timedelta_float()

2017-08-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +belopolsky, serhiy.storchaka stage: -> needs patch ___ Python tracker ___

[issue31293] crashes in multiply_float_timedelta() and in truedivide_timedelta_float()

2017-08-28 Thread Oren Milman
New submission from Oren Milman: both of the following true division and multiplication operations crash the interpreter: import datetime class BadFloat(float): def as_integer_ratio(self): return (1 << 1000) - 1 datetime.timedelta() / BadFloat() datetime.timedelta() * BadFloat()

[issue31292] `python setup.py check --restructuredtext` fails when a include directive is present.

2017-08-28 Thread flying sheep
New submission from flying sheep: If I have a setup.py containing a include directive, and use the command in the title, I get Traceback (most recent call last): [...] File "/usr/lib/python3.6/site-packages/docutils/parsers/rst/directives/misc.py", line 59, in run source_dir =

[issue10746] ctypes c_long & c_bool have incorrect PEP-3118 type codes

2017-08-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Pauli, do you want to submit backport PRs? This can be done using the cherry_picker script: https://devguide.python.org/committing/?highlight=cherry_picker#backporting-changes-to-an-older-version -- ___ Python

[issue10746] ctypes c_long & c_bool have incorrect PEP-3118 type codes

2017-08-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 07f1658aa09f6798793c473c72b2951b7fefe220 by Antoine Pitrou (Pauli Virtanen) in branch 'master': bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (#31)

[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-08-28 Thread Oren Milman
Oren Milman added the comment: ISTM that your solution is better than mine, Serhiy, so I updated the PR. -- ___ Python tracker ___

[issue31272] typing module conflicts with __slots__-classes

2017-08-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: It is listed in Misc/NEWS as "minor bug fixes" in typing module, I don't think this is something that deserves a separate line in release notes. -- resolution: -> out of date stage: -> resolved status: open -> closed

[issue31282] C APIs called without GIL in PyOS_Readline

2017-08-28 Thread Xiang Zhang
Xiang Zhang added the comment: >>> I fixed Python 3, no? Yes. In Python3 they are replaced by PyMem_RawMalloc. But it's not only PyMem_Malloc, there are also PyErr_SetString, PyErr_NoMemory, even in Python3. BTW, even in Python3, when memory allocators are in debug mode, it finally calls

[issue31209] MappingProxyType can not be pickled

2017-08-28 Thread Alex Hayes
Alex Hayes added the comment: Closing issue - thanks rhettinger -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue31272] typing module conflicts with __slots__-classes

2017-08-28 Thread Ilia Korvigo
Ilia Korvigo added the comment: Indeed, this issue has been fixed. Anyway, it is not mentioned in any release notes. Perhaps, this should be mentioned somewhere. > On 25 Aug 2017, at 21:43, Ivan Levkivskyi wrote: > > > Ivan Levkivskyi added the comment: > > I think

[issue31282] C APIs called without GIL in PyOS_Readline

2017-08-28 Thread STINNER Victor
STINNER Victor added the comment: You must hold the GIL to call PyMem_Malloc(). A debug assert should be raised if you don't hold the GIL since Python 3.6 with PYTHONMALLOC=debug. Call PyMem_RawMalloc(). I fixed Python 3, no? For Python 2, in practice you can call PyMem_Malloc() without

[issue31291] an assertion failure in zipimport.zipimporter.get_data()

2017-08-28 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +3269 ___ Python tracker ___ ___

[issue31291] an assertion failure in zipimport.zipimporter.get_data()

2017-08-28 Thread Oren Milman
New submission from Oren Milman: on Windows, assuming the file 'foo.zip' exists, the following would cause an assertion failure in Modules/zipimport.c in zipimport_zipimporter_get_data_impl(): import zipimport class BadStr(str): def replace(self, old, new): return 42

[issue30987] Support for ISO-TP protocol in SocketCAN

2017-08-28 Thread Christian Heimes
Changes by Christian Heimes : -- stage: patch review -> commit review ___ Python tracker ___

[issue30987] Support for ISO-TP protocol in SocketCAN

2017-08-28 Thread Christian Heimes
Christian Heimes added the comment: New changeset a30f6d45ac3e72761b96a8df0527182029eaee24 by Christian Heimes (Pier-Yves Lessard) in branch 'master': bpo-30987 - Support for ISO-TP protocol in SocketCAN (#2956) https://github.com/python/cpython/commit/a30f6d45ac3e72761b96a8df0527182029eaee24

[issue31290] segfault on missing library symbol

2017-08-28 Thread Richard
New submission from Richard: I'm building a Python library with a C++ component composed of a number of source .cpp files. After some changes today, compiling and loading in Python3 resulted in a segfault: Python 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170118] on linux Type

[issue19431] Document PyFrame_FastToLocals() and PyFrame_FastToLocalsWithError()

2017-08-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PyFrameObject already is documented in Doc/c-api/veryhigh.rst. PyFrame_GetLineNumber() already is documented in Doc/c-api/reflection.rst. PyFrame_FastToLocals() and PyFrame_LocalsToFast() are not documented and have weird interface. I think the use of them

[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-08-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: An alternative solution is using str.splitlines(source) instead of source.splitlines(). It raises a TypeError if the argument is not a text string and always returns a list of strings. According to the documentation get_source() must return a text string or