[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 EW.__init__, but only used immediately in 
text_options.)

autosave: local name in runscript.ScriptBinding.getfilename, called each time 
one runs a module.  This a runscript extension option already put on General 
tab and saved in config-main.

num_spaces: EditorWindow() attribute, set in EW.set_notabs_indentwidth, called 
in EW.__init__ and ConfigDialog.activate_config_changes for each window.

help_list: local name in EW.reset_help_menu_entries, called in EW.__init__ and 
CD.a_c_changes, like num_spaces.


For new General options, add EW.reload_general(), which calls class reload 
methods.  In CD.a_c_w, add at the end, after the loop, 
'win_instances.pop().reload_general()'.  This will avoid importing the feature 
modules into configdialog.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 be an 
assertion failure in debug build).

The proposed solution LGTM. It undermines duck-typing, but I think this doesn't 
break any existing code. The duck-typing was not intentional and is 
Windows-only.

--
components: +Extension Modules -Interpreter Core
nosy: +serhiy.storchaka
stage:  -> patch review
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the active editor (code context toggle).  They 
should take effect as soon as sensible.

Allowing more individual customization of editors (font, theme, keys, etc) is 
out of scope for this issue.  I will just note that the values that apply to 
all editors should have been module or class attributes rather than instance 
attributes.  This would make updating the attributes easier and faster and 
would allow instance attributes to be used for instance customization.

The prime violators of 'when' are most of the non-key options that occur in 4 
of the built-in extensions.  These are mostly class attributes read just once 
when the module is imported and the class created, which happens when the first 
EditorWindow is created.  One exception is Paragraph, where the attribute is an 
instance attribute, but really should be a Paragraph class or even module 
attribute.  (I expect the class to be eliminated some day.)  The other is the 
buggy CodeContext().visible.

What is needed is a mechanism to reload the class attributes after they are 
changed.  I believe the easiest way would be to wrap the current idleConf load 
statements in a 'reload' classmethod that is called immediately after the class 
definition, but which can also be called by configdialog when applying changes. 
 The class attributes should not be turned into instance attributes that have 
to be updated in each instance.

I don't remember if I ever checked when changes to user-configurable extension 
keys takes effect.  It does not matter now.  As part of #27099, converting 
built-in extensions to features, all key shortcuts will be handled together, so 
those for former extensions will take effect immediately along with the others.

Most of configdialog been reviewed and tested.  The main exceptions are the 
button functions, in particular the one for Apply, and the two deactivate and 
activate methods for themes and keys.  The former extension options will become 
general options (as will indent spaces).  The update of indent spaces and 
autosave, which are active when the dialog is closed (I am not currently sure 
how), might be used as a guide for the new general options.

Testing that changes for general options take effect right away, as intended, 
is part of this issue, and perhaps the hardest part.

--
dependencies: +IDLE: turn built-in extensions into regular modules
nosy: +wohlganger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 when running those 
two commands as a script.

