[issue29316] Can we keep typing.py provisional for the duration of the Python 3.6 release cycle?

2017-01-18 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1 for keeping this provisional.  The code is still maturing and needs to be 
iterated while we gain experience with it.

--
nosy: +rhettinger

___
Python tracker 

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



[issue29312] Use FASTCALL in dict.update()

2017-01-18 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I like the other AC changes to dict in 29311, but this one seems like it 
shouldn't be done.  There is too much twisting around existing code to force it 
to use AC and the benefit will be almost nothing.   dict.update() is mainly 
used with a list of tuples argument or with another mapping.  The O(1) time 
spent on the method call is inconsequential compared to the O(n) step of 
looping over all the inputs and putting them in the dict.  Accordingly, I think 
this method should be skipped, leaving the current clear, stable, fast-enough 
code in-place.

--
nosy: +rhettinger

___
Python tracker 

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



[issue29293] Missing parameter "n" on multiprocessing.Condition.notify()

2017-01-18 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Looks like, despite what the multiprocessing.Condition docs say (claiming it's 
an alias for threading.Condition), at least in Python 3.5, it's a completely 
separate animal from multiprocessing.synchronize, and the notify method on it 
doesn't take any parameters.

Seems like an obvious thing to fix; the parameter is defaulted anyway, so 
existing code should continue to work, and it makes multiprocessing swap in for 
threading more seamlessly.

--
nosy: +josh.r

___
Python tracker 

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



[issue29312] Use FASTCALL in dict.update()

2017-01-18 Thread INADA Naoki

INADA Naoki added the comment:

Using FASTCALL for methods accepting **kwargs can't skip creating dict in most 
cases.  Because they accepts dict.

Even worth, when calling it like `d.update(**config)` (yes, it's abuse of
**, but it can be happen in some C methods), FASTCALL may unpack the passed
dict, and pack it again.

So, when considering METH_FASTCALL, supporting **kwargs is lowest priority.
(Off course, supporting it by AC with METH_KEYWORDS is nice to have)

--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-18 Thread INADA Naoki

INADA Naoki added the comment:

LGTM

--

___
Python tracker 

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



[issue29316] Can we keep typing.py provisional for the duration of the Python 3.6 release cycle?

2017-01-18 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +ned.deily

___
Python tracker 

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



[issue29317] test_copyxattr_symlinks fails

2017-01-18 Thread mark

New submission from mark:

==
ERROR: test_copyxattr_symlinks (test.test_shutil.TestShutil)
--
Traceback (most recent call last):
  File "/opt/Python-3.6.0/Lib/test/test_shutil.py", line 505, in 
test_copyxattr_symlinks
os.setxattr(src, 'trusted.foo', b'42')
PermissionError: [Errno 1] Operation not permitted: '/tmp/tmpvlu10qdm/foo'

--

The problem is that "trusted" attributes (in this case trusted.foo) are visible 
and accessible only to processes that have the CAP_SYS_ADMIN capability. The 
current "skipUnless" guard is wrong: being root (UID 0) doesn't necessarely 
imply you have CAP_SYS_ADMIN. For instance this test (and thus "make test") 
will always fail in a Docker container unless it's started with "--cap-add 
SYS_ADMIN" (which, in general, is not the best thing to do).

--
components: Tests
messages: 285764
nosy: marktay
priority: normal
severity: normal
status: open
title: test_copyxattr_symlinks fails
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



[issue29281] json.loads documentation missing "versionchanged" statement

2017-01-18 Thread R. David Murray

R. David Murray added the comment:

Yes, this should be documented with a versionchanged.  The removal was for 
python3 so we didn't need a versionchanged there; it was just a difference from 
python2, and the python3 docs were "restarted" with (almost) no back references 
to python2.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue29281] json.loads documentation missing "versionchanged" statement

2017-01-18 Thread Ammar Askar

Ammar Askar added the comment:

To anyone more experienced with python documentation, is behavior like this 
actually supposed to be documented? For some more historical context,

the support for bytes in the json module was removed in this issue: 
https://bugs.python.org/issue4136

and then re-added in this one: 
https://bugs.python.org/issue17909

--
nosy: +ammar2

___
Python tracker 

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



[issue29316] Can we keep typing.py provisional for the duration of the Python 3.6 release cycle?

2017-01-18 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

There are also minor things like NoReturn, typing_inspect helpers(?) etc. 

The main good point I see for keeping typing provisional is we could iterate 
fast and come up with more "settled" and robust API in time for 3.7.

--

___
Python tracker 

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



[issue29316] Can we keep typing.py provisional for the duration of the Python 3.6 release cycle?

2017-01-18 Thread Łukasz Langa

Łukasz Langa added the comment:

There are three specific areas I can identify that are missing from the typing 
module at the moment:
* support for structural typing (protocols)
* support for typing heterogenous dictionaries (dictionary "schema")
* support for typing arbitrary callables

