[issue28128] Improve the warning message for invalid escape sequences

2016-10-28 Thread Nick Coghlan

Nick Coghlan added the comment:

Petr, is there any chance you or someone from your team could take a look at 
this and the other issue Emanuel referenced? These warnings are likely to pose 
a usability problem when upgrading Python in Fedora in their current state, so 
it would be good to see them addressed prior to the 3.6.0 release.

--
nosy: +encukou

___
Python tracker 

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



[issue28552] Distutils fail if sys.executable is None

2016-10-28 Thread R. David Murray

R. David Murray added the comment:

I'm not sure it is reasonable to expect distutils to work if sys.executable is 
not valid.  What do you think distutils could do instead?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2016-10-28 Thread Martin Panter

Martin Panter added the comment:

Clément: Yes, that sounds like the intended behaviour, at least when using 
Readline. Originally discussed in Issue 23441 and Issue 22086. (Though I think 
the change in behaviour when completion is called outside of Readline is a bug.)

--

___
Python tracker 

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



[issue28028] Convert warnings to SyntaxWarning in parser

2016-10-28 Thread Emanuel Barry

Emanuel Barry added the comment:

Cross-ping from #28128

I think it would be best to solve this issue, solving both #28128 and any 
future warning-introducing feature or deprecation. I've marked this issue as a 
dependency for #28128 as well as upping the priority. There are less than 7 
weeks before the final 3.6.0 release and I would like to get as much mileage 
out of this before then.

Thanks :)

--
nosy: +eric.smith, martin.panter, ncoghlan, ned.deily
priority: normal -> high
stage:  -> needs patch
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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-28 Thread Martin Panter

Martin Panter added the comment:

Looks good to me :)

--

___
Python tracker 

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



[issue28128] Improve the warning message for invalid escape sequences

2016-10-28 Thread Emanuel Barry

Emanuel Barry added the comment:

Following Ned's email to Python-Dev, I'm upping the priority of this issue to 
"deferred blocker".

I haven't had a lot of time to work on this, but I had time to think about it, 
and I think that resolving #28028 would be the best way to solved this. I 
pinged this issue as well and added several people to nosy there. I've also 
added it as a dependency of this issue.

To be clear, I really like Eric's approach to this, but I think that resolving 
#28028 would let us kill a couple of issues with the same patch. My priority is 
getting this issue here resolved, though, so either way works. I doubt I'll 
have much time to actually work on this; life's been busy and Python isn't my 
priority right now (as much as I'd like it to be).

--
dependencies: +Convert warnings to SyntaxWarning in parser
priority: normal -> deferred blocker

___
Python tracker 

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



[issue28542] document cross compilation

2016-10-28 Thread Martin Panter

Martin Panter added the comment:

Thanks, this looks like a decent start. I’m not that familiar with 
cross-compiling Python, but here are a couple questions:

$(cd /path/to/source && pwd)/configure
Why do you use $(pwd) here? I have mainly seen relative paths used (my own 
experiments, and reports from others), so I don’t think you need to force an 
absolute path. The instructions further up already mention “../configure” from 
a subdirectory.

--prefix=$(cd ../install && pwd)
Won’t that embed the path of the install directory in e.g. sys.prefix or 
something? Can’t you use “DESTDIR=../install” instead?

I remember there are a bunch of extra things you have to manually configure to 
cross-compile. See e.g. revision 12a56a349af2 which asks for /dev/ptmx and 
/dev/ptc settings in a CONFIG_SITE file (although I have had success just 
adding them to the “configure” command line). Perhaps we could add something 
like

'''
configure --host=[. . .] \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no
. . .

If the target Python could use /dev/ptmx or /dev/ptc to implement os.openpty(), 
set the corresponding argument to "yes".
'''

I suspect some people cross compile 2.7, so it may be worth applying something 
like this to that branch.

--
nosy: +martin.panter

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-28 Thread Martin Panter

Martin Panter added the comment:

In general, I would be against stripping square brackets if the host and port 
have already been separated, e.g. in the address tuple used with 
socket.create_connection() etc. It feels like unnecessary double processing, 
which should already have been done at a higher level.

But I guess you could make the argument that adding this feature in 
HTTPConnection simplifies the API by improving consistency with the case where 
the port is not specified separately. But I would still say it is not a bug fix 
nor regression, and should be documented as being added in the next Python 
version (3.7 atm).

--

___
Python tracker 

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



[issue28548] http.server parse_request() bug and error reporting

2016-10-28 Thread Martin Panter

Martin Panter added the comment:

Here is a patch to parse the version from the request in more cases. Since it 
is more of a cosmetic improvement for handling erroneous requests, I would 
probably only apply it to the next Python version (3.7 atm). Or do you think it 
should go into bug fix versions as well?

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file45259/parse-version.patch

___
Python tracker 

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread Yury Selivanov

Yury Selivanov added the comment:

Looks like that Windows buildbot is green now. Closing.

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



[issue28549] curses: calling addch() with an 1-length str segfaults with ncurses6 compiled with --enable-ext-colors

2016-10-28 Thread Yutao Yuan

Yutao Yuan added the comment:

It fails to compile for me. setcchar should take a cchar_t* and a const 
wchar_t* instead.

--

___
Python tracker 

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



[issue10721] Remove HTTP 0.9 server support

2016-10-28 Thread Martin Panter

Martin Panter added the comment:

Here is a slightly updated patch I have been sitting on. I think the main 
difference was tweaks to the documentation.

Issue 28548 would also benefit if the HTTP 0.9 code was removed. The presence 
of the HTTP 0.9 code means a suboptimal response is sent in some error cases. 
IMO it would be better if the server responded using HTTP 1.0, where we can use 
error codes like “400 Bad request”. The current code will not use HTTP 1.0 
unless it sees that the client supports it.

--
versions: +Python 3.7 -Python 3.6
Added file: http://bugs.python.org/file45258/http09server.v3.patch

___
Python tracker 

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



[issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9

2016-10-28 Thread Martin Panter

Martin Panter added the comment:

Since my last comment, I have become more confident that Python’s request 
parsing never supported proper HTTP 0.9. So I would prefer to remove it in the 
next version of Python, and not bother fixing Xiang’s bug in existing versions 
(unless someone offers a practical reason to fix it).

For the record, this patch is what a fix might look like.

--
keywords: +patch
Added file: http://bugs.python.org/file45257/force-0.9.patch

___
Python tracker 

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



[issue28553] int.to_bytes docs logic error

2016-10-28 Thread Ofek Lev

New submission from Ofek Lev:

https://docs.python.org/3/library/stdtypes.html#int.to_bytes

To convert an int to the exact number of bytes required, the docs recommend 
"x.to_bytes((x.bit_length() // 8) + 1, ...)". This is incorrect when length is 
a multiple of 8, e.g. 296.

The correct way is "x.to_bytes((x.bit_length() + 7) // 8, ...)".

--
assignee: docs@python
components: Documentation
messages: 279641
nosy: Ofekmeister, docs@python
priority: normal
severity: normal
status: open
title: int.to_bytes docs logic error
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28548] http.server parse_request() bug and error reporting

2016-10-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Oct 28, 2016, at 10:57 PM, Martin Panter wrote:

>Parsing the version from words[-1] rather than words[2] may be a minor
>improvement however.

Indeed; I thought about that too.

--

___
Python tracker 

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



[issue28548] http.server parse_request() bug and error reporting

2016-10-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Oct 28, 2016, at 10:42 PM, Martin Panter wrote:

>I think you should be able to reproduce this without Mailman or tox, by just
>running “python -m http.server”.

Yep, indeed.

>The problem is the “HTTP/0.9” protocol that Python is assuming does not
>include a header section, so there is no place to put a 400 status code or
>header fields. The HTTP 0.9 response is supposed to only be a HTML body; see
> and
>.
>
>I think we should drop HTTP 0.9 response support from Python’s HTTP server,
>as well as the attempted but buggy request support. But there was a bit of
>resistance; see Issue 10721.
>
>Another possibility would be to change default_request_version so that error
>responses are sent as HTTP 1.0. But there may be more fixes needed for this
>to continue the buggy HTTP 0.9 support; see Issue 26578.

I think it may indeed make sense to set default_request_version to 1.0.  It's
probably too late to do that for 3.6, but I do think it makes sense for 3.7.
I'm nosying on the issues you mentioned.

I've proposed essentially that workaround for Mailman.

https://gitlab.com/mailman/mailman/issues/288

We can get away with requiring at least HTTP/1.1 for our REST clients.

--

___
Python tracker 

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset db7bcd92cf85 by Yury Selivanov in branch '3.6':
Issue #28544: Pass `PyObject*` to _PyDict_Pop, not `PyDictObject*`
https://hg.python.org/cpython/rev/db7bcd92cf85

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

--

___
Python tracker 

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



[issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9

2016-10-28 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue10721] Remove HTTP 0.9 server support

2016-10-28 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue28548] http.server parse_request() bug and error reporting

