[issue28392] shlex - non-posix-mode: error in Multiple occurances of quotes substrings/words

2016-10-09 Thread Arno-Can Uestuensoez

New submission from Arno-Can Uestuensoez:

See also 28391: Multiple occurances of: Closing quotes separate words

The issue 28391 is accepted, as it is defined:
 Quotes *within* words are ignored, only a leading quoted string will result in 
a separate word.  (That's recursive: try '"Do""This""Separate).

So I implement for compatibility mode your proposal.

But the example does not seem to work as expected, so seems to hint to a bug. 
Thus openning a seperate issue:

snip-->
import shlex

sopts = """-a "Do""This""Separate" """
resx = ["-a", '"Do"', 'ThisSeparate', ]
res=shlex.split(sopts,posix=False)

print "sopts  ="+str(sopts)
print "resx   ="+str(resx)
print "res="+str(res)
assert res == resx 

"""
Results in:

sopts  =-a "Do""This""Separate" 
resx   =['-a', '"Do"', 'ThisSeparate']
res=['-a', '"Do"', '"This"', '"Separate"']
Traceback (most recent call last):
  File "shlex_demo.py", line 52, in 
assert res == resx 
AssertionError

"""

<--snip

I also checked the variant with a trailing quoted word for completeness, which 
is not enclosed. Does not split at all:

sopts  =-a Do"SeparateThis" 
resx   =['-a', 'Do', '"SeparateThis"']
res=['-a', 'Do"SeparateThis"']

--
components: Library (Lib)
messages: 278351
nosy: Andrey.Kislyuk, acue, cvrebert, eric.araujo, eric.smith, ezio.melotti, 
python-dev, r.david.murray, robodan, vinay.sajip
priority: normal
severity: normal
status: open
title: shlex - non-posix-mode: error in Multiple occurances of quotes 
substrings/words
type: behavior
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



[issue28376] rangeiter_new fails when creating a range of step 0

2016-10-09 Thread Oren Milman

Oren Milman added the comment:

Thanks for the reviews and patience :)

--

___
Python tracker 

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



[issue25720] Fix curses module compilation with ncurses6

2016-10-09 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

headers.sh in ncurses changes "#include " to the actual path. For 
example here's a line in my unctrl.h:

#include 

--

___
Python tracker 

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



[issue28393] Update encoding lookup docs wrt #27938

2016-10-09 Thread Ville Skyttä

New submission from Ville Skyttä:

The attached patch brings codecs docs up to date with respect to changes in 
#27938.

--
assignee: docs@python
components: Documentation
files: codecs-doc.patch
keywords: patch
messages: 278354
nosy: docs@python, haypo, scop
priority: normal
severity: normal
status: open
title: Update encoding lookup docs wrt #27938
type: enhancement
Added file: http://bugs.python.org/file45030/codecs-doc.patch

___
Python tracker 

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



[issue28394] Spelling fixes

2016-10-09 Thread Ville Skyttä

Changes by Ville Skyttä :


--
assignee: docs@python
components: Documentation
files: spelling.patch
keywords: patch
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Spelling fixes
type: enhancement
Added file: http://bugs.python.org/file45031/spelling.patch

___
Python tracker 

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



[issue28395] Remove unnecessary semicolons

2016-10-09 Thread Ville Skyttä

Changes by Ville Skyttä :


--
components: Tests
files: semicolons.patch
keywords: patch
nosy: scop
priority: normal
severity: normal
status: open
title: Remove unnecessary semicolons
type: enhancement
Added file: http://bugs.python.org/file45032/semicolons.patch

___
Python tracker 

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



[issue28396] Remove *.pyo references from man page

2016-10-09 Thread Ville Skyttä

Changes by Ville Skyttä :


--
assignee: docs@python
components: Documentation
files: man-pyo.patch
keywords: patch
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Remove *.pyo references from man page
type: enhancement
Added file: http://bugs.python.org/file45033/man-pyo.patch

___
Python tracker 

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



[issue28394] Spelling fixes

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +martin.panter

___
Python tracker 

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



[issue28397] Faster index range checks

2016-10-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The expression for testing that some index is in half-open range from 0 to 
limit can be written as

index >= 0 && index < limit

or as

(size_t)index < (size_t)limit