The error I get is:
*** Error in `python3': free(): invalid next size (normal): 0x01a088f0 
***

A memory map printed after the error is attached.

The backtrace is
=== Backtrace: =
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f55ac35e7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f55ac36737a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f55ac36b53c]
/usr/lib/python3/dist-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so(+0x6d35e)[0x7f55ab0fa35e]
/usr/lib/python3/dist-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so(+0x45a29)[0x7f55ab0d2a29]
/usr/lib/python3/dist-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so(+0x461a2)[0x7f55ab0d31a2]
/usr/lib/python3/dist-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so(+0xcf828)[0x7f55ab15c828]
python3(PyCFunction_Call+0x77)[0x4e9bc7]
python3(PyEval_EvalFrameEx+0x614)[0x524414]
python3[0x52d2e3]
python3(PyEval_EvalCode+0x1f)[0x52dfdf]
python3[0x5fd2c2]
python3(PyRun_FileExFlags+0x9a)[0x5ff76a]
python3(PyRun_SimpleFileExFlags+0x1bc)[0x5ff95c]
python3(Py_Main+0x456)[0x63e7d6]
python3(main+0xe1)[0x4cfe41]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f55ac307830]
python3(_start+0x29)[0x5d5f29]

--
components: Interpreter Core
files: memdump.txt
messages: 300970
nosy: droth
priority: normal
severity: normal
status: open
title: Error when calling numpy.astype
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file47105/memdump.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 exceptions instead.

This was fixed in Python 3.4 with this patch: https://bugs.python.org/issue22903

Given that 2.7 is still supported, this patch should be backported.

--
components: Library (Lib)
messages: 300969
nosy: Rachel Tobin
priority: normal
severity: normal
status: open
title: Unpickleable ModuleImportError in unittest patch not backported to 2.7
type: crash
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
 https://github.com/pexpect/pexpect/issues/369

If subprocess supported pty.fork() and pexpect.pty_spawn.spawn like actions, 
pexpect could use that by default instead of the threading incompatible 
pty.fork().

(this is a brainstorm, see what the pexpect maintainers want in the above 
github issues)

--
components: Library (Lib)
messages: 300968
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: support pty.fork and os.forkpty actions in posix subprocess module
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 check whether the return value of
pathname.replace('/', '\') is a str.

do you think I would update the PR to do that?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 'exception'.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 object and the resulting exception that will occur 
from a bad path is acceptable.

I appreciate the work to do a PR, Oren, but I'm closing this issue as 
"rejected". (And if it makes you feel any better, you helped find a bug in the 
Bedevere bot. :) .

--
nosy: +brett.cannon, twouters
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 x is y both 
imply that hash(x) == hash(y).

right?

--
assignee: docs@python
components: Documentation
messages: 300961
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: typo in __hash__ docs
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 internal variables are not 
correctly initialized. This leads to an empty 'handlers' attribute and a 
undefined 'queue' attribute.

The second issue is that zmq.Socket.send and zmq.Socket.setsockopt only admits 
bytecode variables and therefore it fails in Python3 when using plain strings.

--
assignee: docs@python
components: Documentation
messages: 300960
nosy: docs@python, pablogsal
priority: normal
pull_requests: 3273
severity: normal
status: open
title: ZeroMQSocketListener and ZeroMQSocketHandler examples in the Logging 
Cookbook not working

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 issue/pull request for its implementation?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 implementation of Decimal.from_float()
is PyDecType_FromFloat(), while the relevant part of it is a call to
PyDecType_FromFloatExact().
But PyDecType_FromFloatExact() uses float.as_integer_ratio(), and thus
ISTM that the issue doesn't exist there.

(also, the following doesn't raise an exception, as expected:
import decimal

class BadFloat(float):
def as_integer_ratio(self):
raise RuntimeError

decimal.Decimal.from_float(BadFloat())
)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3037] in output

2017-08-28 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests:  -3271

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3037] in output

2017-08-28 Thread Lisa Hewus

Changes by Lisa Hewus :


--
pull_requests: +3271

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 and definitely is not in the core.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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()


this is because both multiply_float_timedelta() and truedivide_timedelta_float()
(in Modules/_datetimemodule.c) assume as_integer_ratio() returns tuple.

--
components: Interpreter Core
messages: 300954
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: crashes in multiply_float_timedelta() and in truedivide_timedelta_float()
type: crash
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 = os.path.dirname(os.path.abspath(source))
  File "/usr/lib/python3.6/posixpath.py", line 369, in abspath
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not _io.StringIO


The bug is in this method: distutils.command.check.check._check_rst_data

The first line already hints at it: `source_path = StringIO()`

StringIO instances aren’t paths, but at least the include directive 
(docutils.parsers.rst.directives.misc.Include) expects one.

--
components: Distutils
files: check-test.py
messages: 300953
nosy: dstufft, flying sheep, merwok
priority: normal
severity: normal
status: open
title: `python setup.py check --restructuredtext` fails when a include 
directive is present.
type: crash
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file47104/check-test.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)
https://github.com/python/cpython/commit/07f1658aa09f6798793c473c72b2951b7fefe220


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 bumpserialno, which IIUC, is not thread safe. But of course it's another 
issue.

>>> For Python 2, in practice you can call PyMem_Malloc() without holding the 
>>> GIL, it's just malloc() which is thread safe.

Hmm, I know it. But it's not stated in the doc they are thread safe, I am not 
sure assuming this is suitable. An example is 
https://github.com/psycopg/psycopg2/issues/110.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 this is fixed in latest version. I thought it was also backported to 
> Python 3.5.3. What is the version you are using? Could you please try 
> updating to the latest bugfix release? (currently these are 3.5.4 and 3.6.2).
> 
> --
> nosy: +levkivskyi
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 holding the
GIL, it's just malloc() which is thread safe.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-28 Thread Oren Milman

Changes by Oren Milman :


--
pull_requests: +3269

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

zipimport.zipimporter('foo.zip').get_data(BadStr('bar'))


this is because zipimport_zipimporter_get_data_impl() assumes that
BadStr('bar').replace('/', '\\') is a string.

--
components: Interpreter Core
messages: 300944
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: an assertion failure in zipimport.zipimporter.get_data()
type: crash
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 "help", "copyright", "credits" or "license" for more information.
>>> import mymodule
Segmentation fault (core dumped)


As you might imagine, this is not the funnest thing ever to debug.

Thankfully, when I compiled the module for Python2 and tried to load, a much 
more helpful and informative error message was displayed.


Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mymodule
Traceback (most recent call last):
  File "", line 1, in 
  File "mymodule/__init__.py", line 1, in 
import _mymodule
ImportError: ./_mymodule.so: undefined symbol: DBFGetRecordCount
>>> 


And indeed, it seems that in my setup.py file where I had

setuptools.Extension(
  "_mymodule",
  glob.glob('src/*.cpp') + glob.glob('lib/mylib/*.cpp') + 
glob.glob('lib/mylib/sublib/*.c'),

I should have had 'lib/mylib/sublib/*.cpp'.



I think the current behaviour can be improved:

1. Python3 should provide a helpful error message, like Python2 does.

2. setup.py should fail or at least provide a warning if there are missing 
symbols. (Perhaps this suggestion should be aimed at one of the setup 
utilities, but I'm not sure where to send it.)

--
messages: 300942
nosy: immortalplants
priority: normal
severity: normal
status: open
title: segfault on missing library symbol
versions: Python 2.7, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 should be discouraged.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 None.

https://docs.python.org/3/library/importlib.html?highlight=get_source#importlib.abc.InspectLoader.get_source

--
nosy: +brett.cannon, eric.snow, ncoghlan, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com