--
components: +Library (Lib)
keywords: +3.6regression
nosy: +lukasz.langa
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue29316] Can we keep typing.py provisional for the duration of the Python 3.6 release cycle?

2017-01-18 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I don't have any strong opinion on this. If others don't object then I am 
perfectly fine with keeping typing provisional for 3.6.

--
nosy: +levkivskyi

___
Python tracker 

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



[issue29316] Can we keep typing.py provisional for the duration of the Python 3.6 release cycle?

2017-01-18 Thread Guido van Rossum

New submission from Guido van Rossum:

The 3.6 what's new 
(https://docs.python.org/3/whatsnew/3.6.html#whatsnew36-typing) claims 
typing.py is no longer provisional, but I don't think it's quite ready yet. 
There are a number of things that I'd like to merge into typing.py over the 
duration of 3.6's lifetime. Nothing backwards incompatible, but definitely new 
features.

See also https://github.com/python/typing/issues/247

--
messages: 285758
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: Can we keep typing.py provisional for the duration of the Python 3.6 
release cycle?

___
Python tracker 

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



[issue29198] AsyncGenerator is missing from typing

2017-01-18 Thread Guido van Rossum

Guido van Rossum added the comment:

So the changes to typing.py have been committed. Can someone commit the right 
doc patches?

--

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-01-18 Thread Sébastien Taylor

Sébastien Taylor added the comment:

Are there existing tools for bundling the python35.zip (and adding additional 
packages)?  I personally ran into this issue by using pip to add additional 
modules to my embeddable python but if there's a better way to migrate from 
devel to embeddable python I'd rather not have to use pip for this.

--

___
Python tracker 

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



[issue29315] \b requires raw strings or to be escaped. Update docs with that hint?

2017-01-18 Thread R. David Murray

R. David Murray added the comment:

One should always use raw strings for regex expressions, and this is already 
documented in the introduction to the regex module.  Further, in 3.5 using \ in 
front of characters that aren't special produces a warning, which should reduce 
the frequency of this mistake.

I don't see that there's anything to do here.

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



[issue29198] AsyncGenerator is missing from typing

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 87e8139420ed by Guido van Rossum in branch '3.5':
Issue #29198: add AsyncGenerator (Jelle Zijlstra)
https://hg.python.org/cpython/rev/87e8139420ed

New changeset 5b771c662c00 by Guido van Rossum in branch '3.6':
Issue #29198: add AsyncGenerator (Jelle Zijlstra) (3.5->3.6)
https://hg.python.org/cpython/rev/5b771c662c00

New changeset 07523532039d by Guido van Rossum in branch 'default':
Issue #29198: add AsyncGenerator (Jelle Zijlstra) (3.6->3.7)
https://hg.python.org/cpython/rev/07523532039d

--
nosy: +python-dev

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-01-18 Thread Paul Moore

Paul Moore added the comment:

I'm not sure I see why you'd want to run lib2to3 with the embedded distribution 
anyway. Surely you'd do any 2to3 conversion in a normal development 
installation, and then simply bundle the resulting converted scripts with your 
application and the embedded interpreter?

--

___
Python tracker 

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



[issue24960] Can't use lib2to3 with embeddable zip file.

2017-01-18 Thread Sébastien Taylor

Changes by Sébastien Taylor :


--
nosy: +Sébastien Taylor

___
Python tracker 

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



[issue29274] Change “tests cases” → “test cases”

2017-01-18 Thread Martin Panter

Martin Panter added the comment:

Thanks for the feedback

--
resolution:  -> fixed
stage: patch review -> 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



[issue29315] \b requires raw strings or to be escaped. Update docs with that hint?

2017-01-18 Thread Mike Lissner

New submission from Mike Lissner:

I just ran into a funny corner case I imagine others are aware of. When you 
write "\b" in Python, it is a single character: "\x08". So if you try to write 
a regex like:

words = '\b(.*)\b'

That won't work. But using a raw string will:

words = r'\b(.*)\b'

As will escaping it in this horrible fashion:

words = '\\b(.*)\\b'

I believe this doesn't affect any of the other regex flags, so I wonder if it's 
worth adding something to the docs to warn about this. I just spent a bunch of 
time trying to figure out why it seemed like \b wasn't working. A little tip in 
the docs would have gone a LONG way.

--
assignee: docs@python
components: Documentation
messages: 285751
nosy: Mike.Lissner, docs@python
priority: normal
severity: normal
status: open
title: \b requires raw strings or to be escaped. Update docs with that hint?
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29314] asyncio.async deprecation warning is missing stacklevel=2

2017-01-18 Thread R. David Murray

Changes by R. David Murray :


--
components: +asyncio
nosy: +gvanrossum, yselivanov
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue29314] asyncio.async deprecation warning is missing stacklevel=2

2017-01-18 Thread R. David Murray

New submission from R. David Murray:

Title pretty much says it all.  The warning isn't very helpful currently, since 
it just reports the line in tasks.py where the deprecation warning is generated.

--
messages: 285750
nosy: r.david.murray
priority: normal
severity: normal
status: open
title: asyncio.async deprecation warning is missing stacklevel=2
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29313] msi by bdist_msi will fail execute install-scripts if space in present in python path

2017-01-18 Thread eszense

New submission from eszense:

If python.exe path contains space, msi generated with bdist_msi command with 
--install-script=abc.py will fail with msg:

C:\\Program Files\\Python35\\python.exe: can't open file 'C:\\Program': [Error 
2] No such file or directory

Patch attached for your consideration

--
components: Distutils
files: patch.diff
keywords: patch
messages: 285749
nosy: dstufft, eric.araujo, eszense
priority: normal
severity: normal
status: open
title: msi by bdist_msi will fail execute install-scripts if space in present 
in python path
type: crash
Added file: http://bugs.python.org/file46333/patch.diff

___
Python tracker 

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



[issue29309] Interpreter hang when interrupting a loop.run_in_executor() future

2017-01-18 Thread Romain Sébille

Romain Sébille added the comment:

Ok, thanks for the explanation!

One thing still bother me, run_in_executor() allow us to launch blocking 
operations but without blocking the main thread, so there is a high chance that 
we wait inside one of the pool's worker.
Does this mean run_in_executor() shouldn't be used for long/indefinite blocking 
operation?

--

___
Python tracker 

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



[issue29292] Missing a parameter in PyEval_EvalCodeEx doc

2017-01-18 Thread Ammar Askar

Changes by Ammar Askar :


Added file: http://bugs.python.org/file46332/kwdefs_docs.diff2

___
Python tracker 

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



[issue29312] Use FASTCALL in dict.update()

2017-01-18 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #20291: "Argument Clinic should understand *args and **kwargs 
parameters".

--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-18 Thread STINNER Victor

STINNER Victor added the comment:

dict.patch converts two methods to Argument Clinic:

* get()
* setdefault()

pop() requires the issue #29299, its signature must not show any default value 
for the second parameter.

dict.update() is special, so I created a dedicated issue: issue #29312.

--
keywords: +patch
Added file: http://bugs.python.org/file46331/dict.patch

___
Python tracker 

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



[issue29312] Use FASTCALL in dict.update()

2017-01-18 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Argument Clinic
nosy: +larry

___
Python tracker 

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



[issue29312] Use FASTCALL in dict.update()

2017-01-18 Thread STINNER Victor

STINNER Victor added the comment:

My patch doesn't use _PyStack_AsDict() since this function currently fails with 
an assertion error if a key is not exactly a string (PyUnicode_CheckExact). 
dict_update_common() already checks if all keys are string.

--

___
Python tracker 

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



[issue29312] Use FASTCALL in dict.update()

2017-01-18 Thread STINNER Victor

New submission from STINNER Victor:

Follow-up of the issue #29311 "Argument Clinic: convert dict methods".

The dict.update() method hs a special prototype:

   def update(arg=None **kw): ...

I don't think that Argument Clinic supports it right now, so I propose to first 
optimize dict_update() to use METH_FASTCALL.

Attached patch is a first step: convert kwnames tuple to a dict.

A second step would be to avoid the temporary dict and update the dict using 
args + kwnames directly.

--
files: dict_update_fastcall.patch
keywords: patch
messages: 285744
nosy: haypo, inada.naoki
priority: normal
severity: normal
status: open
title: Use FASTCALL in dict.update()
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file46330/dict_update_fastcall.patch

___
Python tracker 

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



[issue29292] Missing a parameter in PyEval_EvalCodeEx doc

2017-01-18 Thread Ammar Askar

Ammar Askar added the comment:

You're completely right, the kwdefs is referring to default arguments for 
keyword-only-arguments from this PEP: https://www.python.org/dev/peps/pep-3102/

Where as that line is probably referring to "defs", the defaults for normal 
parameters.

I'll upload an amended patch.

--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-18 Thread STINNER Victor

New submission from STINNER Victor:

The dict type has multiple methods which use METH_VARARGS or 
METH_VARARGS|METH_KEYWORDS calling convention, whereras there is no a new 
faster METH_FASTCALL calling convention which avoids temporary tuple/dict to 
pass arguments.

--
components: Argument Clinic
messages: 285742
nosy: haypo, inada.naoki, larry
priority: normal
severity: normal
status: open
title: Argument Clinic: convert dict methods
type: performance
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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 127401469628 by Victor Stinner in branch 'default':
Update and enhance python-gdb.py
https://hg.python.org/cpython/rev/127401469628

--

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-18 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-18 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-18 Thread Jelle Zijlstra

New submission from Jelle Zijlstra:

Document https://github.com/python/typing/pull/338

I should have a patch in the next few days; creating this issue to remind 
myself.

