[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Brett Cannon

Brett Cannon added the comment:

If you run hg.python.org/benchmarks on Linux it has a flag to measure memory.

--

___
Python tracker 

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



[issue26098] PEP 510: Specialize functions with guards

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

FIXME: sys.getsizecode(func) doesn't include specialized code and guards.

--

___
Python tracker 

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



[issue26224] Add "version added" for documentation of asyncio.timeout for documentation of python 3.4, 3.5, 3.6

2016-01-27 Thread Udi Oron

New submission from Udi Oron:

It seems like `asyncio.timeout` is going to be added in 3.4.5, 3.5.2 and 3.6.

The current live documentation of python 3.4 and python 3.5.1 does not include 
a comment regarding it is not yet available in the current released versions of 
python.

The documentation should include a `.. versionadded:: 3.4.5`, `.. 
versionadded:: 3.5.2` or `.. versionadded:: 3.6` according to the branch.

--
assignee: docs@python
components: Documentation, asyncio
files: asyncio-timeout.patch
keywords: patch
messages: 259071
nosy: Udi Oron, docs@python, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Add "version added" for documentation of asyncio.timeout for 
documentation of python 3.4, 3.5, 3.6
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41731/asyncio-timeout.patch

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

If I understand correctly, this change requires to wait until the PEP 509 is 
accepted, right? Well, I'm not really suprised, since global cache is mentioned 
as an use case of the PEP 509, and other global cache patches are mentioned in 
Prior Art.

--

___
Python tracker 

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



[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Stefan Krah

Stefan Krah added the comment:

The spec was the only reasonable choice at the time decimal.py was
written.  Incidentally, it is basically IEEE-754-2008 with arbitrary
precision extensions; this isn't surprising since Mike Cowlishaw was
on the IEEE committee and wrote the spec at the same time.

There are very few decNumber-specific remainders in the spec -- this
may be one of those (though I did not bother to look up if the IEEE
standard specifies formatting at all).

--

___
Python tracker 

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



[issue26225] New misleading wording in execution model documenation

2016-01-27 Thread Andrew Barnert

New submission from Andrew Barnert:

In #24129, the wording describing class local bindings in 4.2.2 "Resolution of 
names" was changed for Python 3.4, 3.5, and 3.6. The new version is a lot 
clearer for classes--but now it's misleading for `exec`/`eval`.

---

> Class definition blocks and arguments to exec() and eval() are
> special in the context of name resolution. A class definition is...

... and then proceeds to explain how class lookup works, without ever 
mentioning `exec` and `eval`. This implies that they work the same way as 
classes, but of course that's not true:

i = 'global'
def f():
i = 'nonlocal'
class C:
print(i)
i = 'local'
print(i)
f()

That prints `global`, then `local`. But with `exec`:

i = 'global'
def f():
i = 'nonlocal'
exec("print(i)\ni = 'local'\nprint(i)\n")
f()

That prints `nonlocal` then `local`.

I think just putting a paragraph break between the first sentence and the rest 
of the paragraph might be sufficient to avoid the confusion here. Or just 
removing any mention of `eval` and `exec`. If not, this probably needs a new 
one-liner paragraph saying something like "Arguments to `exec()` and `eval()` 
are also special, as described later."

---

Meanwhile, if you keep reading, you'll eventually find that `exec` is described 
in a later section, 4.2.4 "Interaction with dynamic features", but that's 
_also_ misleading:

> The eval() and exec() functions do not have access to the full
> environment for resolving names. Names may be resolved in the
> local and global namespaces of the caller. Free variables are not
> resolved in the nearest enclosing namespace, but in the global
> namespace.

If that were true, the `exec` example would have printed `global`, right?

I'm pretty sure that what's going on here is that `exec` implicitly calls 
`locals()` (or, rather, the C-API equivalent), which constructs a locals dict 
on demand, which, only if you're inside a function block, includes not just the 
currently-bound fast locals, but _also_ the cell_contents of the 
currently-bound free variables. So, as far as `exec` is concerned, `i` is not 
an unbound local, or a free variable, but a local, which is bound to the 
`'nonlocal'` cell value of `i` at the time `exec` was called.

Which means the following actually _does_ print `global`:

i = 'global'
def f():
exec("print(i)\ni = 'local'\nprint(i)\n")
i = 'nonlocal'
f()

I have no idea how to make this clear. Maybe the simplest is to not try to give 
a full explanation here, and instead punt to the `locals()` function 
definition? Maybe something like this:

> The `eval()` and `exec()` functions do not have access to the full 
> environment for resolving names, but rather to the approximation of that 
> environment as constructed by the `locals()` function. Free variables that 
> are not captured as locals are not resolved in the nearest enclosing 
> namespace, but in the global...

... and from there, the same as the current paragraph.

--
assignee: docs@python
components: Documentation
messages: 259073
nosy: abarnert, docs@python
priority: normal
severity: normal
status: open
title: New misleading wording in execution model documenation

___
Python tracker 

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



[issue26225] New misleading wording in execution model documenation

2016-01-27 Thread Andrew Barnert

Changes by Andrew Barnert :


--
type:  -> enhancement

___
Python tracker 

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



[issue26183] 2.7.11 won't clean install on Windows 10 x64

2016-01-27 Thread Steve Dower

Steve Dower added the comment:

VS 2015 won't cause this (I also work on that product as my day job, so I know 
exactly what it does and doesn't do), but the registry corruption probably did.

The pip support that's in the 2.7 installer is not the most robust code, and it 
can easily run into issues when your install is broken that make it fail. 
Repairing your prior install before uninstalling it is the easiest way to fix 
this in practically every case.

--

___
Python tracker 

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



[issue17394] Add slicing support to collections.deque

2016-01-27 Thread Josh Rosenberg

Josh Rosenberg added the comment:

It seems odd to have a slice of a deque return a list. Are there any other 
examples of non-buffer protocol objects behaving like this in the standard 
library/built-ins? Only examples I can come up with are mmap objects and ctypes 
arrays (which are making raw binary data available in Python); it seems rather 
surprising that a Python level type like deque would slice to produce a list.

--
nosy: +josh.r

___
Python tracker 

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



[issue26225] New misleading wording in execution model documenation

2016-01-27 Thread Eryk Sun

Eryk Sun added the comment:

The class example defines "i" as a local variable, which means the CPython 
operation used for unoptimized code (class or module/exec) is LOAD_NAME, which 
searches locals, globals, and builtins. The result differs from the exec 
example because a class is executed with a new locals dict to capture the class 
namespace. 

I think a more interesting case to explain is code that uses LOAD_CLASSDEREF. 
This operation tries locals and nonlocals, but not globals or builtins.

i = 'global'
def f():
i = 'nonlocal'
class C:
print(i)

>>> f()
nonlocal

i = 'global'
def f():
class C:
print(i)
i = 'nonlocal'

>>> f()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in f
  File "", line 3, in C
NameError: free variable 'i' referenced before assignment in enclosing scope

i = 'global'
def f():
class C:
locals()['i'] = 'local'
print(i)
i = 'nonlocal'

>>> f()
local

i = 'global'
def f():
i = 'nonlocal'
class C:
nonlocal i
print(i)
i = 'new nonlocal'
print(i)
print(i)

>>> f()
nonlocal
new nonlocal
new nonlocal

--
nosy: +eryksun

___
Python tracker 

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



[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Guido van Rossum

Guido van Rossum added the comment:

Can you suggest a sentence to insert into the docs and a place where
to insert it? (As you can imagine I'm pretty blind for such issues
myself.)

--

___
Python tracker 

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



[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The decimal module strives to exactly follow the spec even when our 
sensibilities suggest otherwise. Perhaps, we can add a note to the current docs 
describing the situation.  The API itself is a settled issue, that ship sailed 
a very long time ago (the problem with a standard library is that it becomes 
standard that people rely on and is hard to change after the fact without 
causing issues for users).

--
assignee:  -> rhettinger
nosy: +facundobatista, mark.dickinson, rhettinger, skrah, tim.peters

___
Python tracker 

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



[issue26226] Various test suite failures on Windows

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

For the test_httpservers failure, can you please try the following commands on 
your PC?

>>> socket.gethostname()
'selma'
>>> socket.gethostbyaddr(socket.gethostname())
('selma', [], ['2a01:e34:ec8d:4c70:3ea9:f4ff:fe65:c0c', 
'fe80::3ea9:f4ff:fe65:c0c'])

--
nosy: +haypo

___
Python tracker 

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



[issue26226] Various test suite failures on Windows

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

I'm surprised by the test_codecencodings_iso2022 failures. Example:

==
FAIL: test_incrementaldecoder (test.test_codecencodings_iso2022.Test_ISO2022_KR)
--
Traceback (most recent call last):
  File "E:\GitHub\cpython\lib\test\multibytecodec_support.py", line 208, in 
test_incrementaldecoder
self.assertEqual(ostream.getvalue(), self.tstring[1])
AssertionError: b'\xe[334 
chars]\x80\n\xed\x9a\xa8\xec\x9c\xa8\xec\xa0\x81\xec[1668 chars]4.\n' != 
b'\xe[334 chars]\x80\r\n\xed\x9a\xa8\xec\x9c\xa8\xec\xa0\x81\x[1682 chars]\r\n'



It looks like Python uses the wrong encoding to decode stdout of child 
processes:

==
ERROR: test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase)
--
Traceback (most recent call last):
  File "E:\GitHub\cpython\lib\distutils\tests\test_build_ext.py", line 61, in 
test_build_ext
cmd.run()
  File "E:\GitHub\cpython\lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
  File "E:\GitHub\cpython\lib\distutils\command\build_ext.py", line 447, in 
build_extensions
self._build_extensions_serial()
  File "E:\GitHub\cpython\lib\distutils\command\build_ext.py", line 472, in 
_build_extensions_serial
self.build_extension(ext)
  File "E:\GitHub\cpython\lib\distutils\command\build_ext.py", line 532, in 
build_extension
depends=ext.depends)
  File "E:\GitHub\cpython\lib\distutils\_msvccompiler.py", line 306, in compile
self.initialize()
  File "E:\GitHub\cpython\lib\distutils\_msvccompiler.py", line 199, in 
initialize
vc_env = _get_vc_env(plat_spec)
  File "E:\GitHub\cpython\lib\distutils\_msvccompiler.py", line 92, in 
_get_vc_env
universal_newlines=True,
  File "E:\GitHub\cpython\lib\subprocess.py", line 636, in check_output
**kwargs).stdout
  File "E:\GitHub\cpython\lib\subprocess.py", line 705, in run