The latter form generates simpler machine code. This is idiomatic code, it is 
used in many C and C++ libraries (including C++ stdlib implementations). It 
already is used in CPython (in deque implementation).

Proposed patch rewrites index range checks in more efficient way. The patch was 
generated automatically by coccinelle script, and then manually cleaned up.

--
components: Extension Modules, Interpreter Core
files: check_index.patch
keywords: patch
messages: 278355
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Faster index range checks
type: performance
versions: Python 3.7
Added file: http://bugs.python.org/file45034/check_index.patch

___
Python tracker 

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



[issue28397] Faster index range checks

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file45035/check_index.cocci

___
Python tracker 

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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1be8cd7cee92 by Serhiy Storchaka in branch 'default':
Issue #28379: Removed redundant check.
https://hg.python.org/cpython/rev/1be8cd7cee92

--

___
Python tracker 

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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue27945] Various segfaults with dict

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +inada.naoki
versions: +Python 2.7, Python 3.7

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread INADA Naoki

INADA Naoki added the comment:

I close this issue for now.
Further improvements can be new issue.

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

___
Python tracker 

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



[issue23782] Leak in _PyTraceback_Add

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

More refactoring.

--
Added file: http://bugs.python.org/file45036/_PyTraceback_Add_leak2.patch

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Xiang Zhang

Xiang Zhang added the comment:

We don't need to remove it for 3.5 and 3.6?

--

___
Python tracker 

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



[issue25720] Fix curses module compilation with ncurses6

2016-10-09 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

Thank you for confirming, Yen :)
In this case, It seems necessary that resolves headers. I think missing headers 
issue maybe solve by #28190. I wrote a join test patch for #28190 and #25720.
Would you be able to resolve headers using this?

--
Added file: 
http://bugs.python.org/file45037/join-test-issue28190-issue25720.patch

___
Python tracker 

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



[issue28392] shlex - non-posix-mode: error in Multiple occurances of quotes substrings/words

2016-10-09 Thread R. David Murray

R. David Murray added the comment:

>>> shlex.split('"Do""This""Separate"', posix=False)
  ['"Do"', '"This"', '"Separate"']
  >>> shlex.split('Do"SeparateThis"', posix=False)
  ['Do"SeparateThis"']

Both of these are as documented.  The first has three separate words, since 
each word that starts with a leading " is split at the closing quote (thus 
producing a new word that starts with a ").  The last is one word, because the 
first " is internal to the word that starts at 'Do'.

In any case, if you find something that disagrees with the docs, we'll just 
change the docs, because posix=False exists only for backward compatibility so 
whatever the code actually does is by definition correct at this point.

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



[issue28389] xmlrpc.client HTTP proxy example code does not work

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 94c9c314f5d9 by Berker Peksag in branch '3.5':
Issue #28389: Fix ProxiedTransport example in xmlrpc.client documentation
https://hg.python.org/cpython/rev/94c9c314f5d9

New changeset 60c5c77c0190 by Berker Peksag in branch '3.6':
Issue #28389: Merge from 3.5
https://hg.python.org/cpython/rev/60c5c77c0190

New changeset 5f9351bc317e by Berker Peksag in branch 'default':
Issue #28389: Merge from 3.6
https://hg.python.org/cpython/rev/5f9351bc317e

--
nosy: +python-dev

___
Python tracker 

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



[issue28389] xmlrpc.client HTTP proxy example code does not work

2016-10-09 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue25720] Fix curses module compilation with ncurses6

2016-10-09 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Thanks, building is fine here.

By the way, testing is broken due to other bugs (/tmp not available on 
Android). It's unrelated and I'll open a new issue for that.

--

___
Python tracker 

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



[issue28398] Return singleton empty string in _PyUnicode_FromASCII

2016-10-09 Thread Xiang Zhang

New submission from Xiang Zhang:

Right now in _PyUnicode_FromASCII, it only optimises for size 1 not size 0. All 
other places getting the same situation in unicodeobject.c do both.

--
files: _PyUnicode_FromASCII.patch
keywords: patch
messages: 278364
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Return singleton empty string in _PyUnicode_FromASCII
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45038/_PyUnicode_FromASCII.patch

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you, INADA!  Next task -- optimize asyncio.Task in C in 3.7. Another 
10-15% performance improvement.

--

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread Yury Selivanov

Yury Selivanov added the comment:

I mean another optimization possibility.

--

___
Python tracker 

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



[issue28399] Remove UNIX socket from FS before binding

2016-10-09 Thread Yury Selivanov

Changes by Yury Selivanov :


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

___
Python tracker 

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



[issue28399] Remove UNIX socket from FS before binding

2016-10-09 Thread Yury Selivanov

New submission from Yury Selivanov:

Proxy for https://github.com/python/asyncio/pull/441

--
assignee: yselivanov
components: asyncio
messages: 278367
nosy: gvanrossum, yselivanov
priority: normal
severity: normal
stage: resolved
status: open
title: Remove UNIX socket from FS before binding
type: enhancement
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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread INADA Naoki

INADA Naoki added the comment:

How about changing module name?
_asyncio_speedup for example.

--

___
Python tracker 

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



[issue28399] Remove UNIX socket from FS before binding

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a3b162d5e70a by Yury Selivanov in branch '3.5':
Issue #28399: Remove UNIX socket from FS before binding.
https://hg.python.org/cpython/rev/a3b162d5e70a

New changeset 019c5c2f1239 by Yury Selivanov in branch '3.6':
Merge 3.5 (issue #28399)
https://hg.python.org/cpython/rev/019c5c2f1239

New changeset 2e5a8b4d9c97 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #28399)
https://hg.python.org/cpython/rev/2e5a8b4d9c97

--
nosy: +python-dev

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread Yury Selivanov

Yury Selivanov added the comment:

Yes, I think it's a good idea.

--

___
Python tracker 

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



[issue27972] Confusing error during cyclic yield

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d877876aa89 by Yury Selivanov in branch '3.5':
Issue #27972: Prohibit Tasks to await on themselves.
https://hg.python.org/cpython/rev/8d877876aa89

New changeset 41c4f535b5c0 by Yury Selivanov in branch '3.6':
Merge 3.5 (issue #27972)
https://hg.python.org/cpython/rev/41c4f535b5c0

New changeset 47720192b318 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #27972)
https://hg.python.org/cpython/rev/47720192b318

--
nosy: +python-dev

___
Python tracker 

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



[issue27972] Confusing error during cyclic yield

2016-10-09 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you for reporting this! Closing the issue.

--
resolution:  -> fixed
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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is just a cleaning up of not very important code.

--

___
Python tracker 

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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Xiang Zhang

Xiang Zhang added the comment:

Fine. :-)

--

___
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

2016-10-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Oh the line

ByteString.register(type(memoryview(b'')))

should be removed from typing.py.

--
priority: deferred blocker -> release blocker

___
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

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 69fe5f2e5aae by Guido van Rossum in branch '3.5':
Issue #28339: Remove ByteString.register(memoryview(...)) from typing.py.
https://hg.python.org/cpython/rev/69fe5f2e5aae

New changeset 8958836a2c89 by Guido van Rossum in branch '3.6':
Issue #28339: Remove ByteString.register(memoryview(...)) from typing.py. 
(merge 3.5->3.6)
https://hg.python.org/cpython/rev/8958836a2c89

New changeset def461406c70 by Guido van Rossum in branch 'default':
Issue #28339: Remove ByteString.register(memoryview(...)) from typing.py. 
(merge 3.6->3.7)
https://hg.python.org/cpython/rev/def461406c70

--
nosy: +python-dev

___
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

2016-10-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Maybe this fix helps? I tried your repro and it no longer fails.

--

___
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

2016-10-09 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I think this is the right way to fix this, as discussed on python-dev, 
memoryview is not considered consistent with ByteString.

--

___
Python tracker 

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



[issue28400] Remove uncessary checks in unicode_char and resize_copy

2016-10-09 Thread Xiang Zhang

New submission from Xiang Zhang:

In resize_copy we don't need to PyUnicode_READY(unicode) since when it's not 
PyUnicode_WCHAR_KIND it should be ready.

In unicode_char, PyUnicode_1BYTE_KIND is handled by get_latin1_char.

--
components: Interpreter Core
files: unicode_char_and_resize_copy.patch
keywords: patch
messages: 278379
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Remove uncessary checks in unicode_char and resize_copy
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45039/unicode_char_and_resize_copy.patch

___
Python tracker 

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



[issue25152] venv documentation doesn't tell you how to specify a particular version of python

2016-10-09 Thread R. David Murray

R. David Murray added the comment:

Issue 25154 has deprecated pyvenv in 3.6.  The docs, however, still need 
updating.  The updated docs should mention pyvenv only to say that it is 
deprecated, I think. This change could be applied to 3.5 if we get it in before 
3.5 final.

--
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.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



[issue28401] Don't support the PEP384 stable ABI in pydebug builds

2016-10-09 Thread Stefano Rivera

New submission from Stefano Rivera:

setup.py build for a library using py_limited_api will always generate a stable 
ABI tagged shared library, even under the pydebug interpreter.

This means that extensions that are built for a pydebug interpreter may be 
accidentally (and brokenly) imported in a non-dbg interpreter and vice-versa.

e.g. in python-librtmp, with cffi 1.8.3:
$ python3-dbg setup.py build
...
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions 
-Wl,-z,relro -Wl,-z,relro -g -Og 
-fdebug-prefix-map=/build/python3.5-H9Fri6/python3.5-3.5.2=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
-D_FORTIFY_SOURCE=2 
build/temp.linux-x86_64-3.5-pydebug/build/temp.linux-x86_64-3.5-pydebug/librtmp._librtmp.o
 -lrtmp -o build/lib.linux-x86_64-3.5-pydebug/librtmp/_librtmp.abi3.so

Then:
$ cd build/lib.linux-x86_64-3.5-pydebug
$ python3 -c 'import librtmp'
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/tmp/python-librtmp-0.3.0/build/lib.linux-x86_64-3.5-pydebug/librtmp/__init__.py",
 line 8, in 
from ._librtmp import ffi, lib as librtmp
ImportError: 
/tmp/python-librtmp-0.3.0/build/lib.linux-x86_64-3.5-pydebug/librtmp/_librtmp.abi3.so:
 undefined symbol: _Py_RefTotal

setuptools decides whether to use the stable ABI, by looking at 
imp.get_suffixes(). And obviously, the importer is looking at that too. So, the 
stable ABI tag should simply not be in there.

PEP3149 agrees with this. It has this quote from Martin v. Löwis:
 --with-pydebug would not be supported by the stable ABI because this changes 
the layout of PyObject , which is an exposed structure.

So, here's a patch, to disable support for the stable ABI under pydebug builds.

--
components: Library (Lib)
files: pep384-pydbg.patch
keywords: patch
messages: 278381
nosy: stefanor
priority: normal
severity: normal
status: open
title: Don't support the PEP384 stable ABI in pydebug builds
type: behavior
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45040/pep384-pydbg.patch

___
Python tracker 

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



[issue28389] xmlrpc.client HTTP proxy example code does not work

2016-10-09 Thread Attila Vangel

Attila Vangel added the comment:

Thanks for fixing this issue. I checked the changed documentation online, and I 
came up with a very similar solution. One difference is that although this 
example overrides the make_connection() method, but omits the following lines 
which are present in the xmlrpc.client.Transport code (I checked that in python 
3.5.3):

# return an existing connection if possible.  This allows
# HTTP/1.1 keep-alive.
if self._connection and host == self._connection[0]:
return self._connection[1]
# create a HTTP connection object from a host descriptor
chost, self._extra_headers, x509 = self.get_host_info(host)

Please check xmlrpc.client.Transport.make_connection().
I am not sure about the what kind of effect this may have.
I used chost as the parameter of set_tunnel(), rather than host (after briefly 
checking the code how it is calculated I felt that it's better to use chost 
than host, but I don't have a deep understanding of the http.client code).

The proxy_headers is a new thing, I guess it's a good thing if someone needs 
that.

I don't understand why the '*' character is needed in
connection = http.client.HTTPConnection(*self.proxy)
However I'm quite new to python.

I will try this new code tomorrow.

--

___
Python tracker 

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



[issue3401] wsgiref can't handle unicode environments

2016-10-09 Thread R. David Murray

R. David Murray added the comment:

Since this is a buildbot error report and we don't release unless the buildbots 
in the stable set are green, I think we can close this now :)

--
nosy: +r.david.murray
resolution:  -> out of date
stage: test needed -> 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



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

2016-10-09 Thread Guido van Rossum

Guido van Rossum added the comment:

So is a larger fix not necessary? If so we can close this (assuming
the tests now pass).

--

___
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

2016-10-09 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I tried and all tests pass on 3.7a also with prior import of typing.

A larger fix is not _necessary_, but I would _prefer_ to go with the option 4 
that I proposed above, i.e.:

Instead of special casing abc and functools in __subclasshook__ in typing via 
sys._getframe, I would rather add small changes to abc and functools (they 
should use __origin__ in subclass checks).

In general, I think we should document __origin__, it could be useful at 
runtime (especially that we prohibit certain things like class checks for 
parameterized generics).

--

___
Python tracker 

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



[issue12974] array module: deprecate '__int__' conversion support for array elements

2016-10-09 Thread Oren Milman

Changes by Oren Milman :


--
nosy: +Oren Milman

___
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

2016-10-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Hm. I agree that _getframe() is horrible. But I'm not sure I want code outside 
typing.py to be aware of __origin__.

--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 112714f3745d by Serhiy Storchaka in branch '3.6':
Issue #28183: Optimize and cleanup dict iteration.
https://hg.python.org/cpython/rev/112714f3745d

--
nosy: +python-dev

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Few weeks I tried to rewrite loops in more fast way, but I have not found 
anything significantly faster or clearer. Some forms of was a few percent 
faster, but I would be difficult to explain this effect. Most likely it was an 
artifact of the compilation.

Removed unrelated changes from dict_iter8.patch and added additional check in 
_PyDict_Next() before committing.

--
resolution:  -> fixed
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



[issue28398] Return singleton empty string in _PyUnicode_FromASCII

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Additional check has a non-zero cost. What is the benefit of this change?

--

___
Python tracker 

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



[issue28400] Remove uncessary checks in unicode_char and resize_copy

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee:  -> serhiy.storchaka
stage: patch review -> commit review

___
Python tracker 

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



[issue28400] Remove uncessary checks in unicode_char and resize_copy

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 61e454a1c9d7 by Serhiy Storchaka in branch 'default':
Issue #28400: Removed uncessary checks in unicode_char and resize_copy.
https://hg.python.org/cpython/rev/61e454a1c9d7

--
nosy: +python-dev

___
Python tracker 

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



[issue28400] Remove uncessary checks in unicode_char and resize_copy

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-09 Thread Martin Panter

Martin Panter added the comment:

For replacing macros, I think “static inline” may be fine, even with older 
compilers. Maybe these PyDTrace_ functions could also be static inline, since 
they were originally macros. Or do they really need to be linkable inline 
functions?

--

___
Python tracker 

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



[issue28343] Bad encoding alias cp936 -> gbk: euro sign

2016-10-09 Thread Mingye Wang

Mingye Wang added the comment:

The "join the web people" solution should look like this:

$ diff -Naurp a/_codecs_cn.c b/_codecs_cn.c
--- a/_codecs_cn.c2016-10-09 14:24:04.675111500 -0700
+++ b/_codecs_cn.c2016-10-09 14:27:06.600961500 -0700
@@ -128,6 +128,12 @@ ENCODER(gbk)
 continue;
 }