2016-10-28 Thread Martin Panter

Martin Panter added the comment:

Parsing the version from words[-1] rather than words[2] may be a minor 
improvement however.

--

___
Python tracker 

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread Yury Selivanov

Yury Selivanov added the comment:

> Python 3.6 & default don't compile on Windows because of the change:

Pushed a fix for that.

--

___
Python tracker 

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 635f5854cb3e by Yury Selivanov in branch '3.6':
Issue #28544: Fix compilation of _asynciomodule.c on Windows
https://hg.python.org/cpython/rev/635f5854cb3e

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

--

___
Python tracker 

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



[issue28548] http.server parse_request() bug and error reporting

2016-10-28 Thread Martin Panter

Martin Panter added the comment:

I think you should be able to reproduce this without Mailman or tox, by just 
running “python -m http.server”.

The problem is the “HTTP/0.9” protocol that Python is assuming does not include 
a header section, so there is no place to put a 400 status code or header 
fields. The HTTP 0.9 response is supposed to only be a HTML body; see 
 and 
.

I think we should drop HTTP 0.9 response support from Python’s HTTP server, as 
well as the attempted but buggy request support. But there was a bit of 
resistance; see Issue 10721.

Another possibility would be to change default_request_version so that error 
responses are sent as HTTP 1.0. But there may be more fixes needed for this to 
continue the buggy HTTP 0.9 support; see Issue 26578.

--
nosy: +martin.panter

___
Python tracker 

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



[issue28552] Distutils fail if sys.executable is None

2016-10-28 Thread Alexander P

New submission from Alexander P:

For example, Jython 2.7. When we try to execute `jython-standalone -m pip`, 
distutils.sysconfig tries to parse sys.executable as a path and obviously fails:

Traceback (most recent call last):
  File "/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/runpy.py", line 
161, in _run_module_as_main
  File "/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/runpy.py", line 
72, in _run_code
  File 
"/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/ensurepip/__main__.py", 
line 4, in 
  File 
"/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/ensurepip/__init__.py", 
line 220, in _main
  File 
"/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/ensurepip/__init__.py", 
line 123, in bootstrap
  File 
"/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/ensurepip/__init__.py", 
line 45, in _run_pip
  File "/tmp/tmp9QnVEm/pip-1.6-py2.py3-none-any.whl/pip/__init__.py", line 