--
assignee: Jelle Zijlstra
components: Documentation
messages: 285740
nosy: Jelle Zijlstra
priority: normal
severity: normal
status: open
title: Document typing.NamedTuple default argument syntax
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28556] typing.py upgrades

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 59829d7b7838 by Guido van Rossum in branch '3.5':
Issue #28556: allow default values in class form of NamedTuple -- Jelle Zijlstra
https://hg.python.org/cpython/rev/59829d7b7838

New changeset 2159f36ccd6b by Guido van Rossum in branch '3.6':
Issue #28556: allow default values in class form of NamedTuple -- Jelle 
Zijlstra (3.5->3.6)
https://hg.python.org/cpython/rev/2159f36ccd6b

New changeset f0e1c49233ff by Guido van Rossum in branch 'default':
Issue #28556: allow default values in class form of NamedTuple -- Jelle 
Zijlstra (3.6->3.7)
https://hg.python.org/cpython/rev/f0e1c49233ff

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2017-01-18 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Jan 18, 2017, at 03:57 PM, Matthias Klose wrote:

>I don't think we need a PEP for this

Correct.  Generally we don't need PEPs for build system changes.

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2017-01-18 Thread Matthias Klose

Matthias Klose added the comment:

I don't think we need a PEP for this, however I would like to name the new 
macro libsubdir, or sublibdir, to make it clear it's just the libdir component. 
Or make the value absolute, like it already is for libdir ...

--

___
Python tracker 

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



[issue28997] test_readline.test_nonascii fails on Android

2017-01-18 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> I think we should wait for the resolution of PEP 538 and of issue 28684

s/issue 28684/issue 28180/

--

___
Python tracker 

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



[issue28180] sys.getfilesystemencoding() should default to utf-8

2017-01-18 Thread Xavier de Gaye

Xavier de Gaye added the comment:

pep538_coerce_legacy_c_locale_v3.diff fixes issue 28997 on Android (api 21 and 
24). This issue is raised because there is an inconsistency between Python on 
Android that considers the locale encoding to be always UTF-8 and GNU Readline 
that does not accept eight-bit characters when LANG is not set (on Android).

On Android, setlocale(CATEGORY, "") does not look for the locale environment 
variables (LANG, ...) but sets the 'C' locale instead, so the patch does not 
fully behave as expected and the 'Py_Initialize detected' warning is emitted. 
Here is the output of an interactive session on Android:

root@generic_x86:/data/data/org.bitbucket.pyona # python
Python detected LC_CTYPE=C, forcing LC_ALL & LANG to C.UTF-8 (set 
PYTHONALLOWCLOCALE to disable this locale coercion behaviour).
Py_Initialize detected LC_CTYPE=C, which limits Unicode compatibility. Some 
libraries and operating system interfaces may not work correctly. Set 
`PYTHONALLOWCLOCALE=1 LC_CTYPE=C` to configure a similar environment when 
running Python directly.
Python 3.7.0a0 (default:0503024831ad+, Jan 18 2017, 11:34:53)
[GCC 4.2.1 Compatible Android Clang 3.8.256229 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale, os
>>> os.environ['LANG']
'C.UTF-8'
>>> locale.getdefaultlocale()
('en_US', 'UTF-8')
>>> locale.setlocale(locale.LC_CTYPE)
'C'
>>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
'C.UTF-8'
>>> locale.setlocale(locale.LC_CTYPE)
'C.UTF-8'

The attached android_setlocale.patch fixes the following problems when applied 
after pep538_coerce_legacy_c_locale_v3.diff:
* No 'Py_Initialize detected' warning is emitted.
* locale.setlocale(locale.LC_CTYPE) returns now 'C.UTF-8'.

--
nosy: +xdegaye
Added file: http://bugs.python.org/file46329/android_setlocale.patch

___
Python tracker 

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



[issue29309] Interpreter hang when interrupting a loop.run_in_executor() future

2017-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Sending SIGTERM (CTRL+c, KeyboardInterrupt) while Python is waiting in 
threading.Thread.join() is not supported.

You have a thread running time.sleep(1). On Linux, this function calls the 
select() syscall. So you have the main thread waiting for the thread state 
lock, and a thread waiting in select(). If SIGTERM is received in the main 
thread, you enter a weird state of the threading module.

Python has a signal.pthread_kill() which might help to only send a signal to a 
specific thread, but I don't know exactly how Python behaves, since Python 
wants to execute Python signal handles in the main thread...

--
nosy: +haypo

___
Python tracker 

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



[issue29307] ModuleNotFoundError when using literal string interpolation with invalid format specifier

2017-01-18 Thread Jeroen Van Goey

Jeroen Van Goey added the comment:

Thanks Barry for your extensive explanation!

--

___
Python tracker 

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



[issue29309] Interpreter hang when interrupting a loop.run_in_executor() future

2017-01-18 Thread Romain Sébille

New submission from Romain Sébille:

Hi,

I stumble on this today and can't find any reasons or previous issue as to why 
this happen so I thought of submitting the issue here.

I attached a script (run_in_executor.py) to reproduce the problem, the original 
problem arise when waiting to read on a socket but I have the same result with 
time.sleep().

The output:
$ python3.6 run_in_executor.py
Start
Going to sleep
^CClosing loop
Traceback (most recent call last):
  File "run_in_executor.py", line 15, in 
loop.run_until_complete(sleep_in_executor(loop))
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 454, in 
run_until_complete
self.run_forever()
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 421, in 
run_forever
self._run_once()
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 1389, in 
_run_once
event_list = self._selector.select(timeout)
  File "/usr/local/lib/python3.6/selectors.py", line 445, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt
^CError in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 39, in 
_python_exit
t.join()
  File "/usr/local/lib/python3.6/threading.py", line 1056, in join
self._wait_for_tstate_lock()
  File "/usr/local/lib/python3.6/threading.py", line 1072, in 
_wait_for_tstate_lock
elif lock.acquire(block, timeout):
KeyboardInterrupt

Current behavior:
We have to send two ^C before we go back to the shell.

Expected behavior:
Only one ^C to go back to the shell.

Python versions tested:
- Python 3.4.2
- Python 3.4.6
- Python 3.5.3
- Python 3.6.0

>From what I have gathered the error is within the ThreadPoolExecutor cleaning 
>function but I don't see why there are still living workers, the 
>Executor.shutdown() take care of that.
Unfortunately I don't really know what to look, is a AsyncIO bug ? A 
ThreadPoolExecutor bug ? Or something else.

--
components: asyncio
files: run_in_executor.py
messages: 285732
nosy: gvanrossum, rsebille, yselivanov
priority: normal
severity: normal
status: open
title: Interpreter hang when interrupting a loop.run_in_executor() future
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file46328/run_in_executor.py

___
Python tracker 

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



[issue29308] venv should match virtualenv VIRTUAL_ENV_DISABLE_PROMPT config

2017-01-18 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-01-18 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #29306: "Check usage of Py_EnterRecursiveCall() and 
Py_LeaveRecursiveCall() in new FASTCALL functions".

--

___
Python tracker 

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



[issue29307] ModuleNotFoundError when using literal string interpolation with invalid format specifier

2017-01-18 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Jan 18, 2017, at 10:56 AM, Jeroen Van Goey wrote:

>sudo add-apt-repository ppa:jonathonf/python-3.6
>sudo apt-get update
>sudo apt-get install python3.6
>
>I made a string, using the new literal string interpolation, but I supplied
>an invalid format specifier. I not only got the expected "ValueError: Invalid
>format specifier", but also the unexpected "ModuleNotFoundError: No module
>named 'apt_pkg'".

Please understand that installing Python 3.6 from a random PPA does *not*
provide full support for this version of the interpreter.  Python 3.6 is not
yet a supported version in any version of Ubuntu (which I'm assuming your
using), although we are working on it for 17.04.

Very often, you can install a new Python 3 interpreter package and many things
will work because the Ubuntu infrastructure shares pure-Python modules across
all installed Python 3's.  Technically speaking, they will all have
/usr/lib/python3/dist-packages on their sys.path so any third party
pure-Python module built for a support version of Python 3 will be importable
by any (package-built) installed version of Python 3.

But that 1) is a long way from saying that those third-party modules will
work; 2) does *not* include any packages containing C extension modules, which
must be rebuilt for the specific interpreter version.

Supporting a new version of Python is a long process, for which we are just
starting.  Please engage with ubuntu-de...@ubuntu.com for details.