+if (c == 0x20AC) { /* cp936, or web GBK */
+WRITEBYTE1((unsigned char)0x80);
+NEXT(1, 1);
+continue;
+}
+
 if (c > 0x)
 return 1;

@@ -159,6 +165,12 @@ DECODER(gbk)
 NEXT_IN(1);
 continue;
 }
+
+if (c == 0x80) { /* cp936, or web GBK */
+OUTCHAR(0x20AC);
+NEXT_IN(1);
+continue;
+}

 REQUIRE_INBUF(2);

It should be mostly safe as this character is not previously defined in 
Python's GBK implementation.

--

___
Python tracker 

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



[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-09 Thread Martin Panter

Martin Panter added the comment:

>From memory, there are at least three code paths for input():

1. Fallback implementation, used when stdout is a pipe or other non-terminal
2. Default PyOS_ReadlineFunctionPointer() hook, used when stdout is a terminal: 
https://docs.python.org/3.5/c-api/veryhigh.html#c.PyOS_ReadlineFunctionPointer
3. Gnu Readline (or another hook installed by a C module)

Arnon’s problem only seems to occur in the last two cases, when 
PyOS_ReadlineFunctionPointer() is used. The problem is that 
PyOS_ReadlineFunctionPointer() uses C  FILE pointers, not Python file 
objects. Python calls sys.stdout.fileno() to see if it can substitute the 
C-level stdout FILE object.

Adam: I think your sys.readlinehook() proposal is independent of Arnon’s 
problem. We would still need some logic to decide what to pass to libraries 
like Gnu Readline that want a FILE pointer instead of a Python file object.

The fileno() method is documented all file objects, including text files like 
sys.stdout. So I think implementing your own fileno() method is completely 
valid.

One other idea that comes to mind is if Python checked if the sys.stdout object 
has been changed (e.g. sys.stdout != sys.__stdout__), rather than just 
comparing fileno() values. But I am not sure if this change is worth it.

BTW if I revert the fix for Issue 24402 (I also tried 3.3.3), the problem 
occurs even when a custom fileno() is defined. On the other hand, Python 2’s 
raw_input() is not affected, presumably because it uses PyFile_AsFile() and 
fails immediately if stdout is a custom class.

--
nosy: +martin.panter

___
Python tracker 

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



[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-10-09 Thread Joshua Jay Herman

Joshua Jay Herman added the comment:

Hi I performed the rebase on the default branch.

--
Added file: 
http://bugs.python.org/file45041/rebased_addMissingEnvironmentalVariables.patch

___
Python tracker 

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



[issue28394] Spelling fixes

2016-10-09 Thread Roundup Robot

New submission from Roundup Robot:

New changeset 6b1df8905012 by Martin Panter in branch '3.5':
Issue #28394: Spelling and typo fixes in code comments and changelog
https://hg.python.org/cpython/rev/6b1df8905012

New changeset bd113af10005 by Martin Panter in branch '3.6':
Issue #28394: Merge typo fixes from 3.5 into 3.6
https://hg.python.org/cpython/rev/bd113af10005

New changeset 004d1809db41 by Martin Panter in branch '3.6':
Issue #28394: More typo fixes for 3.6+
https://hg.python.org/cpython/rev/004d1809db41

New changeset 678fe178da0d by Martin Panter in branch 'default':
Issue #28394: Merge typo fixes from 3.6
https://hg.python.org/cpython/rev/678fe178da0d

New changeset de13f5a0f4d5 by Martin Panter in branch '2.7':
Issue #28394: Typo fixes in code comments and changelog
https://hg.python.org/cpython/rev/de13f5a0f4d5

--
nosy: +python-dev

___
Python tracker 

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



[issue28397] Faster index range checks

2016-10-09 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Don't change the code in the collections module.  While semantically valid, the 
change obfuscates the code.  The meaning of maxlen < 0 is that there is no 
maximum length.  I don't want this test hidden; otherwise, I would have changed 
it long ago as was done elsewhere in the module where it made sense.

Elsewhere, consider making a macro with clear name and comment (as was done 
with NEEDS_TRIM) in the collections module.  Otherwise, you're just leaving 
behind constipated and tricky code with no indication of why a signed variable 
is being coerced to unsigned.

--
nosy: +rhettinger

___
Python tracker 

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



[issue28398] Return singleton empty string in _PyUnicode_FromASCII

2016-10-09 Thread Xiang Zhang

Xiang Zhang added the comment:

The cost is really small (an integer compare vs memory malloc and copy). The 
advantages are fast path for empty strings and retaining consistency with other 
codes in unicodeobject.c. You can see other places use the same optimization, 
e.g. PyUnicode_FromUnicode, PyUnicode_FromUCS1, and some functions using 
unicode_result.

--

___
Python tracker 

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



[issue28394] Spelling fixes

2016-10-09 Thread Martin Panter

Martin Panter added the comment:

Thanks Ville. I added some more fixes of my own I had been saving up.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 2.7, 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



[issue28402] Add signed catalog files for stdlib on Windows

2016-10-09 Thread Steve Dower

New submission from Steve Dower:

On Windows, we sign all binaries with the PSF code signing certificate.

We can also sign all the standard library and tools .py files using a catalog, 
which will put the hashes of the original files into a signed bundle. This can 
then be validated by users (e.g. using "signtool.exe verify") at any point 
after installation. Worth noting that the OS does not automatically verify 
signatures in a catalog file.

It's only worthwhile doing this for files that may end up on a production 
machine - essentially, those files included in lib.msi and tools.msi (not 
test.msi, dev.msi or tcltk.msi).

--
assignee: steve.dower
components: Windows
messages: 278400
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Add signed catalog files for stdlib on Windows
type: enhancement
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



[issue28402] Add signed catalog files for stdlib on Windows

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e050ed5da06d by Steve Dower in branch '3.6':
Issue #28402: Adds signed catalog files for stdlib on Windows.
https://hg.python.org/cpython/rev/e050ed5da06d

New changeset 27edae50e62c by Steve Dower in branch 'default':
Issue #28402: Adds signed catalog files for stdlib on Windows.
https://hg.python.org/cpython/rev/27edae50e62c

--
nosy: +python-dev

___
Python tracker 

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



[issue28402] Add signed catalog files for stdlib on Windows

2016-10-09 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
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



[issue28403] Migration RFE: optional warning for implicit unicode conversions

2016-10-09 Thread Nick Coghlan

New submission from Nick Coghlan:

Some of the hardest compatibility issues to track down in Python 3 migrations 
are those where existing code is depending on an implicit str->unicode 
promotion something in the depths of a support library (or sometimes even the 
standard library - the context where this came up relates to some apparent 
misbehaviour in the standard library). In other cases, just being able to rule 
implicit conversions out as a possible contributing factor can be helpful in 
finding the real problem.

It's technically already possible to hook implicit conversions by adjusting (or 
shadowing) the site.py module and replacing the default "ascii" encoding with 
one that emits a warning whenever you rely on it: 
http://washort.twistedmatrix.com/2010/11/unicode-in-python-and-how-to-prevent-it.html

However, actually setting that up is a bit tricky, since we deliberately drop 
"sys.setdefaultencoding" from the sys module in the default site module. That 
means requesting warnings for implicit conversions requires doing the following:

1. Finding the "ascii_with_warnings" codec above (or writing your own)
2. Learning one of the following 3 tricks for overriding the default encoding:

2a. Run with "-S" and call sys.setdefaultencoding post-startup
2b. Edit the actual system site.py in a container or other test environment
2c. Shadow site.py with your own modified copy

3. Run your tests or application with the modified default encoding

If we wanted to make that easier for folks migrating, the first step would be 
to provide the "ascii_with_warnings" codec by default in Python 2.7 (perhaps as 
"_ascii_with_warnings", since it isn't intended for general use, it's just a 
migration helper)

The second would be to provide a way to turn it on that doesn't require 
fiddling with the site module. The simplest option there would be to always 
enable it under `-3`.

The argument against the simple option is that I'm not sure how noisy it would 
be by default - there are some standard library modules (e.g. URL processing) 
where we still rely on implicit encoding and decoding in Python 2, but have 
separate code paths in Python 3.

Since we don't have -X options in Python 2, the second simplest alternative 
would be to leave `sys.setdefaultencoding` available when running under `-3`: 
that way folks could more easily opt in to enabling the "ascii_with_warnings" 
codec selectively (e.g. via a context manager), rather than always having it 
enabled.

--
messages: 278402
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Migration RFE: optional warning for implicit unicode conversions
type: enhancement
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



[issue28403] Migration RFE: optional warning for implicit unicode conversions

2016-10-09 Thread Nick Coghlan

Nick Coghlan added the comment:

(Correction to the above: the case where this came up turned out to be due to 
consuming code monkeypatching things when it really shouldn't have been, so it 
fell into the second category of "It would have been helpful to be able to more 
easily rule this out as a contributing factor")

--

___
Python tracker 

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



[issue28395] Remove unnecessary semicolons

2016-10-09 Thread Mariatta Wijaya

New submission from Mariatta Wijaya:

Thanks scop. 

The patch looks good to me, and it can be applied cleanly to 3.5, 3.6, and 
default branches.

I did find more occurrences of unnecessary semicolons, for example (not a 
complete list)
https://github.com/python/cpython/blob/master/Lib/smtpd.py#L569
https://github.com/python/cpython/blob/master/Lib/smtpd.py#L611
https://github.com/python/cpython/blob/master/Lib/test/test_itertools.py#L120
https://github.com/python/cpython/blob/master/Lib/test/test_pyexpat.py#L572

Not sure if it's really worth trying to fix all of them?
Thanks :)

--
nosy: +Mariatta

___
Python tracker 

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