10, in 
  File "/tmp/tmp9QnVEm/pip-1.6-py2.py3-none-any.whl/pip/util.py", line 13, 
in 
  File 
"/tmp/tmp9QnVEm/pip-1.6-py2.py3-none-any.whl/pip/backwardcompat/__init__.py", 
line 115, in 
  File 
"/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/distutils/sysconfig.py", 
line 28, in 
  File "/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/posixpath.py", 
line 367, in realpath
  File "/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/posixpath.py", 
line 373, in _joinrealpath
  File "/home/ale/dev/3toj/jython-standalone-2.7.0.jar/Lib/posixpath.py", 
line 61, in isabs
AttributeError: 'NoneType' object has no attribute 'startswith'

--
components: Distutils
messages: 279633
nosy: dstufft, eric.araujo, iamale
priority: normal
severity: normal
status: open
title: Distutils fail if sys.executable is None
type: behavior

___
Python tracker 

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread STINNER Victor

STINNER Victor added the comment:

Python 3.6 & default don't compile on Windows because of the change:

http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/2795/steps/compile/logs/stdio

   "D:\buildarea\3.x.bolen-windows8\build\PCbuild\_asyncio.vcxproj" (Build 
target) (15) ->
   (Link target) -> 
 _asynciomodule.obj : error LNK2019: unresolved external symbol 
_PyDict_Pop referenced in function task_step 
[D:\buildarea\3.x.bolen-windows8\build\PCbuild\_asyncio.vcxproj]
 _asynciomodule.obj : error LNK2019: unresolved external symbol 
_PyGen_Send referenced in function task_step_impl 
[D:\buildarea\3.x.bolen-windows8\build\PCbuild\_asyncio.vcxproj]
 D:\buildarea\3.x.bolen-windows8\build\PCBuild\amd64\_asyncio_d.pyd : 
fatal error LNK1120: 2 unresolved externals 
[D:\buildarea\3.x.bolen-windows8\build\PCbuild\_asyncio.vcxproj]

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



[issue28551] sysconfig.py wrong _PROJECT_BASE for Py2.7 Windows 64bit PC/VS9.0

2016-10-28 Thread Anselm Kruis

New submission from Anselm Kruis:

Affected versions: 2.7.11, 2.7.12
Windows amd64 build with Visual Studio 2008 using the files in PC/VS9.0

If you run test_sysconfig using PC/VS9.0/rt.bat the test case 
test_get_config_h_filename fails.

--8<---8<---8<---8<---8<---8<-
D:\kruis_F\fg2\stackless64\stackless>"D:\kruis_F\fg2\stackless64\stackless\PC\VS9.0\amd64\python"
  -Wd -3 -E -tt "D:\kruis_F\fg2\stackless64\stackless\PC\VS9.0\
\..\..\Lib\test\regrtest.py" -v test_sysconfig
== CPython 2.7.11 Stackless 3.1b3 060516 (default, Oct 28 2016, 22:32:20) [MSC 
v.1500 64 bit (AMD64)]
==   Windows-7-6.1.7601-SP1 little-endian
==   c:\users\kruis\appdata\local\temp\test_python_12436
Testing with flags: sys.flags(debug=0, py3k_warning=1, division_warning=1, 
division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, 
no_user_
site=0, no_site=0, ignore_environment=1, tabcheck=2, verbose=0, unicode=0, 
bytes_warning=0, hash_randomization=0)
[1/1] test_sysconfig
test_get_config_h_filename (test.test_sysconfig.TestSysConfig) ... FAIL
test_get_config_vars (test.test_sysconfig.TestSysConfig) ... ok
test_get_makefile_filename (test.test_sysconfig.TestSysConfig) ... skipped 
'Test is not Windows compatible'
test_get_path (test.test_sysconfig.TestSysConfig) ... ok
test_get_path_names (test.test_sysconfig.TestSysConfig) ... ok
test_get_paths (test.test_sysconfig.TestSysConfig) ... ok
test_get_platform (test.test_sysconfig.TestSysConfig) ... ok
test_get_scheme_names (test.test_sysconfig.TestSysConfig) ... ok
test_platform_in_subprocess (test.test_sysconfig.TestSysConfig) ... skipped 
'test only relevant on MacOSX'
test_symlink (test.test_sysconfig.TestSysConfig) ... skipped 'module os has no 
attribute symlink'
test_user_similar (test.test_sysconfig.TestSysConfig) ... ok

==
FAIL: test_get_config_h_filename (test.test_sysconfig.TestSysConfig)
--
Traceback (most recent call last):
  File "D:\kruis_F\fg2\stackless64\stackless\lib\test\test_sysconfig.py", line 
239, in test_get_config_h_filename
self.assertTrue(os.path.isfile(config_h), config_h)
AssertionError: D:\kruis_F\fg2\stackless64\stackless\Include\pyconfig.h

--8<---8<---8<---8<---8<---8<-


The failure is caused by the migration of the build files from PCbuild to 
PC\VS9.0, because
Lib/sysconfig.py does not know this build location.

The attached patch fixes the problem.

--
components: Library (Lib), Tests, Windows
files: fix_sysconfig_py.patch
keywords: patch
messages: 279631
nosy: anselm.kruis, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: sysconfig.py wrong _PROJECT_BASE for Py2.7 Windows 64bit PC/VS9.0
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file45256/fix_sysconfig_py.patch

___
Python tracker 

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread Yury Selivanov

Yury Selivanov added the comment:

> Can you please do it Yury?

Yes, Elvis and I will be the editors of What's New this year anyways ;)

--

___
Python tracker 

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread STINNER Victor

STINNER Victor added the comment:

Since asyncio becomes popular, IMO it is worth to mention this optimization at:
https://docs.python.org/dev/whatsnew/3.6.html#optimizations

Can you please do it Yury?

--

___
Python tracker 

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



[issue28541] Improve test coverage for json library - loading bytes

2016-10-28 Thread Eric Appelt

Eric Appelt added the comment:

I was able to inspect the review, and implemented your suggestions. This is 
attached as a new patch. Please let me know if this is not the correct workflow.

Thank you for the prompt review and help as I learn the python tracking and 
review process!

--
Added file: http://bugs.python.org/file45255/mywork4.patch

___
Python tracker 

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



[issue28549] curses: calling addch() with an 1-length str segfaults with ncurses6 compiled with --enable-ext-colors

2016-10-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The _curses module uses direct access to cchar_t fields. Proposed patch makes 
it using setcchar. Does it fixes this issue Yutao?

--
keywords: +patch
nosy: +serhiy.storchaka, twouters
stage:  -> patch review
versions: +Python 3.6, Python 3.7 -Python 3.4
Added file: http://bugs.python.org/file45254/curses_setcchar.patch

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-28 Thread Eryk Sun

Eryk Sun added the comment:

> ignore PYTHONPATH and the current working directory

Generally it's the script directory that isolated mode removes from sys.path. 
It's the working directory when there is no script.

--

___
Python tracker 

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



[issue28199] Compact dict resizing is doing too much work

2016-10-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, the difference is pretty small. The largest difference I got is 7% in 
following microbenchmark:

$ ./python -m perf timeit -s 'x = list(range(1000))' -- 'dict.fromkeys(x)'
Unpatched:  Median +- std dev: 80.6 us +- 0.5 us
dictresize3.patch:  Median +- std dev: 80.9 us +- 2.8 us
dictresize4.patch:  Median +- std dev: 75.4 us +- 2.1 us

I suppose this is due to using memcpy. In other microbenchmarks the difference 
usually is 1-2%.

Xiang, your microbenchmark don't work for this patch because dict(d) make only 
one resizing.

> Cons of Serhiy's patch is it's two pass. If entries are larger than L2 cache,
fetch from L3 cache may be larger.

Agree. But on other hand, dictresize3.patch needs to fit in L2 cache all 
indices table and prefetch two entries arrays: old and new. dictresize4.patch 
in every loop works with smaller memory: two entries arrays in the first loop 
and an indices table and new entries arrays in the second loop.

--

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-28 Thread Steve Dower

Steve Dower added the comment:

"Lib\site-packages" is probably unnecessary because of "import site", which 
likely adds it in anyway.

It's very likely that WinPython doesn't actually want to specify this at all, 
since it also enables isolated mode, which will ignore PYTHONPATH and the 
current working directory. But if that's okay, you probably want::

python36.zip
DLLs
Lib
.
import site

That should give you the same default sys.path as if the file were omitted, 
except for the empty entry at the start and anything in PYTHONPATH or the 
registry. (I figured this out by running "python -S" and looking at sys.path.)

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



[issue28550] if inline statement does not work with multiple assignment.

2016-10-28 Thread Eric Snow

Eric Snow added the comment:

The syntax is working correctly.  Precedence rules are throwing you off.  It 
should be more clear if we use parentheses to demonstrate precedence explicitly.

You expected:

a, b = (obj.a, obj.b) if obj else [None, None]

However, what you wrote is equivalent to:

a, b = obj.a, (obj.b if obj else [None, None])

Hence the error about not finding "None.a" (when it resolves obj.a).  You can 
solve this by explicitly marking the precedence like I did in the "You 
expected" example above.  Sometimes precedence isn't clear, so when in doubt, 
use parentheses to make the precedence explicit.

I'm sorry this wasn't more clear.  Do you think any changes in Python's 
documentation would have helped you avoid this confusion?

--
nosy: +eric.snow
resolution:  -> not a bug
stage:  -> resolved
status: open -> pending
type: crash -> behavior

___
Python tracker 

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



[issue28550] if inline statement does not work with multiple assignment.

2016-10-28 Thread Levi Velázquez

New submission from Levi Velázquez:

Normal "if" inline assignment

obj = None
a = obj.a if obj else None

It assign None to a as expected. 

obj = None
a, b = obj.a, obj.b if obj else [None, None]

It raises an error  " 'NoneType' object has no attribute 'a'"
when it should assign None to both a and b.

--
components: Interpreter Core
messages: 279622
nosy: levinvm
priority: normal
severity: normal
status: open
title: if inline statement does not work with multiple assignment.
type: crash
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



[issue28546] Better explain setting pdb breakpoints

2016-10-28 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +xdegaye

___
Python tracker 

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



[issue28503] [Patch] '_crypt' module: fix implicit declaration of crypt(), use crypt_r() where available

2016-10-28 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +xdegaye

___
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-28 Thread Zachary Ware

Zachary Ware added the comment:

Ah ha, I thought I'd seen it mentioned in an issue somewhere, but I didn't go 
looking when I noticed my Docs bots were all red.  Thanks for the patch anyway, 
Mariatta!

--
nosy: +zach.ware

___
Python tracker 

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



[issue28549] curses: calling addch() with an 1-length str segfaults with ncurses6 compiled with --enable-ext-colors

2016-10-28 Thread Yutao Yuan

New submission from Yutao Yuan:

When addch() is called with an 1-length str, it is converted into a cchar_t. 
Ncurses6 adds a new field ext_color to cchar_t if it is enabled at compile 
time, and it is not initialized here, which causes various problems like 
segfaults or wrong display of characters.