Ubuntu does install a standard exception handler so that when Python
applications and such crash, we can gather crash statistics, so that we can
devote resources to fixing common problems and regressions.  apport (which you
see in the traceback) is that crash reporting infrastructure.  apport calls
apt_pkg, which is an (C++) extension module and thus won't have been built for
the version of Python 3.6 you installed from that PPA, unless of course the
PPA owner (who I don't know) has also done an archive-wide Python 3 rebuild.
Since I'm in the process of setting that up, and I know it's quite a bit of
work, I doubt that's been done for this rather random PPA.

The ubuntu-devel mailing list is a better place to discuss the ongoing work to
bring Python 3.6 as a supported version on Ubuntu.

--
nosy: +barry

___
Python tracker 

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



[issue29308] venv should match virtualenv VIRTUAL_ENV_DISABLE_PROMPT config

2017-01-18 Thread Jack Bennett

New submission from Jack Bennett:

virtualenv has 
https://virtualenv.pypa.io/en/latest/reference/#envvar-VIRTUAL_ENV_DISABLE_PROMPT
 to block activate from trying to overwrite the prompt function. 

Users of venv can't do that, 3.6 added prompt but even None defaults to the 
current folder name.

If I may suggest either respecting the virtualenv variable or perhaps 
prompt=False

Specifically we've ran into this in powershell while making cmder stricter on 
the prompt over here: https://github.com/cmderdev/cmder/issues/1207

Thanks, Jack

--
components: Library (Lib)
messages: 285729
nosy: Jack Bennett
priority: normal
severity: normal
status: open
title: venv should match virtualenv VIRTUAL_ENV_DISABLE_PROMPT config
type: behavior
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



[issue28997] test_readline.test_nonascii fails on Android

2017-01-18 Thread Xavier de Gaye

Xavier de Gaye added the comment:

PEP 538 [1] coerces the C locale to UTF-8 by setting the locale environment 
variables (LC_ALL, LANG).  The PEP has an implementation at issue 28180 as 
pep538_coerce_legacy_c_locale_v3.diff, and the patch fixes test_nonascii when 
run on the Android emulators (api 21 and 24).  This is as expected as now both 
Python and Readline are in agreement and use the same encoding.
I think we should wait for the resolution of PEP 538 and of issue 28684. If 
this does not happen, I agree we should skip the test with the message you are 
proposing Martin.

[1] https://www.python.org/dev/peps/pep-0538

--

___
Python tracker 

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



[issue29306] Check usage of Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() in new FASTCALL functions

2017-01-18 Thread STINNER Victor

STINNER Victor added the comment:

Naoki: "On the other hand, PyCFunction may calls method of extension module, 
and it can cause recursive call. So I think PyCFunction_*Call* methods calling 
function pointer it has (e.g. _PyCFunction_FastCallKeywords) should call 
Py_EnterRecursiveCall()."

In Python 3.5, C functions are only calls inside Py_EnterRecursiveCall() if 
calls from PyObject_Call(). There are many other ways to call C functions which 
don't use Py_EnterRecursiveCall(). Examples:

* call_function() => call the C function
* call_function() => PyCFunction_Call() => call the C function
* call_function() => do_call() => PyCFunction_Call() => call the C function
* ext_do_call() => PyCFunction_Call() => call the C function

call_function() and do_call() have a special case for PyCFunction, otherwise 
they call the generic PyObject_Call() which uses Py_EnterRecursiveCall().

I agree that calling C functions with Py_EnterRecursiveCall() would help to 
prevent stack overflow crashs.

Attached enter_recursive_call.patch patch:

* _PyMethodDef_RawFastCallDict() (internal helper of 
_PyCFunction_FastCallDict()) and _PyCFunction_FastCallKeywords() now use 
Py_EnterRecursiveCall()
* _PyObject_FastCallKeywords(): move Py_EnterRecursiveCall() closer to the 
final call to simplify error handling
* Modify _PyObject_FastCallDict() to not call _PyFunction_FastCallDict() nor 
_PyCFunction_FastCallDict() inside Py_EnterRecursiveCall(), since these 
functions already use Py_EnterRecursiveCall() internally

--
keywords: +patch
Added file: http://bugs.python.org/file46327/enter_recursive_call.patch

___
Python tracker 

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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a241817424e5 by Victor Stinner in branch 'default':
Fix _PyMethodDef_RawFastCallDict() argument parsing
https://hg.python.org/cpython/rev/a241817424e5

New changeset a8d35309dcc0 by Victor Stinner in branch 'default':
PyCFunction_Call() now calls _PyCFunction_FastCallDict()
https://hg.python.org/cpython/rev/a8d35309dcc0

New changeset ee6e1b1151a8 by Victor Stinner in branch 'default':
_PyObject_FastCallKeywords() now checks !PyErr_Occurred()
https://hg.python.org/cpython/rev/ee6e1b1151a8

New changeset 11039ece46b9 by Victor Stinner in branch 'default':
Rephrase !PyErr_Occurred() comment: may=>can
https://hg.python.org/cpython/rev/11039ece46b9

New changeset 8cc5d78d9b18 by Victor Stinner in branch 'default':
Cleanup _PyMethodDef_RawFastCallDict()
https://hg.python.org/cpython/rev/8cc5d78d9b18

--

___
Python tracker 

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



[issue29307] ModuleNotFoundError when using literal string interpolation with invalid format specifier

2017-01-18 Thread R. David Murray

R. David Murray added the comment:

Yes, this appears to be the vendor's failure reporting infrastructure that is 
failing.  Why they'd want a report for every traceback at the interactive 
prompt is beyond me, but that appears to be what they are trying to do.

--
nosy: +r.david.murray
resolution:  -> third party
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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a3865d0c1844 by Victor Stinner in branch 'default':
Fix Python 2.6 support in python-gdb.py
https://hg.python.org/cpython/rev/a3865d0c1844

--

___
Python tracker 

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



[issue29274] Change “tests cases” → “test cases”

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f2fe00653d07 by Martin Panter in branch '3.5':
Issue #29274: tests cases → test cases
https://hg.python.org/cpython/rev/f2fe00653d07

New changeset 145da99b3df2 by Martin Panter in branch '3.6':
Issue 29274: Merge doc fixes from 3.5
https://hg.python.org/cpython/rev/145da99b3df2

New changeset f093f88f8a5c by Martin Panter in branch 'default':
Issue 29274: Merge doc fixes from 3.6
https://hg.python.org/cpython/rev/f093f88f8a5c

New changeset 9b22d52a6d4b by Martin Panter in branch '2.7':
Issue #29274: tests cases → test cases
https://hg.python.org/cpython/rev/9b22d52a6d4b

--
nosy: +python-dev

___
Python tracker 

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



[issue29305] encoding to ascii in http/client.py

2017-01-18 Thread Martin Panter

Martin Panter added the comment:

In general, HTTP URLs are supposed to be ASCII only. Newer protocols (e.g. RTSP 
which is based on HTTP) specifically allow UTF-8 encoding. But it would be 
wrong for Python’s HTTP library to assume UTF-8 is wanted everywhere. 
Especially in a domain name (e.g. in the full-URL request to a proxy), which 
should not be UTF-8 encoded. 

I suggest to work on handling IRIs (, 
basically Unicode URLs) in higher-level places like “urllib”. See Issue 3991.

--
nosy: +martin.panter
resolution:  -> rejected
status: open -> closed
superseder:  -> urllib.request.urlopen does not handle non-ASCII characters
title: encoding to ascii in client.py -> encoding to ascii in http/client.py
type: compile error -> enhancement

___
Python tracker 

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



[issue3991] urllib.request.urlopen does not handle non-ASCII characters

2017-01-18 Thread Martin Panter

Martin Panter added the comment:

Issue 9679: Focusses on encoding just the DNS name
Issue 20559: Maybe a duplicate, or opportunity for better documentation or 
error message as a bug fix?

Andreas’s patch just proposes a new function called quote_uri(). It would need 
documentation. We already have a quote() and quote_plus() function. Since it 
sounds like this is for IRIs (https://tools.ietf.org/html/rfc3987), would it be 
more appropriate to call it quote_iri()?

See revision cb09fdef19f5, especially the quote(safe=...) parameter, for how I 
avoided the double encoding problem.

--
dependencies: +unicode DNS names in urllib, urlopen
nosy: +martin.panter
stage: test needed -> patch review
versions: +Python 3.7 -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue11992] sys.settrace doesn't disable tracing if a local trace function returns None

2017-01-18 Thread Armin Rigo

Armin Rigo added the comment:

Confirmed.  More interestingly, nowadays (at least in 3.5) test_pdb.py depends 
on this bug.  If we really clear f->f_trace when the trace function returns 
None, then test_pdb_until_command_for_generator() fails.  This is because 
pdb.py incorrectly thinks there is no breakpoint in the generator function, and 
returns None.  This doesn't actually clear anything, and so it works anyway.

I'd suggest to fix the documentation to reflect the actual behavior of all 
versions from 2.3 to (at least) 3.5.

--
nosy: +arigo

___
Python tracker 

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



[issue29307] ModuleNotFoundError when using literal string interpolation with invalid format specifier

2017-01-18 Thread Xiang Zhang

Xiang Zhang added the comment:

It seems to be vendor's issue not CPython itself. This same issue also happens 
in Ubuntu 16.10's Python 3.6. Raise any exception can cause this:

Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) 
[GCC 6.2.0 20161005] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> raise Exception
Traceback (most recent call last):
  File "", line 1, in 