stdout, stderr = process.communicate(input, timeout=timeout)
  File "E:\GitHub\cpython\lib\subprocess.py", line 1062, in communicate
stdout = self.stdout.read()
  File "E:\GitHub\cpython\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 49: 
character maps to 

It would help to add a print() to lib\distutils\_msvccompiler.py:92 to get the 
executed command, then run manually the command, and see non-ASCII characters 
in the output.

--

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

My only aversion to raising an exception is that it goes against the original 
intent of maxlen as giving an automatic-pop-to-make-room behavior.

Rather that introduce a discontinuity, I like the "smoothness" of letting 
d.insert(len(d), obj) follow the insert-normally-then-pop-from-the-right rule 
as opposed to having a special case.

--

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-27 Thread Josh Rosenberg

Josh Rosenberg added the comment:

I agree with Tim that arbitrarily deciding that insert should behave more like 
appendleft is surprising. This really feels like guessing at what the user 
wants, silently doing something that really isn't predictable.

Any of the following seem nicer (not exactly arguing for any but #1):

1. Raising an exception for full deque
2. Making insert pop left when full (and possibly make insertleft that will pop 
right; the name isn't perfect, but it would make the symmetry between "no 
suffix pops left and 'left' suffix pops right" line up with other deque methods)
3. Adding an optional argument to say which end should be popped (defaulting to 
"raise an exception", probably no good though, since it would break Sequence 
rules.

--
nosy: +josh.r

___
Python tracker 

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



[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-27 Thread Steve Dower

Steve Dower added the comment:

That's true, though if you use the embeddable distribution of Python 3.5 you 
automatically get the equivalent behavior because of a new option (the 
"applocal" option in pyvenv.cfg, which is enabled in that distro by default).

--

___
Python tracker 

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



[issue26226] Various test suite failures on Windows

2016-01-27 Thread Emanuel Barry

Changes by Emanuel Barry :


--
stage:  -> needs patch
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



[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

FYI I created the issue #26227 to change the encoding used to decode hostnames 
on Windows. UTF-8 doesn't seem to be the right encoding, it fails on non-ASCII 
hostnames. I propose to use the ANSI code page.

Sorry, I didn't read this issue, but it looks like IDNA isn't the good encoding 
to decode hostnames *on Windows*.

--

___
Python tracker 

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



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2016-01-27 Thread Martin Panter

Martin Panter added the comment:

I agree with all the changes you made. I made one review comment.

It would be nice to add a test case to expose the problem. Correct me if I am 
wrong, but it doesn’t look like pty.spawn() is tested at all.

FWIW on Linux, reading from the master end seems to raise EIO if the slave has 
been closed. And writing to the master when the slave is closed seems to fill 
up a buffer and eventually blocks.

Ideally I think the best solution for handing exec() failure (Issue 17824) 
would be to eliminate fork-exec with posix_spawn(); see Issue 20104. But as you 
say, that’s a separate problem.

--
components: +Library (Lib)
nosy: +martin.panter
stage:  -> patch review
type:  -> behavior
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26220] Unicode HOWTO references a question mark that isn't in snippet

2016-01-27 Thread Martin Panter

Martin Panter added the comment:

Thanks for the report Quentin.

--
nosy: +martin.panter
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions:  -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



[issue26226] Various test suite failures on Windows

2016-01-27 Thread Emanuel Barry

New submission from Emanuel Barry:

Compiled latest master and ran test suite (Py_DEBUG build). A few failures here 
and there, and some tests skipped. I haven't yet looked into getting the proper 
libraries to make some of the skipped tests execute, I'm trying to make the 
whole test suite pass first.

Attached file includes verbose output for all failed tests. The end of the file 
and the traceback at the end of the message here happen, then Python hangs and 
never resumes (tested for ~20 minutes).

Python 3.6.0a0 (default, Jan 27 2016, 10:49:09) [MSC v.1900 32 bit (Intel)] on w
in32
Type "help", "copyright", "credits" or "license" for more information.
>>> import test.regrtest
>>> test.regrtest.main_in_temp_cwd() # same as 'py -m test'
== CPython 3.6.0a0 (default, Jan 27 2016, 10:49:09) [MSC v.1900 32 bit (Intel)]
==   Windows-7-6.1.7601-SP1 little-endian
==   hash algorithm: siphash24 32bit
==   E:\GitHub\cpython\build\test_python_13304
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0,
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0,
bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[  1/400] test_grammar
[  2/400] test_opcodes
[  3/400] test_dict
[  4/400] test_builtin
[  5/400] test_exceptions
[  6/400] test_types
[  7/400] test_unittest
[  8/400] test_doctest
[  9/400] test_doctest2
[ 10/400] test_support
[ 11/400] test___all__
[ 12/400] test___future__
[ 13/400] test__locale
[ 14/400] test__opcode
[ 15/400] test__osx_support
[ 16/400] test_abc
[ 17/400] test_abstract_numbers
[ 18/400] test_aifc
[ 19/400] test_argparse
[ 20/400] test_array
[ 21/400] test_asdl_parser
[ 22/400] test_ast
[ 23/400] test_asynchat
[ 24/400] test_asyncio
E:\GitHub\cpython\lib\asyncio\sslproto.py:327: ResourceWarning: unclosed 
transport

  warnings.warn("unclosed transport %r" % self, ResourceWarning)
test test_asyncio failed -- multiple errors occurred; run in verbose mode for 
details
[ 25/400/1] test_asyncore
[ 26/400/1] test_atexit
[ 27/400/1] test_audioop
[ 28/400/1] test_augassign
[ 29/400/1] test_base64
[ 30/400/1] test_bigaddrspace
[ 31/400/1] test_bigmem
[ 32/400/1] test_binascii
[ 33/400/1] test_binhex
[ 34/400/1] test_binop
[ 35/400/1] test_bisect
[ 36/400/1] test_bool
[ 37/400/1] test_buffer
[ 38/400/1] test_bufio
[ 39/400/1] test_bytes
[ 40/400/1] test_bz2
[ 41/400/1] test_calendar
[ 42/400/1] test_call
[ 43/400/1] test_capi
[ 44/400/1] test_cgi
[ 45/400/1] test_cgitb
[ 46/400/1] test_charmapcodec
[ 47/400/1] test_class
[ 48/400/1] test_cmath
[ 49/400/1] test_cmd
[ 50/400/1] test_cmd_line
[ 51/400/1] test_cmd_line_script
[ 52/400/1] test_code
[ 53/400/1] test_code_module
test test_code_module failed -- multiple errors occurred; run in verbose mode 
for details
[ 54/400/2] test_codeccallbacks
[ 55/400/2] test_codecencodings_cn
[ 56/400/2] test_codecencodings_hk
[ 57/400/2] test_codecencodings_iso2022
test test_codecencodings_iso2022 failed -- multiple errors occurred; run in 
verbose mode for details
[ 58/400/3] test_codecencodings_jp
[ 59/400/3] test_codecencodings_kr
[ 60/400/3] test_codecencodings_tw
[ 61/400/3] test_codecmaps_cn
[ 62/400/3] test_codecmaps_hk
[ 63/400/3] test_codecmaps_jp
[ 64/400/3] test_codecmaps_kr
[ 65/400/3] test_codecmaps_tw
[ 66/400/3] test_codecs
[ 67/400/3] test_codeop
[ 68/400/3] test_collections
[ 69/400/3] test_colorsys
[ 70/400/3] test_compare
[ 71/400/3] test_compile
[ 72/400/3] test_compileall
[ 73/400/3] test_complex
[ 74/400/3] test_concurrent_futures
[ 75/400/3] test_configparser
[ 76/400/3] test_contains
[ 77/400/3] test_contextlib
[ 78/400/3] test_copy
[ 79/400/3] test_copyreg
[ 80/400/3] test_coroutines
[ 81/400/3] test_cprofile
[ 82/400/3] test_crashers
[ 83/400/3] test_crypt
test_crypt skipped -- No module named '_crypt'
[ 84/400/3] test_csv
[ 85/400/3] test_ctypes
[ 86/400/3] test_curses
test_curses skipped -- Use of the 'curses' resource not enabled
[ 87/400/3] test_datetime
[ 88/400/3] test_dbm
[ 89/400/3] test_dbm_dumb
[ 90/400/3] test_dbm_gnu
test_dbm_gnu skipped -- No module named '_gdbm'
[ 91/400/3] test_dbm_ndbm
test_dbm_ndbm skipped -- No module named '_dbm'
[ 92/400/3] test_decimal
[ 93/400/3] test_decorators
[ 94/400/3] test_defaultdict
[ 95/400/3] test_deque
[ 96/400/3] test_descr
[ 97/400/3] test_descrtut
[ 98/400/3] test_devpoll
test_devpoll skipped -- test works only on Solaris OS family
[ 99/400/3] test_dictcomps
[100/400/3] test_dictviews
[101/400/3] test_difflib
[102/400/3] test_dis
[103/400/3] test_distutils

E:\GitHub\cpython\build\test_python_13304>exit 1

E:\GitHub\cpython\build\test_python_13304>exit 0
Warning -- files was modified by test_distutils
test test_distutils failed -- multiple errors occurred; run in verbose mode for 
details
[104/400/4] test_docxmlrpc
[105/400/4] test_dummy_thread
[106/400/4] test_dummy_threading
[107/400/4] test_dynamic
[108/400/4] test_dynamicclassattribute
[109/400/4] test_eintr
[110/400/4] test_email
[111/400/4] test_ensurepip
[112/400/4] 

[issue26181] argparse can't handle positional argument after list (help message is wrong)

2016-01-27 Thread paul j3

paul j3 added the comment:

There are 2 issues

parsing - how to reserve one or more arguments for use by following 
'positionals'.  Fixes have been proposed in other bug/issues, but aren't 
trivial.

usage formatting - the stock formatter displays all optionals first, followed 
by all positionals.  In a multiline display positionals go on a new line.

Changes to the help formatter that would block this reordering have been 
discussed on Stackoverflow, but I don't recall such an issue here.  It can be 
done by changing one method in a subclassed formatter.

The immediate solution is to give your parser a custom usage line - one that 
puts the positional in the correct order.

--
nosy: +paul.j3

___
Python tracker 

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



[issue26226] Various test suite failures on Windows

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Python 2.7.11:

>>> import socket
>>> socket.gethostname()
'\xc9manuel-PC'

This one works on Python 3 because the Python function is implemented with a 
call to the Windows native API.

>>> socket.gethostbyaddr(socket.gethostname())
('\xc9manuel-PC.home', [], ['fe80::c9b7:5117:eea4:a104'])

This one fails on Python 3 because it uses the gethostbyaddr() C function and 
then decodes the hostname from UTF-8, whereas the hostname looks more to be 
encoded to ISO 8859-1 or something like that. IMHO it should be decoded from 
the ANSI code page.

I opened the issue #26227 to track this bug.

--

___
Python tracker 

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



[issue17394] Add slicing support to collections.deque

2016-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Returning a deque is preferred.  For this stage, I just want to review the code 
and make sure it algorithmically correct (slicing is complicated and has a lot 
of cases).

--

___
Python tracker 

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



[issue26226] Various test suite failures on Windows

2016-01-27 Thread Emanuel Barry

Emanuel Barry added the comment:

Well, it has a non-ASCII character in it, so I wouldn't be surprised if this 
was the issue :)

Latest master (3.6):

>>> import socket
>>> socket.gethostname()
'Émanuel-PC'
>>> socket.gethostbyaddr(socket.gethostname())
Traceback (most recent call last):
  File "", line 1, in 
socket.gaierror: [Errno 11004] getaddrinfo failed

Python 2.7.11:

>>> import socket
>>> socket.gethostname()
'\xc9manuel-PC'
>>> socket.gethostbyaddr(socket.gethostname())
('\xc9manuel-PC.home', [], ['fe80::c9b7:5117:eea4:a104'])

--

___
Python tracker 

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



[issue26220] Unicode HOWTO references a question mark that isn't in snippet

2016-01-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 63c1c7cdad0f by Martin Panter in branch '3.5':
Issue #26220: Remove outdated comment about a question mark
https://hg.python.org/cpython/rev/63c1c7cdad0f

New changeset dbf90175ea50 by Martin Panter in branch 'default':
Issue #26220: Merge Unicode how-to from 3.5
https://hg.python.org/cpython/rev/dbf90175ea50

--
nosy: +python-dev

___
Python tracker 

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



[issue26215] Make GC_Head a compile-time option

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Could you please try to elaborate a little bit the issue?

> I permanently use gc.disable() but CPython create object with GC_Head.
it's use big memory.

You propose to remove GC_Head for everywhere? Or do you want a configure option?

What do you mean by "big memory"? Do you have an estimation of the "overhead" 
on an application?

--

___
Python tracker 

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



[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Serge Stroobandt

Serge Stroobandt added the comment:

An emphasized version of the exact quote is here now:
http://stackoverflow.com/a/35045233/2192488

--

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-27 Thread Tim Peters

Tim Peters added the comment:

My opinion doesn't change:  I'd rather see an exception.  I see no use case for 
inserting "into the middle" of a full bounded queue.  If I had one, it would 
remain trivial to force the specific behavior I intended.

--

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov

Yury Selivanov added the comment:

Yes, this patch depends on PEP 509.

--

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-27 Thread STINNER Victor

New submission from STINNER Victor:

On Windows, socket.gethostbyaddr() must decode the hostname from the ANSI code 
page, not from UTF-8. See for example this issue:
https://bugs.python.org/issue26226#msg259077

Attached patch changes the socket module to decode hostnames from the ANSI code 
page on Windows.

See also issues #9377, #16652 and #5004.

--
components: Unicode, Windows
messages: 259078
nosy: ebarry, ezio.melotti, haypo, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-27 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +patch
Added file: http://bugs.python.org/file41734/gethostbyaddr_encoding.patch

___
Python tracker 

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



[issue26173] test_ssl.bad_cert_test() exception handling

2016-01-27 Thread Martin Panter

Martin Panter added the comment:

There are more mistakes in the history of test_nonexisting_cert(). In revision 
8a281bfc058d (Python 2.6), the method was added as testWrongCert(), with an 
existing but non-matching certificate file. But when this was ported to Python 
3 in r66311, the wrongcert.pem file was not added, so Python 3 was actually 
testing the behaviour when the specified certificate file was missing. Then in 
r80596, the test method was renamed and a comment added assuming the Python 3 
version with the missing file. However we already test the behaviour of missing 
files in test_errors().

I do not understand the ECONNRESET failure on Windows. Perhaps there is a race 
to do with the server closing the connection when the client should be 
reporting a certificate mismatch. It seems like a bug, and I suspect r80534 is 
not the correct fix. But I’m not in a position to investigate so I will leave 
that code as it is.

For Python 2 I propose wrong-cert-py2.patch:

* Rename WRONGCERT → NONEXISTINGCERT, not to be confused with wrongcert.pem
* Repurpose test_nonexisting_cert() → test_wrong_cert()
* Remove ENOENT exception handling from bad_cert_test()

--
Added file: http://bugs.python.org/file41735/wrong-cert-py2.patch

___
Python tracker 

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



[issue26173] test_ssl.bad_cert_test() exception handling

2016-01-27 Thread Martin Panter

Martin Panter added the comment:

wrong-cert-py3.patch is similar but also adds the wrongcert.pem file from 
Python 2.

--
keywords:  -buildbot
stage: needs patch -> patch review
Added file: http://bugs.python.org/file41736/wrong-cert-py3.patch

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-27 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file41732/full_deque2.diff

___
Python tracker 

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



[issue26214] textwrap should minimize breaks

2016-01-27 Thread Tuomas Salo

New submission from Tuomas Salo:

This code:

import textwrap
textwrap.wrap("123 123 1234567", width=5)

currently* produces this output:

['123', '123 1', '23456', '7']

I would expect the textwrap module to only break words when absolutely 
necessary. That is, I would have expected it to produce one break less:

['123', '123', '12345', '67']

This is of course a matter of taste - the current implementation produces more 
efficiently filled lines.

(* I only have access to Python 2.7 and 3.4)

--
messages: 258999
nosy: Tuomas Salo
priority: normal
severity: normal
status: open
title: textwrap should minimize breaks
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker 

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



[issue26214] textwrap should minimize number of breaks in extra long words

2016-01-27 Thread Tuomas Salo

Changes by Tuomas Salo :


--
title: textwrap should minimize breaks -> textwrap should minimize number of 
breaks in extra long words

___
Python tracker 

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



[issue26214] textwrap should minimize number of breaks in extra long words

2016-01-27 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +georg.brandl
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26210] `HTMLParser.handle_data` may be invoked although `HTMLParser.reset` was invoked

2016-01-27 Thread Yannick Duchêne

Yannick Duchêne added the comment:

The documentation says:
> Reset the instance. Loses all unprocessed data.

How can parsing go ahead with all unprocessed data lost? This is the “Loses all 
unprocessed data” which made me believe it is to stop it.

May be the documentation is unclear.

By the way, if `reset` does not stop the parser, then a `stop` method is 
missing. I searched for it, and as there was nothing else and could not imagine 
the parser cannot be stopped, I though `reset` is the way to stop it.

--

___
Python tracker 

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



[issue26211] HTMLParser: “AssertionError: we should not get here!”

2016-01-27 Thread Yannick Duchêne

Yannick Duchêne added the comment:

`reset` is called to stop the parser.

If really `reset` should not be called during parser hooks execution, then the 
documentation should says so and an error should be raised when `reset` is 
invoked.

--

___
Python tracker 

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



[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8de6f19afc86 by Victor Stinner in branch '3.5':
Fix resize_compact()
https://hg.python.org/cpython/rev/8de6f19afc86

--
nosy: +python-dev

___
Python tracker 

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



[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Hum, it looks like resize_compact() clears wstr, but don't reset wstr_length to 
0. Attached patch should fix that.

--
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file41728/wstr_len.patch

___
Python tracker 

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



[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread Emanuel Barry

New submission from Emanuel Barry:

I compiled CPython from latest trunk on GitHub (revision 
a587bc1eea903dfac94a85324cc6ab39755769a8), compiled with Py_DEBUG and went to 
run the test suite. Here's the (rather long) output:

E:\GitHub\cpython\PCbuild\win32>python_d -m test
== CPython 3.6.0a0 (default, Jan 26 2016, 23:23:12) [MSC v.1900 32 bit (Intel)]
==   Windows-7-6.1.7601-SP1 little-endian
==   hash algorithm: siphash24 32bit
==   E:\GitHub\cpython\build\test_python_464
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0,
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0,
bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[  1/400] test_grammar
[  2/400] test_opcodes
[  3/400] test_dict
[  4/400] test_builtin
[  5/400] test_exceptions
[  6/400] test_types
[  7/400] test_unittest
[  8/400] test_doctest
[  9/400] test_doctest2
[ 10/400] test_support
[ 11/400] test___all__
Assertion failed: compact->wstr_length == 0, file ..\Objects\unicodeobject.c, 
line 427
Fatal Python error: Aborted

Current thread 0x0a88 (most recent call first):
  File "E:\GitHub\cpython\lib\ctypes\util.py", line 64 in find_library
  File "E:\GitHub\cpython\lib\uuid.py", line 473 in 
  File "", line 222 in _call_with_frames_removed
  File "", line 656 in exec_module
  File "", line 673 in _load_unlocked
  File "", line 958 in _find_and_load_unlocked
  File "", line 969 in _find_and_load
  File "E:\GitHub\cpython\lib\test\test_os.py", line 29 in 
  File "", line 222 in _call_with_frames_removed
  File "", line 656 in exec_module
  File "", line 673 in _load_unlocked
  File "", line 958 in _find_and_load_unlocked
  File "", line 969 in _find_and_load
  File "", line 1 in 
  File "E:\GitHub\cpython\lib\test\test___all__.py", line 23 in check_all
  File "E:\GitHub\cpython\lib\test\test___all__.py", line 105 in test_all
  File "E:\GitHub\cpython\lib\unittest\case.py", line 600 in run
  File "E:\GitHub\cpython\lib\unittest\case.py", line 648 in __call__
  File "E:\GitHub\cpython\lib\unittest\suite.py", line 122 in run
  File "E:\GitHub\cpython\lib\unittest\suite.py", line 84 in __call__
  File "E:\GitHub\cpython\lib\unittest\suite.py", line 122 in run
  File "E:\GitHub\cpython\lib\unittest\suite.py", line 84 in __call__
  File "E:\GitHub\cpython\lib\unittest\suite.py", line 122 in run
  File "E:\GitHub\cpython\lib\unittest\suite.py", line 84 in __call__
  File "E:\GitHub\cpython\lib\test\support\__init__.py", line 1679 in run
  File "E:\GitHub\cpython\lib\test\support\__init__.py", line 1780 in _run_suite
  File "E:\GitHub\cpython\lib\test\support\__init__.py", line 1814 in 
run_unittest
  File "E:\GitHub\cpython\lib\test\libregrtest\runtest.py", line 161 in 
test_runner
  File "E:\GitHub\cpython\lib\test\libregrtest\runtest.py", line 162 in 
runtest_inner
  File "E:\GitHub\cpython\lib\test\libregrtest\runtest.py", line 126 in runtest
  File "E:\GitHub\cpython\lib\test\libregrtest\main.py", line 295 in 
run_tests_sequential
  File "E:\GitHub\cpython\lib\test\libregrtest\main.py", line 356 in run_tests
  File "E:\GitHub\cpython\lib\test\libregrtest\main.py", line 392 in main
  File "E:\GitHub\cpython\lib\test\libregrtest\main.py", line 433 in main
  File "E:\GitHub\cpython\lib\test\libregrtest\main.py", line 455 in 
main_in_temp_cwd
  File "E:\GitHub\cpython\lib\test\__main__.py", line 3 in 
  File "E:\GitHub\cpython\lib\runpy.py", line 85 in _run_code
  File "E:\GitHub\cpython\lib\runpy.py", line 184 in _run_module_as_main

E:\GitHub\cpython\PCbuild\win32>python_d
Python 3.6.0a0 (default, Jan 26 2016, 23:23:12) [MSC v.1900 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import test.test___all__
>>> import unittest
>>> unittest.main(test.test___all__)

<...>

test.test_openpty
test.test_operator
test.test_optparse
test.test_ordered_dict
test.test_os
Assertion failed: compact->wstr_length == 0, file ..\Objects\unicodeobject.c, 
line 427

E:\GitHub\cpython\PCbuild\win32>python_d
Python 3.6.0a0 (default, Jan 26 2016, 23:23:12) [MSC v.1900 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import test.test_os
Assertion failed: compact->wstr_length == 0, file ..\Objects\unicodeobject.c, 
line 427

Call stack (from importing 'test.test_os'):

ucrtbased.dll!0f7d81f0()Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for 
ucrtbased.dll] 
[External Code] 
>   python36_d.dll!_PyUnicode_CheckConsistency(_object * op, int 
> check_content) Line 427C
python36_d.dll!resize_compact(_object * unicode, int length) Line 920   
C
python36_d.dll!unicode_resize(_object * * p_unicode, int length) Line 
1844  C
python36_d.dll!PyUnicode_Append(_object * * p_left, _object * right) 
Line 11301 C
python36_d.dll!unicode_concatenate(_object * v, _object * w, _frame * 
f, unsigned char * 

[issue26218] Set PrependPath default to true

2016-01-27 Thread Wallison Resende Santos

New submission from Wallison Resende Santos:

Please, set the PrependPath configuration to true. It's a good option for 
console developers on windows.

--
components: Installation
messages: 259028
nosy: Wallison Resende Santos
priority: normal
severity: normal
status: open
title: Set PrependPath default to true
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



[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread Emanuel Barry

Emanuel Barry added the comment:

This fixed it, thanks!

--
stage:  -> patch review

___
Python tracker 

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



[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread Emanuel Barry

Changes by Emanuel Barry :


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



[issue26229] Make number serialization ES6/V8 compatible

2016-01-27 Thread Anders Rundgren

New submission from Anders Rundgren:

ECMA has in their latest release defined that JSON elements must be ordered 
during serialization.  This is easy to accomplish using Python's OrderedDict.  
What is less trivial is that numbers have to be formatted in a certain way as 
well.  I have tested 100 millions specific and random values and found out that 
Python 3.5.1 is mathematically identical to ES6/V8 but has some differences in 
formatting:

   IEEE DoubleECMAScript 6/V8Python 3.5.1

c43211ede4974a35, -0,-3.333e+20
c3fce97ca0f21056, -6000, -3.3336e+19
c3c7213080c1a6ac, -3334000,  -3.334e+18
c39280f39a348556, -333400,   -3.334e+17
c35d9b1f5d20d557, -33340,-3.334e+16

c327af4c4a80aaac, -3334, -3334.0

bf0179ec9cbd821e, -0.5,  -3.3335e-05
becbf647612f3696, -0.03, -3.e-06

4024, 10,10.0
, 0, 0.0
4014, 5, 5.0
3f0a36e2eb1c432d, 0.5,   5e-05
3ed4f8b588e368f1, 0.05,  5e-06

3ea0c6f7a0b5ed8d, 5e-7,  5e-07

Why could this be important?

https://github.com/Microsoft/ChakraCore/issues/149

# Python test program
import binascii
import struct
import json

f = open('c:\\es6\\numbers\\es6testfile100m.txt','rb')

l = 0;
string = '';

while True:
  byte = f.read(1);
  if len(byte) == 0:
exit(0)
  if byte == b'\n':
l = l + 1;
i = string.find(',')
if i <= 0 or i >= len(string) - 1:
  print('Bad string: ' + str(i))
  exit(0)
hex = string[:i]
while len(hex) < 16:
  hex = '0' + hex
o = dict()
o['double'] = struct.unpack('>d',binascii.a2b_hex(hex))[0]
py3Double = json.dumps(o)[11:-1]
es6Double = string[i + 1:]
if es6Double != py3Double:
  es6Dpos = es6Double.find('.')
  py3Dpos = py3Double.find('.')
  es6Epos = es6Double.find('e')
  py3Epos = py3Double.find('e')
  if py3Epos > 0:
py3Exp = int(py3Double[py3Epos + 1:])
  if es6Dpos < 0 and py3Dpos > 0:
if es6Epos < 0 and py3Epos > 0:
  py3New = py3Double[:py3Dpos] + py3Double[py3Dpos + 1:py3Epos - 
len(py3Double)]
  q = py3Exp - py3Epos + py3Dpos
  while q >= 0:
py3New += '0'
q -= 1
  if py3New != es6Double:
print('E1: ' + py3New)
exit(0)
elif py3Epos < 0:
  py3New = py3Double[:-2]
  if py3New != es6Double:
print('E2: ' + py3New)
exit(0)
else:
  print (error + hex + '#' + es6Double + '#' + py3Double)
  exit(0)
  elif es6Dpos > 0 and py3Dpos > 0 and py3Epos > 0 and es6Epos < 0:
py3New = py3Double[py3Dpos - 1:py3Dpos] + py3Double[py3Dpos + 1:py3Epos 
- len(py3Double)]
q = py3Exp + 1
while q < 0:
  q += 1
  py3New = '0' + py3New
py3New = py3Double[0:py3Dpos - 1] + '0.' + py3New 
if py3New != es6Double:
  print('E3: ' + py3New + '#' + es6Double)
  exit(0)
  elif es6Dpos == py3Dpos and py3Epos > 0 and es6Epos > 0:
py3New = py3Double[:py3Epos + 2] + str(abs(py3Exp))
if py3New != es6Double:
  print('E4: ' + py3New + '#' + es6Double)
  exit(0)
  elif es6Dpos > 0 and py3Dpos < 0 and py3Epos > 0 and es6Epos < 0:
py3New = py3Double[:py3Epos - len(py3Double)]
q = py3Exp + 1
while q < 0:
  q += 1
  py3New = '0' + py3New
py3New = '0.' + py3New 
if py3New != es6Double:
  print('E5: ' + py3New + '#' + es6Double)
  exit(0)
  else:
print ('Unexpected: ' + hex + '#' + es6Double + '#' + py3Double)
exit(0)
string = ''
if l % 1 == 0:
  print(l)
  else:
string += byte.decode(encoding='UTF-8')

--
components: Interpreter Core
messages: 259105
nosy: anders.rundgren@gmail.com
priority: normal
severity: normal
status: open
title: Make number serialization ES6/V8 compatible
type: enhancement
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



[issue26034] venv documentation out of date

2016-01-27 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report, Dan. Most of the docs has already been updated in 
c3c188a0325a. I've updated the remaining ones.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-01-27 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't feel that strongly about it.

--

___
Python tracker 

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



[issue26002] make statistics.median_grouped more efficient

2016-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This code looks good and will certainly reduce the number of comparisons in 
non-trivial cases.

FWIW, It looks like the index functions are lifted directly from the bisect 
docs.

Steven, any objections?

--
nosy: +rhettinger
stage:  -> 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



[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

> This would also be avoided by blocking SIGUSR1.

Sorry, I'm lost on this old and complex issue. Can you please propose a patch?

If it doesn't break test_eintr on Linux and FreeBSD, we can just push
it and take a look sometimes at FreeBSD buildbots ;-)

--

___
Python tracker 

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



[issue26218] Set PrependPath default to true

2016-01-27 Thread Bruno Salvino

Bruno Salvino added the comment:

Please, set the PrependPath configuration to true.

--
nosy: +Bruno Salvino

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 34ca24fa1b4a by Terry Jan Reedy in branch '2.7':
Issue #25507: revert incorrect movement of idleConf import in a37ea1d56e98.
https://hg.python.org/cpython/rev/34ca24fa1b4a

New changeset 86105a109830 by Terry Jan Reedy in branch '3.5':
Issue #25507: revert incorrect movement of idleConf import in c548ad75160c.
https://hg.python.org/cpython/rev/86105a109830

--
nosy: +python-dev

___
Python tracker 

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



[issue26220] Unicode HOWTO references a question mark that isn't in snippet

2016-01-27 Thread Quentin Pradet

New submission from Quentin Pradet:

>From https://docs.python.org/3.6/howto/unicode.html#the-string-type:

> The following examples show the differences::
>
> >>> b'\x80abc'.decode("utf-8", "strict")  #doctest: +NORMALIZE_WHITESPACE
> Traceback (most recent call last):
> ...
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0:
>   invalid start byte
> >>> b'\x80abc'.decode("utf-8", "replace")
> '\ufffdabc'
> >>> b'\x80abc'.decode("utf-8", "backslashreplace")
> '\\x80abc'
> >>> b'\x80abc'.decode("utf-8", "ignore")
> 'abc'
>
> (In this code example, the Unicode replacement character has been replaced by
> a question mark because it may not be displayed on some systems.)

I think the whole sentence after the snippet can be removed because this is 
exactly what Python 3.2+ outputs. It looks like the commit which added this 
sentence dates from Python 3.1: 
https://github.com/python/cpython/commit/34d4c82af56ebc1b65514a118f0ec7feeb8e172f,
 but another commit around Python 3.3 removed it: 
https://github.com/python/cpython/commit/63172c46706ae9b2a3bc80d639504a57fff4e716.

--
assignee: docs@python
components: Documentation
messages: 259034
nosy: Quentin.Pradet, docs@python
priority: normal
severity: normal
status: open
title: Unicode HOWTO references a question mark that isn't in snippet
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords

2016-01-27 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



[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-01-27 Thread R. David Murray

R. David Murray added the comment:

So fixing distutils to use RawConfigParser?  How likely is that to break 
currently working python3-only code?  I'm imagining from what you wrote that 
your answer is "very close to zero', but I'd like explicit confirmation :)

--

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov

Changes by Yury Selivanov :


--
assignee: yselivanov
components: Interpreter Core
nosy: yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: implement per-opcode cache in ceval
type: performance
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



[issue25675] doc for BaseEventLoop.run_in_executor() says its a coroutine, but it is not

2016-01-27 Thread Ian Kelly

Ian Kelly added the comment:

The asyncio docs also have this note, so this is technically not a bug:

Note: In this documentation, some methods are documented as coroutines, even if 
they are plain Python functions returning a Future. This is intentional to have 
a freedom of tweaking the implementation of these functions in the future. If 
such a function is needed to be used in a callback-style code, wrap its result 
with ensure_future().

Since the intention seems to be to document something that can be awaited 
without specifying the implementation, I think that these functions should be 
documented as returning awaitables. However GvR in python-ideas said:

IMO [the docs] should be very clear about the distinction between functions 
that return Futures and functions that return coroutines (of either kind). I 
think it's fine if they are fuzzy about whether the latter return a PEP 492 
style coroutine (i.e. defined with async def) or a pre-PEP-492 coroutine 
(marked with @asyncio.coroutine), since those are almost entirely 
interchangeable, and the plan is to eventually make everything a PEP 492 
coroutine.

Source: http://thread.gmane.org/gmane.comp.python.ideas/38045/focus=38046

--
nosy: +ikelly

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions:  -Python 3.4

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Ouch.  Moving the idleConf import was a blunder.  It disabled printing in 
2.7.11, 3.4.4, and 3.5.1.  When I revert, I will also augment the htest to test 
the printing and save-as functions.  Still have to remember to run it though.

This sort of functional test is not the main intended use of htests.  When 
refactoring for this issue, automated tests should be added, with mocks used to 
avoid consequential actions that cannot be part of a buildbot test.  For 
print_window, '''pipe = os.popen(command, "r")''' 
(https://hg.python.org/cpython/file/tip/Lib/idlelib/IOBinding.py#l463) should 
be replaced by '''pipe = runcommand(command)''' and 'def runcommand(command): 
return os.pipe(command, 'r')''' (with subprocess used instead?) added at module 
level.  Then runcommand can be replaced by a mock when testing, and the value 
of the passed command checked.

--
nosy:  -python-dev

___
Python tracker 

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



[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Ian Kelly

New submission from Ian Kelly:

I was playing around with this class for adapting regular iterators to async 
iterators using BaseEventLoop.run_in_executor:


import asyncio

class AsyncIteratorWrapper:

def __init__(self, iterable, loop=None, executor=None):
self._iterator = iter(iterable)
self._loop = loop or asyncio.get_event_loop()
self._executor = executor

async def __aiter__(self):
return self

async def __anext__(self):
try:
return await self._loop.run_in_executor(
self._executor, next, self._iterator)
except StopIteration:
raise StopAsyncIteration


Unfortunately this fails because when next raises StopIteration, 
run_in_executor swallows the exception and just returns None back to the 
coroutine, resulting in an infinite iterator of Nones.

--
components: asyncio
messages: 259036
nosy: gvanrossum, haypo, ikelly, yselivanov
priority: normal
severity: normal
status: open
title: asynco run_in_executor swallows StopIteration
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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Problem was reported here 
https://stackoverflow.com/questions/35021370/i-cant-print-from-python-idle-in-windows-10

--

___
Python tracker 

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



[issue26215] Make GC_Head a compile-time option

2016-01-27 Thread Brett Cannon

Changes by Brett Cannon :


--
title: remove gc from CPython -> Make GC_Head a compile-time option

___
Python tracker 

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



[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy:  -haypo

___
Python tracker 

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



[issue10401] Globals / builtins cache

2016-01-27 Thread INADA Naoki

Changes by INADA Naoki :


--
nosy: +naoki

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Brett Cannon

New submission from Brett Cannon:

I assume there's going to be a patch or more of a description of what your idea 
is? :)

--
nosy: +brett.cannon

___
Python tracker 

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



[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Guido van Rossum

Guido van Rossum added the comment:

What are you trying to do here? Can you post a simple example of an iterator 
that you would like to use with this? Without that it just raises my hackles -- 
it seems totally wrong to run an iterator in another thread. (Or is the 
iterator really a coroutine/future?)

--

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov

Yury Selivanov added the comment:

Yeah, I needed a URL of the issue for my email to python-dev ;)

Here's a link to the email, that explains a lot about this patch: 
https://mail.python.org/pipermail/python-dev/2016-January/142945.html

The patch is also attached (opcache1.patch).

--
keywords: +patch
Added file: http://bugs.python.org/file41729/opcache1.patch

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +haypo, ncoghlan

___
Python tracker 

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



[issue26222] Missing code in linux_distribution python 2.7.11

2016-01-27 Thread Rasmus Rynning Rasmussen

New submission from Rasmus Rynning Rasmussen:

During the transition from python 2.7.10 to 2.7.11 some code seems to have been 
lost. platform.linux_distribution() is not able to recognise Debian based 
distributions in python 2.7.11.

The following code was present in platform.py, python 2.7.10, but seems to be 
missing in 2.7.11

# check for the LSB /etc/lsb-release file first, needed so
# that the distribution doesn't get identified as Debian.
try:
with open("/etc/lsb-release", "rU") as etclsbrel:
for line in etclsbrel:
m = _distributor_id_file_re.search(line)
if m:
_u_distname = m.group(1).strip()
m = _release_file_re.search(line)
if m:
_u_version = m.group(1).strip()
m = _codename_file_re.search(line)
if m:
_u_id = m.group(1).strip()
if _u_distname and _u_version:
return (_u_distname, _u_version, _u_id)
except (EnvironmentError, UnboundLocalError):
pass

--
components: Build
messages: 259037
nosy: Rasmus Rynning Rasmussen
priority: normal
severity: normal
status: open
title: Missing code in linux_distribution python 2.7.11
type: performance
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



[issue26182] Deprecation warnings for the future async and await keywords

2016-01-27 Thread Brett Cannon

Brett Cannon added the comment:

If someone wants to try and fix this, I would look at how the warning for the 
'with' statement was handled (it will either be in the compiler while 
generating bytecode or somewhere in the parser, but I'm fairly certain it's the 
compiler).

--
nosy: +brett.cannon

___
Python tracker 

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



[issue26183] 2.7.11 won't clean install on Windows 10 x64

2016-01-27 Thread Tom Parker

Tom Parker added the comment:

FYI, I ran into this same issue, I believe this was caused by my selecting 
Python tools when installing Visual Studio 2015 Community edition. But I 
removed it and the issued didn't go away.

Then I deleted some empty python registry keys and voila the installer worked.

--
nosy: +tomparker

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The expected behavior should be "insert normally as if the deque were unbounded 
and then pop-off the rightmost element to restore the maxlen invariant".

The applied fix does that for non-negative indices but gives the wrong result 
for negative indicies:

  >>> from collections import deque
  >>> d = deque('abcde', maxlen=5)
  >>> d.insert(-1, 'f')
  >>> list(d)
  ['a', 'b', 'c', 'f', 'd']
  >>> s = list('abcde')
  >>> s.insert(-1, 'f'); del s[-1]
  >>> s
  ['a', 'b', 'c', 'd', 'f']

I think the behavior can be made explainable and also be useful for common 
cases, but there is likely no getting around odd looking results with negative 
index insertions into bounded deques already at their maximum size.

--

___
Python tracker 

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



[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Eric V. Smith

Eric V. Smith added the comment:

Agreed. And, since any API change would just be a 3.6+ change, this would 
increase the difficulty of moving between 2.7 and 3.x. Which is not something 
we want.

--

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov

Yury Selivanov added the comment:

> If you run hg.python.org/benchmarks on Linux it has a flag to measure memory.

Great.  I'll re-run the benchmarks.  BTW, the latest results are here: 
https://gist.github.com/1st1/aed69d63a2ff4de4c7be

--

___
Python tracker 

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



[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Ian Kelly

Ian Kelly added the comment:

The idea is that the wrapped iterator is something potentially blocking, like a 
database cursor that doesn't natively support asyncio. Usage would be something 
like this:


async def get_data():
cursor.execute('select * from stuff')
async for row in AsyncIteratorWrapper(cursor):
process(row)


Investigating this further, I think the problem is actually in await, not 
run_in_executor:

>>> async def test():
... fut = asyncio.Future()
... fut.set_exception(StopIteration())
... print(await fut)
... 
>>> loop.run_until_complete(test())
None

--

___
Python tracker 

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



[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Guido van Rossum

Guido van Rossum added the comment:

StopIteration has a special meaning. Don't use set_exception() with it.

You probably need a more roundabout way to do this.

Instead of submitting each __next__() call to the executor separately, you 
should submit something to the executor that pulls the items from the iterator 
and sticks them into a queue; then on the asyncio side you pull them out of the 
queue.

You can use an asyncio.Queue as the queue, and use loop.call_soon_threadsafe() 
to put things into that queue from the tread.

--

___
Python tracker 

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



[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Serge Stroobandt

New submission from Serge Stroobandt:

In https://docs.python.org/2/library/string.html#formatstrings the proprietary 
(IBM) specifcation "Decimal Arithmetic Specification" 
http://www.gobosoft.com/eiffel/gobo/math/decimal/daconvs.html is incorrectly 
being heralded as "the" specifiaction for engineering notation.

However, upon reading this IBM specifation carefully, one will note that the 
specifaction itself actually admits not applying the engineering notation in 
the case of infinite numbers.

An emphasized version of the exact quote accompanied with a discussion can be 
found here: http://stackoverflow.com/a/17974598/2192488

Correct behaviour for decimal.to_eng_string() would be to equally employ 
engineering notation in the case of infinite numbers.

I suggest renaming the current behaviour to decimal.to_ibm_string().

References:
http://www.augustatech.edu/math/molik/notation.pdf
https://en.wikipedia.org/wiki/Engineering_notation
https://en.wikipedia.org/wiki/General_Conference_on_Weights_and_Measures
http://www.bipm.org/en/CGPM/db/11/11/

PS: I am a MSc in Electronic Engineering.

--
components: Extension Modules
files: engineering_notation.pdf
messages: 259047
nosy: Keith.Brafford, eric.smith, ezio.melotti, serge.stroobandt
priority: normal
severity: normal
status: open
title: decimal.to_eng_string() does not implement engineering notation in all 
cases.
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file41730/engineering_notation.pdf

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov

Changes by Yury Selivanov :


--
dependencies: +Speedup method calls 1.2x

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov

Changes by Yury Selivanov :


--
dependencies: +PEP 509: Add ma_version to PyDictObject

___
Python tracker 

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



[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Serge Stroobandt

Serge Stroobandt added the comment:

@rhettinger
I completely agree with not creating a backward incompatibility at this point 
in time.

The real issue is that decimal.to_eng_string() was written to a (unfortunately 
chosen) proprietary specification which does not entirely correspond to the 
engineering notation.

A quick web search shows that a lot of people are in search of a *true* 
engineering notation implementation. In the phylosophy of "batteries included" 
it is a pity this useful and very common notation is currently missing in 
Python.

I would therefore suggest adding a decimal.to_true_eng_string() with the true 
engineering notation.

Hence, this bug could be reclassified as asuggestion for enhancement.

--

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-27 Thread Tim Peters

Tim Peters added the comment:

I'd raise an exception when trying to insert into a bounded deque that's 
already full.  There's simply no way to guess what was _intended_; it's dead 
easy for the user to implement what they _do_ intend (first make room by 
deleting the specific item they no longer want); and I can't think of a use 
case compelling enough to justify whatever arbitrary non-exceptional behavior 
may be implemented instead.

WRT the behavior you settled on, sure, it's explainable.  That doesn't imply 
it's useful, though ;-)  I'd rather have an exception.  It's plain bizarre that 
after

d.insert(i, x)

one can't even rely on

assert any(y is x for y in d)

succeeding.  Implementing behavior that allows that invariant to fail is 
_really_ user-unfriendly ;-)

In contrast, what .append() and .appendleft() do for a full bounded deque are 
compelling (and don't violate the weak invariant above).

--

___
Python tracker 

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



[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-27 Thread David Heffernan

David Heffernan added the comment:

Thanks for following up Steve, and thanks for changing resolution to dupe. 

As for 3.5 and embedding the docs are much the same as 2.7 in that the example 
code at https://docs.python.org/3/extending/embedding.html doesn't explicitly 
set Python home. 

Anyway, I'm very happy with how this report has been dealt with. Thank you all.

--

___
Python tracker 

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



[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Ian Kelly

Ian Kelly added the comment:

Fair enough. I think there should be some documentation though to the effect 
that coroutines aren't robust to passing StopIteration across coroutine 
boundaries. It's particularly surprising with PEP-492 coroutines, since those 
aren't even iterators and intuitively should ignore StopIteration like normal 
functions do.

As it happens, this variation (moving the try-except into the executor thread) 
does turn out to work but is probably best avoided for the same reason. I don't 
think it's obviously bad code though:


class AsyncIteratorWrapper:

def __init__(self, iterable, loop=None, executor=None):
self._iterator = iter(iterable)
self._loop = loop or asyncio.get_event_loop()
self._executor = executor

async def __aiter__(self):
return self

async def __anext__(self):
def _next(iterator):
try:
return next(iterator)
except StopIteration:
raise StopAsyncIteration
return await self._loop.run_in_executor(
self._executor, _next, self._iterator)

--

___
Python tracker 

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



[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread SilentGhost

Changes by SilentGhost :


--
versions: +Python 3.6 -Python 2.7

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What if implement the bahavior described by Raymond for index -len(d) <= i < 
len(d), but raise an exception if the index is out of this range?

The result of deque('abc', maxlen=3).insert(i, 'X') would be:

-4: error
-3: ['X', 'a', 'b']
-2: ['a', 'X', 'b']
-1: ['a', 'b', 'X']
 0: ['X', 'a', 'b']
 1: ['a', 'X', 'b']
 2: ['a', 'b', 'X']
 3: error

--

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov

Yury Selivanov added the comment:

BTW, there are a couple of unit-tests that fail.  Both can be easily fixed.

To really move this thing forward, we need to profile the memory usage.  First, 
it would be interesting to see how much additional memory is consumed if we 
optimize every code object.  That will give us an idea of the overhead, and if 
it is significant, we can experiment with various heuristics to minimize it.

--

___
Python tracker 

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



[issue26183] 2.7.11 won't clean install on Windows 10 x64

2016-01-27 Thread Tom Parker

Tom Parker added the comment:

Ah OK :) I had done a W10 reset to wipe my PC before reinstalling VS so I 
could't imagine where else the python registry keys could have come from.

My install sequence was:

SQL Server 2012 Developer
Visual Studio 2015 Community Edition
Office 365
Inkscape - maybe??
Then Python 2.7.11

--

___
Python tracker 

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



[issue26215] remove gc from CPython

2016-01-27 Thread yuriy_levchenko

New submission from yuriy_levchenko:

I permanently use gc.disable() but CPython create object with GC_Head.
it's use big memory.
I suggest add define to a few file that remove use GC_Head and allocate extra 
memory.

--
messages: 259013
nosy: yuriy_levchenko
priority: normal
severity: normal
status: open
title: remove gc from CPython
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



[issue26215] remove gc from CPython

2016-01-27 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue24841] Some test_ssl network tests fail if svn.python.org is not accessible.

2016-01-27 Thread Martin Panter

Martin Panter added the comment:

The two changes to test_ssl.py look okay to me, although they will need 
updating since the Issue 24841 changeover to pythontest.net.

But I don’t think it is a good idea to add ENOTCONN to the list of errors 
ignored by all transient_internet() tests. In most cases, ENOTCONN suggests a 
programming error, not a network problem. I think a better solution would be to 
call connect_ex() again in test_non_blocking_connect_ex(), and retrieve the 
result (probably also ECONNREFUSED like the other failures, or 0 if successful).

--
nosy: +martin.panter

___
Python tracker 

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



[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 16f60cd918e0 by Victor Stinner in branch 'default':
PEP 511
https://hg.python.org/peps/rev/16f60cd918e0

--

___
Python tracker 

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



[issue25843] code_richcompare() don't use constant type when comparing code constants

2016-01-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 16f60cd918e0 by Victor Stinner in branch 'default':
PEP 511
https://hg.python.org/peps/rev/16f60cd918e0

--

___
Python tracker 

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



[issue26173] test_ssl.bad_cert_test() exception handling

2016-01-27 Thread Martin Panter

Changes by Martin Panter :


--
keywords: +patch
Added file: http://bugs.python.org/file41725/bad-cert-py3.patch

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords

2016-01-27 Thread Anish Shah

Changes by Anish Shah :


--
nosy: +anish.shah

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

But the postcondition d[i] == newitem is broken if i is negative.

>>> d = deque('ABC', maxlen=3)
>>> d.insert(-1, None)
>>> d
deque(['A', None, 'B'], maxlen=3)

I would expected ['A', 'B', None].

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue26210] `HTMLParser.handle_data` may be invoked although `HTMLParser.reset` was invoked

2016-01-27 Thread Yannick Duchêne

Yannick Duchêne added the comment:

Thanks Xiang, for the clear explanations.

So an error should be triggered when `reset` is invoked while it should not. 
And remains the issue about how to stop the parser: should an exception be 
raised and caught at an outer invocation level? Something like raising 
StopIteration? (I don't enjoy using exceptions for flow control, but that seems 
to be the Python way, cheese).

--

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-27 Thread STINNER Victor

STINNER Victor added the comment:

> -1 is the position before the last element ('C'). After popping-off extra 
> element the result can be ['A', 'B', None] or ['B', None, 'C'].

Oh ok :-) Now I'm confused, I don't know what is the expected behaviour :-)

--

___
Python tracker 

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



[issue26210] `HTMLParser.handle_data` may be invoked although `HTMLParser.reset` was invoked

2016-01-27 Thread Xiang Zhang

Xiang Zhang added the comment:

Hmm, I don't know whether I am right or not. Let's wait for a core member to 
clarify. If I am wrong, I am quite sorry.

I don't think invoking reset when parsing should raise an error(and I don't 
know how to achieve that). When to invoke a subroutine is determined by the 
programmer. You can always put a well-written subroutine in some wrong place 
and then cause error. And I don't see how to stop the process either.

--

___
Python tracker 

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



  1   2   >