--
components: Extension Modules
messages: 279620
nosy: yyt16384
priority: normal
severity: normal
status: open
title: curses: calling addch() with an 1-length str segfaults with ncurses6 
compiled with --enable-ext-colors
type: crash
versions: Python 3.4, Python 3.5

___
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-28 Thread Brett Cannon

Brett Cannon added the comment:

It looks like Zachary beat me to fixing this: 
https://hg.python.org/cpython/rev/5d1934c27137. Thanks for the patch, Mariatta, 
even if Zachary didn't use it.

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fb7c439103b9 by Victor Stinner in branch '3.6':
Issue #28544: Fix _asynciomodule.c on Windows
https://hg.python.org/cpython/rev/fb7c439103b9

--

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yes, see the commit to branch 3.6, which will next be released as .0b3.

--

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-28 Thread Big Stone

Big Stone added the comment:

will it be in python-3.6.0b3 ?

what should be in python._pth, in WinPython particular case ?
(as Lib\site-packages didn't seem needed, for unknown reason)

--

___
Python tracker 

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



[issue28199] Compact dict resizing is doing too much work

2016-10-28 Thread STINNER Victor

STINNER Victor added the comment:

Remark about perf timeout: you can use --compare-to with the patched
Python binary to check if the result is significant and compute the
"x.xx faster" number.

--

___
Python tracker 

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread Yury Selivanov

Yury Selivanov added the comment:

I've committed the patch with a few touchups:

* Applied code-review feedback.

* We now use AC for all methods, including Task._repr_info, Task._step, etc. 
See [1].

* I fixed the Task to be fully subclassable; users can override Task._step and 
Task._wakeup now.  There are tests for ensuring that subclassing works the same 
for both Python and C implementations. See [2] and [3].

* I made it possible to override Future._schedule_subclass, as it was in Python 
3.5. See [4].

Andrew, Inada-san, thank you for reviewing the patch!  Please take a look at 
the patch updates referenced below.  Feel free to re-open the issue if you see 
anything suspicious.

[1] 
https://github.com/1st1/cpython/commit/99adc35c94d76d78b8e666381436016c3c74a5ab

[2] 
https://github.com/1st1/cpython/commit/e294491c4cc7c92bc94ff12b4796c8ab12c40435

[3] 
https://github.com/1st1/cpython/commit/4d1c50c8987af124ce0bcccaea6bde82a60b59ee

[4] 
https://github.com/1st1/cpython/commit/efec03cbb4f81e78defd989d72c9bdae1122f50d

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



[issue28544] Implement asyncio.Task in C

2016-10-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset db5ae4f6df8a by Yury Selivanov in branch '3.6':
Issue #28544: Implement asyncio.Task in C.
https://hg.python.org/cpython/rev/db5ae4f6df8a

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

--
nosy: +python-dev

___
Python tracker 

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2016-10-28 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

What's wrong with the Python wiki link in msg263206 above? It is supposed to be 
_the_ guide for setting up compilers in Windows, isn't it?

Ideally, this should be a link to `distutils' docs - because, you know, the 
wiki isn't carved in stone, either, while the docs for the specific version are 
bundled with it.

Actually, `distutils' does have an entry on `distutils.msvccompiler': 
https://docs.python.org/2/distutils/apiref.html#module-distutils.msvccompiler . 
It even documents the use of DUSTUTILS_USE_SDK variable!
The wording could use some clarification and maybe a link to wiki, but that's 
for another ticket.

--

___
Python tracker 

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



[issue28548] http.server parse_request() bug and error reporting

2016-10-28 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

This might also affect other Python version; I haven't checked, but I know it 
affects Python 3.5.

In Mailman 3, we have a subclass of WSGIRequestHandler for our REST API, and we 
got a bug report about an error condition returning a 400 in the body of the 
response, but still returning an implicit 200 header.

https://gitlab.com/mailman/mailman/issues/288

This is pretty easily reproducible with the following recipe.

$ git clone https://gitlab.com/mailman/mailman.git
$ cd mailman
$ tox -e py35 --notest -r
$ .tox/py35/bin/python3.5 
/home/barry/projects/mailman/trunk/.tox/py35/bin/runner --runner=rest:0:1 -C 
/home/barry/projects/mailman/trunk/var/etc/mailman.cfg 

(Note that you might need to run `.tox/py35/bin/mailman info` first, and of 
course you'll have to adjust the directories for your own local fork.)

Now, in another shell, do the following:

$ curl -v -i -u restadmin:restpass "http://localhost:8001/3.0/lists/list 
example.com"

Note specifically that there is a space right before the "example.com" bit.

Take note also that we're generating an HTTP/1.1 request as per curl default.

The response you get is:

*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8001 (#0)
* Server auth using Basic with user 'restadmin'
> GET /3.0/lists/list example.com HTTP/1.1
> Host: localhost:8001
> Authorization: Basic cmVzdGFkbWluOnJlc3RwYXNz
> User-Agent: curl/7.50.1
> Accept: */*
> 
http://www.w3.org/TR/html4/strict.dtd;>



Error response


Error response
Error code: 400
Message: Bad request syntax ('GET /3.0/lists/list example.com 
HTTP/1.1').
Error code explanation: HTTPStatus.BAD_REQUEST - Bad request syntax 
or unsupported method.


* Connection #0 to host localhost left intact


Notice the lack of response headers, and thus the implicit 200 return even 
though the proper error code is in the body of the response.  Why does this 
happen?

Now look at http.server.BaseHTTPRequestHandler.  The default_request_version is 
"HTTP/0.9".  Given the request, you'd expect to see the version set to 
"HTTP/1.1", but that doesn't happen because the extra space messes up the 
request parsing.  parse_request() splits the request line by spaces and when 
this happens, the wrong number of words shows up.  We get 4 words, thus the 
'else:' clause in parse_request() gets triggered.  So far so good.

This eventually leads us to send_error() and from there into send_response() 
with the error code (properly 400) and message.  From there we get to 
.send_response_only() and tracing into this function shows you where things go 
wrong.

send_response_only() has an explicit test on self.request_version != 
'HTTP/0.9', in which case it adds nothing to the _header_buffer.  Well, because 
the request parsing got the unexpected number of words, in fact request_version 
*is* the default HTTP/0.9.  Thus the error headers are never added.

There are several problems here.  Why are the headers never added when the 
request is HTTP/0.9?  (I haven't read the spec.)  Also, since parse_request() 
isn't setting the request version to 'HTTP/1.1'.  It should probably dig out 
the words[-1] and see if that looks like a version string.

Clearly the request isn't properly escaped, but http.server should not be 
sending an implicit 200 when the request is bogus.

--
components: Library (Lib)
messages: 279611
nosy: barry
priority: normal
severity: normal
status: open
title: http.server parse_request() bug and error reporting
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



[issue26862] android: SYS_getdents64 does not need to be defined on android API 21

2016-10-28 Thread cschramm

cschramm added the comment:

Well, the 3.5 code checks __ANDROID__ as well and works pretty fine on Android, 
but if it's not supposed to be supported, we'll have to upgrade to 3.6 then.

Thanks for your work! :)

--

___
Python tracker 

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



[issue27683] ipaddress subnet slicing iterator malfunction

2016-10-28 Thread Xiang Zhang

Xiang Zhang added the comment:

Ping. ;-)

--
nosy: +pmoody

___
Python tracker 

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



[issue27860] Improvements to ipaddress module

2016-10-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue26862] android: SYS_getdents64 does not need to be defined on android API 21

2016-10-28 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Sorry, AFAIK there is no plan to retrofit the Android changes to 3.5.
Note that Python 3.6 is expected to be released in few weeks, by next 
mid-december.

--

___
Python tracker 

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



[issue27860] Improvements to ipaddress module

2016-10-28 Thread Nick Coghlan

Nick Coghlan added the comment:

Peter, are you able to take a look at this or indicate you're happy for someone 
else to take it? (I relinquished my co-maintainer role for the ipaddress module 
a while back, so you're the only currently listed maintainer)

--

___
Python tracker 

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



[issue26862] android: SYS_getdents64 does not need to be defined on android API 21

2016-10-28 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

cschramm: AFAIK only Python 3.6+ has experimental Android support. 3.5 or below 
are not supported.

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue28199] Compact dict resizing is doing too much work

2016-10-28 Thread Xiang Zhang

Xiang Zhang added the comment:

I doubt how many memcpy could benefit. Two pass does not necessarily make 
faster. I make a simple test:

With dictresize3, (I make insert_index inline):

[bin]$ ./python3 -m perf timeit -s 'd = {i:i for i in range(6)}' 'dict(d)'

Median +- std dev: 441 ns +- 21 ns
[bin]$ ./python3 -m perf timeit -s 'd = {i:i for i in range(60)}' 'dict(d)'

Median +- std dev: 2.02 us +- 0.10 us
[bin]$ ./python3 -m perf timeit -s 'd = {i:i for i in range(600)}' 'dict(d)'

Median +- std dev: 18.1 us +- 0.9 us

With dictresize4:

[bin]$ ./python3 -m perf timeit -s 'd = {i:i for i in range(6)}' 'dict(d)'

Median +- std dev: 448 ns +- 33 ns
[bin]$ ./python3 -m perf timeit -s 'd = {i:i for i in range(60)}' 'dict(d)'

Median +- std dev: 2.04 us +- 0.09 us
[bin]$ ./python3 -m perf timeit -s 'd = {i:i for i in range(600)}' 'dict(d)'

Median +- std dev: 18.2 us +- 0.1 us

Just like INAKA states, there is hardly any difference. And you need 2 pass for 
dicts with deleted member.

--

___
Python tracker 

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



[issue26862] android: SYS_getdents64 does not need to be defined on android API 21

2016-10-28 Thread cschramm

cschramm added the comment:

Any plans to fix this in 3.5 as well?

--
nosy: +cschramm

___
Python tracker 

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



[issue28547] Python to use Windows Certificate Store

2016-10-28 Thread Christian Heimes

Christian Heimes added the comment:

Python's ssl library has used Windows' cert store since 3.4 / 2.7.9. Some third 
party applications like requests or pip rather use their own cert store 
instead. This decision is beyond control of Python.

https://docs.python.org/3/library/ssl.html#ssl.SSLContext.load_default_certs
https://docs.python.org/3/library/ssl.html#ssl.enum_certificates

--

___
Python tracker 

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



[issue28547] Python to use Windows Certificate Store

2016-10-28 Thread Jean-Philippe Landry

New submission from Jean-Philippe Landry:

Hello,

Would it be possible for Python to use the Certificate Store in windows instead 
of a predetermined list of certificates. The use case is as follows:

Multiple machines being on a corporate network where there is a man in the 
middle packet inspection (IT security stuff...) that will resign most of the 
SSL connections with its own certificate that is unfortunately not part of the 
python default store. There are also multiple behind the firewall servers using 
self signed certificates. That means that almost all SSL requests, including 
pip install will throw the famous [SSL: CERTIFICATE_VERIFY_FAILED] error.

This is transparent in Chrome because Chrome is using the Windows store to 
determine if a certificate is trusted or not and all those custom certificates 
are in the windows store.

However, Python uses its own file (list of approved certificates). I understand 
that this can be overridden using a custom, manually managed, crt file and set 
it into the environment variables (REQUESTS_CA_BUNDLE) and it works. However, 
this involves manual operation and undesired maintenance when a new certificate 
will be added to the store. The windows store itself gets updated periodically 
by IT so it is a not an issue.

Is there a rationale behind using a specific file instead of the windows store 
which will work for Chrome, IE, etc...

Best regards,

Jean-Philippe

--
assignee: christian.heimes
components: SSL
messages: 279602
nosy: Jean-Philippe Landry, christian.heimes
priority: normal
severity: normal
status: open
title: Python to use Windows Certificate Store
type: behavior
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



[issue28546] Better explain setting pdb breakpoints

2016-10-28 Thread Ian Kelling

New submission from Ian Kelling:

https://docs.python.org/3.7/library/pdb.html:

"The typical usage to break into the debugger from a running program is to 
insert

import pdb; pdb.set_trace()

at the location you want to break into the debugger."

A plain read of this says: insert code into a running program.
I can do this just fine in gdb, so when reading this, I wonder
if attaching is explained elsewhere, or what.

Patch to improve this.

--
assignee: docs@python
components: Documentation
files: iank-v1.patch
keywords: patch
messages: 279601
nosy: docs@python, iank
priority: normal
severity: normal
status: open
title: Better explain setting pdb breakpoints
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45253/iank-v1.patch

___
Python tracker 

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



[issue27860] Improvements to ipaddress module

2016-10-28 Thread Moritz Sichert

Moritz Sichert added the comment:

Any updates?

--

___
Python tracker 

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



[issue28199] Compact dict resizing is doing too much work

2016-10-28 Thread INADA Naoki

INADA Naoki added the comment:

Current code and my patch called insertdict_clean() or insert_index() for each 
entry.
On the other hand, Serhiy's patch calls build_indices() once.
This may be faster when compiler doesn't inlining the helper function.
As a bonus, we can use memcpy to copy entries.

Cons of Serhiy's patch is it's two pass. If entries are larger than L2 cache,
fetch from L3 cache may be larger.
So I can't declare that Serhiy's patch is faster until benchmark.

(My forecast is no performance difference between my patch and Serhiy's on amd64
machine, and Serhiy's patch is faster on more poor CPU.)

--

___
Python tracker 

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



[issue28199] Compact dict resizing is doing too much work

2016-10-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The advantage is using memcpy in case of combined table without deletions. This 
is common case of creating dict without pre-resizing: dict(list), 
dict(iterator), etc.

In future, when will be possible to reuse old entries array, this also could 
help in case of multiple modifications without significant size growth. First 
squeeze entries (skipping NULL values), then clear and rebuild index table.

--

___
Python tracker 

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



[issue28199] Compact dict resizing is doing too much work

2016-10-28 Thread INADA Naoki

INADA Naoki added the comment:

LGTM.

--

___
Python tracker 

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



[issue27838] test_os.test_chown() failure on koobs-freebsd-current

2016-10-28 Thread Kubilay Kocak

Kubilay Kocak added the comment:

Serhiy, ah I thought the patch would be applied to say the 'custom' builder for 
this buildbot or the branch in general :)

If not, I can test this in ~<= 2 days locally, though its worth noting that the 
issue quite likely not be reproducible outside of the Python buildbot 
environment.

--

___
Python tracker 

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



[issue28199] Compact dict resizing is doing too much work

2016-10-28 Thread Xiang Zhang

Xiang Zhang added the comment:

Hmm, what's the advantage?

--

___
Python tracker 

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



[issue27838] test_os.test_chown() failure on koobs-freebsd-current

2016-10-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Kubilay, could you please run tests with my patch?

--

___
Python tracker 

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



[issue28199] Compact dict resizing is doing too much work

2016-10-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What if split copying entries from inserting indices? First fill a continuous 
array of entries (could use memcpy if there were not deletions), then build a 
hashtable of continuous indices. Following patch implements this idea.

--
Added file: http://bugs.python.org/file45252/dictresize4.patch

___
Python tracker 

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



[issue26856] android does not have pwd.getpwall()

2016-10-28 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee:  -> xdegaye
components: +Tests
stage:  -> patch review
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



[issue28046] Remove the concept of platform-specific directories

2016-10-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 86577b7100a4 by Xavier de Gaye in branch '3.6':
Issue #28046: Fix the removal of the sysconfigdata module
https://hg.python.org/cpython/rev/86577b7100a4

New changeset 28205c4cf20b by Xavier de Gaye in branch 'default':
Issue #28046: Merge with 3.6.
https://hg.python.org/cpython/rev/28205c4cf20b

--

___
Python tracker 

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



[issue28541] Improve test coverage for json library - loading bytes

2016-10-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In general LGTM, but I added few minor comments on Rietveld. Click on the 
"review" near your patch. You should also receive an email notification, but it 
can be moved to your Spam folder.

--

___
Python tracker 

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



[issue26941] android: test_threading hangs on armv7

2016-10-28 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Adding a dependency to issue 26939.
Patch attached.

--
assignee:  -> xdegaye
components: +Tests -Library (Lib)
dependencies: +android: test_functools hangs on armv7
keywords: +patch
stage:  -> patch review
versions: +Python 3.7
Added file: http://bugs.python.org/file45251/setswitchinterval.patch

___
Python tracker 

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



[issue26940] android: test_importlib hangs on armv7

2016-10-28 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Adding a dependency to issue 26939.
Patch attached.

--
assignee:  -> xdegaye
components: +Tests -Library (Lib)
dependencies: +android: test_functools hangs on armv7
keywords: +patch
stage:  -> patch review
versions: +Python 3.7
Added file: http://bugs.python.org/file45250/setswitchinterval.patch

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-10-28 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Patch attached.

--
assignee:  -> xdegaye
components: +Tests -Library (Lib)
dependencies:  -android: add platform.android_ver()
stage:  -> patch review
versions: +Python 3.7
Added file: http://bugs.python.org/file45249/setswitchinterval.patch

___
Python tracker 

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



[issue28545] socket.bind to AF_PACKET should use passed interface name

2016-10-28 Thread Martin Turon

Martin Turon added the comment:

If I bind to port 0, it works for both tx and rx.  Sorry for the false alarm!

sock.bind(("monitor0", 0))

--
status: open -> closed

___
Python tracker 

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



[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-28 Thread Xiang Zhang

Xiang Zhang added the comment:

It works. Close. :-)

--
status: open -> closed

___
Python tracker 

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



[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

test_walk_bad_dir renamed one of subdirs and tearDown failed to clean up 
changed tree. An error happened depending on the order of listed 
subdirectories: ['SUB1', 'SUB2'] -- passed, ['SUB2', 'SUB1'] -- failed.

--

___
Python tracker 

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



[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 655510dd46fd by Serhiy Storchaka in branch '3.5':
Issue #28353: Make test_os.WalkTests.test_walk_bad_dir stable.
https://hg.python.org/cpython/rev/655510dd46fd

New changeset df28e536f19d by Serhiy Storchaka in branch '3.6':
Issue #28353: Make test_os.WalkTests.test_walk_bad_dir stable.
https://hg.python.org/cpython/rev/df28e536f19d

New changeset aa891d13e1cf by Serhiy Storchaka in branch 'default':
Issue #28353: Make test_os.WalkTests.test_walk_bad_dir stable.
https://hg.python.org/cpython/rev/aa891d13e1cf

--

___
Python tracker 

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



[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-28 Thread Xiang Zhang

Xiang Zhang added the comment:

Seems like the dir you add breaks other cases. I change addCleanUp to os.chmod 
and get:

==
FAIL: test_file_like_path (test.test_os.BytesWalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 950, in 
test_file_like_path
self.test_walk_prune(_PathLike(self.walk_path))
  File "/home/angwer/cpython/Lib/test/test_os.py", line 941, in test_walk_prune
self.assertEqual(len(all), 2)
AssertionError: 3 != 2

==
FAIL: test_walk_bottom_up (test.test_os.BytesWalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 956, in 
test_walk_bottom_up
self.assertEqual(len(all), 4, all)
AssertionError: 5 != 4 : [('@test_24702_tmp/TEST1/SUB2/SUB21', [], ['tmp3']), 
('@test_24702_tmp/TEST1/SUB2', ['link', 'SUB21'], ['tmp3', 'broken_link3', 
'broken_link', 'broken_link2']), ('@test_24702_tmp/TEST1/SUB1/SUB11', [], []), 
('@test_24702_tmp/TEST1/SUB1', ['SUB11'], ['tmp2']), ('@test_24702_tmp/TEST1', 
['SUB2', 'SUB1'], ['tmp1'])]

==
FAIL: test_walk_prune (test.test_os.BytesWalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 941, in test_walk_prune
self.assertEqual(len(all), 2)
AssertionError: 3 != 2

==
FAIL: test_walk_topdown (test.test_os.BytesWalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 916, in 
test_walk_topdown
self.assertEqual(len(all), 4)
AssertionError: 5 != 4

==
FAIL: test_file_like_path (test.test_os.FwalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 950, in 
test_file_like_path
self.test_walk_prune(_PathLike(self.walk_path))
  File "/home/angwer/cpython/Lib/test/test_os.py", line 941, in test_walk_prune
self.assertEqual(len(all), 2)
AssertionError: 3 != 2

==
FAIL: test_walk_bottom_up (test.test_os.FwalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 956, in 
test_walk_bottom_up
self.assertEqual(len(all), 4, all)
AssertionError: 5 != 4 : [('@test_24702_tmp/TEST1/SUB2/SUB21', [], ['tmp3']), 
('@test_24702_tmp/TEST1/SUB2', ['link', 'SUB21'], ['tmp3', 'broken_link3', 
'broken_link', 'broken_link2']), ('@test_24702_tmp/TEST1/SUB1/SUB11', [], []), 
('@test_24702_tmp/TEST1/SUB1', ['SUB11'], ['tmp2']), ('@test_24702_tmp/TEST1', 
['SUB2', 'SUB1'], ['tmp1'])]

==
FAIL: test_walk_prune (test.test_os.FwalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 941, in test_walk_prune
self.assertEqual(len(all), 2)
AssertionError: 3 != 2

==
FAIL: test_walk_topdown (test.test_os.FwalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 916, in 
test_walk_topdown
self.assertEqual(len(all), 4)
AssertionError: 5 != 4

==
FAIL: test_file_like_path (test.test_os.WalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 950, in 
test_file_like_path
self.test_walk_prune(_PathLike(self.walk_path))
  File "/home/angwer/cpython/Lib/test/test_os.py", line 941, in test_walk_prune
self.assertEqual(len(all), 2)
AssertionError: 3 != 2

==
FAIL: test_walk_bottom_up (test.test_os.WalkTests)
--
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/test_os.py", line 956, in 
test_walk_bottom_up
self.assertEqual(len(all), 4, all)
AssertionError: 5 != 4 : [('@test_24702_tmp/TEST1/SUB2/SUB21', [], ['tmp3']), 
('@test_24702_tmp/TEST1/SUB2', ['link', 'SUB21'], ['tmp3', 

[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Hmm, tests were passed when I ran them before committing. Seems this is 
heisenbug.

--

___
Python tracker 

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