Exception
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in 
apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in 
from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in 
import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in 

from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in 

import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in 
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "", line 1, in 
Exception
>>> 

Also see https://bugs.launchpad.net/ubuntu/+source/python3.6/+bug/1631367.

--
nosy: +doko, xiang.zhang

___
Python tracker 

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



[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2017-01-18 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

The problem is the only good way to fix this I see now is patching two lines in 
functools and abc using the public ``typing_inspect`` API proposed in 
http://bugs.python.org/issue29262 (I added it as a dependency). The latter 
could take some time, so that I am not 100% sure about 3.6.1.

--
dependencies: +Provide a way to check for *real* typing.Union instances
type:  -> behavior

___
Python tracker 

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



[issue20559] urllib/http fail to sanitize a non-ascii url

2017-01-18 Thread Martin Panter

Martin Panter added the comment:

See also Issue 3991 with proposals for handling non-ASCII as new features.

--
nosy: +martin.panter

___
Python tracker 

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



[issue29307] ModuleNotFoundError when using literal string interpolation with invalid format specifier

2017-01-18 Thread Jeroen Van Goey

New submission from Jeroen Van Goey:

I installed Python 3.6 from J Fernyhough's PPA by doing

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

I made a string, using the new literal string interpolation, but I supplied an 
invalid format specifier. I not only got the expected "ValueError: Invalid 
format specifier", but also the unexpected "ModuleNotFoundError: No module 
named 'apt_pkg'".


$ python3.6
Python 3.6.0 (default, Dec 29 2016, 21:40:36) 
[GCC 5.4.1 20161202] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> value = 4 * 20
>>> f'the value is {value:%A}'
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Invalid format specifier
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in 
apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in 
from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in 
import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in 

from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in 

import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in 
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Invalid format specifier

--
messages: 285716
nosy: jeroen-vangoey
priority: normal
severity: normal
status: open
title: ModuleNotFoundError when using literal string interpolation with invalid 
format specifier
type: behavior
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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1b7a5bdd05ed by Victor Stinner in branch 'default':
_PyObject_FastCallKeywords() now checks the result
https://hg.python.org/cpython/rev/1b7a5bdd05ed

--

___
Python tracker 

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



[issue27830] Add _PyObject_FastCallKeywords(): avoid the creation of a temporary dictionary for keyword arguments

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1b7a5bdd05ed by Victor Stinner in branch 'default':
_PyObject_FastCallKeywords() now checks the result
https://hg.python.org/cpython/rev/1b7a5bdd05ed

--

___
Python tracker 

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



[issue29306] Check usage of Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() in new FASTCALL functions

2017-01-18 Thread INADA Naoki

INADA Naoki added the comment:

I think basic idea is "wrap unknown function call at least once, and preferably 
only once".

_PyEval_EvalFrameDefault() calls Py_EnterRecursiveCall("").
So wrapping PyFunction_(Fast)Call* with Py_EnterRecursiveCall() seems redundant.

On the other hand, PyCFunction may calls method of extension module,
and it can cause recursive call.
So I think PyCFunction_*Call* methods calling function pointer it has
(e.g. _PyCFunction_FastCallKeywords) should call Py_EnterRecursiveCall().

And caller of them can skip Py_EnterRecursiveCall().
For example, _PyObject_FastCallDict() may call _PyFunction_FastCallDict() or
_PyCFunction_FastCallDict(), or tp_fastcall (via _Py_RawFastCallDict) or 
tp_call.
It can wrap all, but wrapping only tp_fastcall and tp_call is better.

--

___
Python tracker 

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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0b219348ec9e by Victor Stinner in branch 'default':
Optimize methoddescr_call(): avoid temporary PyCFunction
https://hg.python.org/cpython/rev/0b219348ec9e

--

___
Python tracker 

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



[issue29263] Implement LOAD_METHOD/CALL_METHOD for C functions

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0b219348ec9e by Victor Stinner in branch 'default':
Optimize methoddescr_call(): avoid temporary PyCFunction
https://hg.python.org/cpython/rev/0b219348ec9e

--
nosy: +python-dev

___
Python tracker 

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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 261b108b9468 by Victor Stinner in branch 'default':
Remove unused func parameter of _PyStack_UnpackDict()
https://hg.python.org/cpython/rev/261b108b9468

--

___
Python tracker 

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



[issue29306] Check usage of Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() in new FASTCALL functions

2017-01-18 Thread STINNER Victor

New submission from STINNER Victor:

I added the following new functions to Python 3.6:

* _PyObject_FastCallDict()
* _PyObject_FastCallKeywords()
* _PyFunction_FastCallDict()
* _PyFunction_FastCallKeywords()
* _PyCFunction_FastCallDict()
* _PyCFunction_FastCallKeywords()

I'm not sure that these functions update correctly the "recursion_depth" 
counter using Py_EnterRecursiveCall() and Py_LeaveRecursiveCall().

--
components: Interpreter Core
messages: 285709
nosy: haypo, inada.naoki
priority: normal
severity: normal
status: open
title: Check usage of Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() in 
new FASTCALL functions
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-01-18 Thread INADA Naoki

INADA Naoki added the comment:

I commented at the pull request.

--

___
Python tracker 

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



[issue29305] encoding to ascii in client.py

2017-01-18 Thread Babe Hardy

New submission from Babe Hardy:

used urlopen('...{}'.format(v)).read() with v being a string
when v is of a non-ascii format:
>>UnicodeEncodeError: 'ascii' codec can't encode characters<<
in line 984 of putrequest

after changing
>>self._output(request.encode('ascii'))<<
into
>>self._output(request.encode('utf-8'))<<

my script worked again

--
components: Library (Lib)
messages: 285707
nosy: Babe Hardy
priority: normal
severity: normal
status: open
title: encoding to ascii in client.py
type: compile error
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



[issue9216] FIPS support for hashlib

2017-01-18 Thread Yolanda

Yolanda added the comment:

@rbtcollins, even if we go with a FIPS aware module, we'd still need to detect 
if md5 was used for security purposes.
If we build a system that detects FIPS enablement, call md5 say ... for 
generating a password, and then the python fips_md5 call is masking it, we'd be 
breaking FIPS rules.
I still see the point of the used_for_security flag. Maybe reverting the flag, 
set used_for_security to False because the normal usage of md5 shall be for 
hashes and non security stuff?

--

___
Python tracker 

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