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

2016-10-27 Thread Xiang Zhang

Xiang Zhang added the comment:

Serhiy, after your commits, test_os requires root privileges or it'll fail. 
This is not the case before.

[cpython]$ ./python -m test test_os
Run tests sequentially
0:00:00 [1/1] test_os
test test_os crashed -- Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/libregrtest/runtest.py", line 164, in 
runtest_inner
test_runner()
  File "/home/angwer/cpython/Lib/test/libregrtest/runtest.py", line 163, in 
test_runner
support.run_unittest(tests)
  File "/home/angwer/cpython/Lib/test/support/__init__.py", line 1849, in 
run_unittest
_run_suite(suite)
  File "/home/angwer/cpython/Lib/test/support/__init__.py", line 1824, in 
_run_suite
raise TestFailed(err)
test.support.TestFailed: multiple errors occurred; run in verbose mode for 
details

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/libregrtest/runtest.py", line 167, in 
runtest_inner
test_time = time.time() - start_time
  File "/home/angwer/cpython/Lib/test/libregrtest/save_env.py", line 278, in 
__exit__
restore(original)
  File "/home/angwer/cpython/Lib/test/libregrtest/save_env.py", line 235, in 
restore_files
support.rmtree(fn)
  File "/home/angwer/cpython/Lib/test/support/__init__.py", line 377, in rmtree
_rmtree(path)
  File "/home/angwer/cpython/Lib/shutil.py", line 474, in rmtree
_rmtree_safe_fd(fd, path, onerror)
  File "/home/angwer/cpython/Lib/shutil.py", line 412, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
  File "/home/angwer/cpython/Lib/shutil.py", line 412, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
  File "/home/angwer/cpython/Lib/shutil.py", line 408, in _rmtree_safe_fd
onerror(os.open, fullname, sys.exc_info())
  File "/home/angwer/cpython/Lib/shutil.py", line 406, in _rmtree_safe_fd
dirfd = os.open(name, os.O_RDONLY, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'SUB21'

'test_os' left behind directory '@test_23400_tmp' and it couldn't be removed: 
[Errno 13] Permission denied: 'SUB21'
test_os failed

1 test failed:
test_os

Total duration: 292 ms
Tests result: FAILURE
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/test/support/__init__.py", line 914, in 
temp_dir
yield path
  File "/home/angwer/cpython/Lib/test/support/__init__.py", line 963, in 
temp_cwd
yield cwd_dir
  File "/home/angwer/cpython/Lib/test/libregrtest/main.py", line 468, in main
self._main(tests, kwargs)
  File "/home/angwer/cpython/Lib/test/libregrtest/main.py", line 497, in _main
sys.exit(len(self.bad) > 0 or self.interrupted)
SystemExit: True

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "/home/angwer/cpython/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/angwer/cpython/Lib/test/__main__.py", line 2, in 
main()
  File "/home/angwer/cpython/Lib/test/libregrtest/main.py", line 532, in main
Regrtest().main(tests=tests, **kwargs)
  File "/home/angwer/cpython/Lib/test/libregrtest/main.py", line 468, in main
self._main(tests, kwargs)
  File "/home/angwer/cpython/Lib/contextlib.py", line 100, in __exit__
self.gen.throw(type, value, traceback)
  File "/home/angwer/cpython/Lib/test/support/__init__.py", line 963, in 
temp_cwd
yield cwd_dir
  File "/home/angwer/cpython/Lib/contextlib.py", line 100, in __exit__
self.gen.throw(type, value, traceback)
  File "/home/angwer/cpython/Lib/test/support/__init__.py", line 917, in 
temp_dir
rmtree(path)
  File "/home/angwer/cpython/Lib/test/support/__init__.py", line 377, in rmtree
_rmtree(path)
  File "/home/angwer/cpython/Lib/shutil.py", line 474, in rmtree
_rmtree_safe_fd(fd, path, onerror)
  File "/home/angwer/cpython/Lib/shutil.py", line 412, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
  File "/home/angwer/cpython/Lib/shutil.py", line 412, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
  File "/home/angwer/cpython/Lib/shutil.py", line 412, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
  File "/home/angwer/cpython/Lib/shutil.py", line 408, in _rmtree_safe_fd
onerror(os.open, fullname, sys.exc_info())
  File "/home/angwer/cpython/Lib/shutil.py", line 406, in _rmtree_safe_fd
dirfd = os.open(name, os.O_RDONLY, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'SUB21'

--
nosy: +xiang.zhang
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 

[issue28544] Implement asyncio.Task in C

2016-10-27 Thread Yury Selivanov

Yury Selivanov added the comment:

> - and `tasks.py` imports `futures.py` to have `isfuture`.

And tasks.py also imports coroutines.py (which was importing futures.py), 
making the cycle even worse.  Anyways, I don't see a problem in moving a 
function or two that everybody uses into a separate module.

--

___
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-27 Thread Yury Selivanov

Yury Selivanov added the comment:

> Why isfuture() is moved, and asyncio.coroutine uses
> base_futures.isfuture() instead of futures.isfuture()?

Import cycles: 

- `_asyncio` module is now being imported from `futures.py`
- and `_asyncio` is now imported from `tasks.py`; 
- and `tasks.py` imports `futures.py` to have `isfuture`.

Long story short, I don't see a way of keeping `isfuture` in `futures.py`.  The 
easiest option is to have it in a separate module.

--

___
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-27 Thread INADA Naoki

INADA Naoki added the comment:

Why isfuture() is moved, and asyncio.coroutine uses
base_futures.isfuture() instead of futures.isfuture()?

--

___
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-27 Thread Yury Selivanov

Yury Selivanov added the comment:

Uploading a new patch: sorted imports; added a unittest that exceptions in 
loop.call_soon aren't breaking Task.__init__.

--
Added file: http://bugs.python.org/file45248/ctask3.patch

___
Python tracker 

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



[issue28088] Document Transport.set_protocol and get_protocol

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



[issue28088] Document Transport.set_protocol and get_protocol

2016-10-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

I added a note like this. 


.. note::
   Switching protocol should only be done when both protocols are
   documented to support the switch.


Would this work? Would appreciate any feedback of how to properly document this 
behavior.

Thanks.

--
Added file: http://bugs.python.org/file45247/issue28088v2.patch

___
Python tracker 

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



[issue28531] Improve utf7 encoder memory usage

2016-10-27 Thread Xiang Zhang

Xiang Zhang added the comment:

Actually the patch is not going to speed up the encoder but just make the 
memory allocation strategy better, make the memory upper bound tighter. The 
speedup is just a good side effect. 

> It is rather in the line of idna and punycode than UTF-8 and UTF-32.

Agree.

> This encoder was omitted form _PyBytesWriter-using optimizations for purpose. 
> The patch complicates the implementation.

Not much. I think the implementation still remains simple.

--

___
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-27 Thread Eric Appelt

Eric Appelt added the comment:

Thanks for the feedback. I agree that the comment is incorrect for several 
iterations of the loop that really don't need to be tested at all for '5'. I 
read the previous issue 17909 more carefully along with RFC 4627, 7159, and 
EMCA 404 to properly understand the context here.

I notice that although the issue 17909 patch was written in order to implement 
the patterns in RFC 4627, it is also valid for the additional pattern 
introduced for utf-16-le in RFC 7159 as described in [1].

Specifically, in RFC 4627 the only valid pattern for utf-16-le begins with XX 
00 XX 00 since the first two characters must represent ASCII codepoints. With 
strings the second character can be higher codepoints allowing for XX 00 XX XX 
or XX 00 00 XX. In the implementation from issue 17909 the pattern XX 00 XX is 
first detected and results in utf-16-le, and then the 4th byte is checked for 
the pattern XX 00 00 XX or XX 00 00 00 to result in utf-16-le or utf-32 
respectively.

In the issue 17909 patch the special case of a single character JSON document 
(i.e. '5') is also specifically accounted for. This case is not mentioned in 
[1].

So for everything I can try (or think of), this implementation can correctly 
determine the encoding of any valid JSON document according to RFC 7159. This 
is good since the documentation [2] makes no distinction that json.loads() 
would only accept JSON documents in bytes if they adhere to 4627.

The encoding failure mode described in issue 17909 is still an invalid JSON 
document according to RFC 7159 as the control character \u is not escaped.

So I think overall the implementation is perfectly valid for RFC 7159 / EMCA 
404 as suggested by the standard library documentation [2].

To me it seems reasonable to have a unit test to specifically check that the 
pattern XX 00 00 XX works. For the goal of hitting 100% test coverage as 
measured by line, I believe that the 2-byte case still needs to be tested.

I have attached a patch that covers these cases along with (maybe too) verbose 
comments explaining the edge cases. I also changed the comments in the 
json/__init__.py module itself to clarify the detection patterns as implemented.

I'm not sure how helpful this is to the improvement in of the standard library, 
but it has been very educational to be so far.

[1] http://www.ietf.org/mail-archive/web/json/current/msg01959.html
[2] https://docs.python.org/3.7/library/json.html

--
Added file: http://bugs.python.org/file45246/mywork3.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-27 Thread Steve Dower

Steve Dower added the comment:

Fixed and added a test. (Yes I know that it's not the most efficient algorithm 
for joining the strings together, but I consider correctness to be more 
important here.)

--
stage: needs patch -> commit review
type:  -> crash
versions: +Python 3.7

___
Python tracker 

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



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

2016-10-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eea669163131 by Steve Dower in branch '3.6':
Issue #28522: Fixes mishandled buffer reallocation in getpathp.c
https://hg.python.org/cpython/rev/eea669163131

New changeset 72e64fc8746b by Steve Dower in branch 'default':
Issue #28522: Fixes mishandled buffer reallocation in getpathp.c
https://hg.python.org/cpython/rev/72e64fc8746b

--
nosy: +python-dev

___
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-27 Thread Yury Selivanov

Yury Selivanov added the comment:

Guido, Ned, thanks!  Andrew already glanced through the code, let's see what 
Inada-san says.

I'm uploading an updated patch addressing Andrew's review.

--
Added file: http://bugs.python.org/file45245/ctask2.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-27 Thread Ned Deily

Ned Deily added the comment:

I also trust Yury to do the right thing.

--

___
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-27 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't want to be the decider here. I don't have time to review the
code. I trust you all to do the right thing.

--

___
Python tracker 

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



[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a1aef5f84142 by Serhiy Storchaka in branch '3.5':
Issue #22949: Documented that fnmatch.translate() is for use with re.match().
https://hg.python.org/cpython/rev/a1aef5f84142

New changeset 8a564ab1d208 by Serhiy Storchaka in branch '2.7':
Issue #22949: Documented that fnmatch.translate() is for use with re.match().
https://hg.python.org/cpython/rev/8a564ab1d208

New changeset dfda2f33fd08 by Serhiy Storchaka in branch '3.6':
Issue #22949: Documented that fnmatch.translate() is for use with re.match().
https://hg.python.org/cpython/rev/dfda2f33fd08

New changeset d103ee917342 by Serhiy Storchaka in branch 'default':
Issue #22949: Documented that fnmatch.translate() is for use with re.match().
https://hg.python.org/cpython/rev/d103ee917342

--
nosy: +python-dev

___
Python tracker 

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



[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue22493] Deprecate the use of flags not at the start of regular expression

2016-10-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c04a56b3a4f2 by Serhiy Storchaka in branch '3.6':
Issue #22493: Updated an example for fnmatch.translate().
https://hg.python.org/cpython/rev/c04a56b3a4f2

New changeset ded9a3c3bbb6 by Serhiy Storchaka in branch 'default':
Issue #22493: Updated an example for fnmatch.translate().
https://hg.python.org/cpython/rev/ded9a3c3bbb6

--

___
Python tracker 

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



[issue28212] Closing server in asyncio is not efficient

2016-10-27 Thread Andrew Svetlov

Andrew Svetlov added the comment:

>From my perspective the problem is: many asyncio calls schedules a delayed 
>activity internally.
E.g. `task.cancel()` doesn't cancels immediately but requires at least one 
extra loop iteration.
The same is true for `transport.close()` -- it doesn't close socket in the call.
This behavior is encouraged by asyncio design and many third-party libraries 
just call `transp.close()` without waiting for upcoming 
`protocol.connection_lost()` callback.

I don't think it's a big problem, especially for server code.
But when users write small client tool they need to do extra no-op loop 
iterations before `loop.close()` call.

Waiting for no scheduled by `loop.call_soon()` callbacks makes no sense I 
believe. I could open a can of worms by introducing another weird side effects.

--

___
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-27 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Very impressive.
I've left a couple comments in rietveld though.

--

___
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-27 Thread Steve Dower

Steve Dower added the comment:

It's a genuine bug in path processing, specifically how we handle buffer 
resizing. I'll make a fix.

--
assignee:  -> steve.dower
stage:  -> needs patch

___
Python tracker 

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



[issue28496] Mark up constants 0, 1, -1 in C API docs

2016-10-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e90fe2209276 by Serhiy Storchaka in branch '2.7':
Issue #28496: Mark up constants 0, 1 and -1 that denote return values or
https://hg.python.org/cpython/rev/e90fe2209276

New changeset 04065efd7747 by Serhiy Storchaka in branch '3.5':
Issue #28496: Mark up constants 0, 1 and -1 that denote return values or
https://hg.python.org/cpython/rev/04065efd7747

New changeset de00be368f0b by Serhiy Storchaka in branch '3.6':
Issue #28496: Mark up constants 0, 1 and -1 that denote return values or
https://hg.python.org/cpython/rev/de00be368f0b

New changeset e19f2428b15a by Serhiy Storchaka in branch 'default':
Issue #28496: Mark up constants 0, 1 and -1 that denote return values or
https://hg.python.org/cpython/rev/e19f2428b15a

--
nosy: +python-dev

___
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-27 Thread Martin Turon

Martin Turon added the comment:

Just for clarity, the high level bug is that when binding to an interface using 
AF_PACKET, transmissions work, but receive does not:

sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, ETH_P_IEEE802154)
sock.bind(("monitor0", ETH_P_IEEE802154))

sock.send(test_frame)   # transmission works fine
pkt = sock.recv(127)# never receives, though C test works fine

The same test written in C that calls ioctl(sockfd, SIOCGIFNAME, ) to 
lookup ifindex for bind from ifname="monitor0" works fine.

--

___
Python tracker 

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



[issue28496] Mark up constants 0, 1, -1 in C API docs

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



[issue28544] Implement asyncio.Task in C

2016-10-27 Thread Ned Deily

Ned Deily added the comment:

If it's OK with Guido, it's OK with me for 360b3. (That's Monday.)

--

___
Python tracker 

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



[issue28528] Pdb.checkline()

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



[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Xiang.

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



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

2016-10-27 Thread Martin Turon

New submission from Martin Turon:

When binding to AF_PACKET linux kernel sockets, the interface name is not 
passed in when given -- it is always "".  This causes problems, for example, 
receiving packets to a "monitor0" interface doesn't work.

diff -r a6548e230ed6 Modules/socketmodule.c
--- a/Modules/socketmodule.cThu Oct 27 19:33:22 2016 +0300
+++ b/Modules/socketmodule.cThu Oct 27 11:13:12 2016 -0700
@@ -1344,6 +1344,7 @@
 {
 struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
 char *ifname = "";
+// ^^ ifname should be set to interface name passed in via sockaddr.
 struct ifreq ifr;
 /* need to look up interface name give index */
 if (a->sll_ifindex) {

--
messages: 279558
nosy: mturon
priority: normal
severity: normal
status: open
title: socket.bind to AF_PACKET should use passed interface name

___
Python tracker 

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



[issue28426] PyUnicode_AsDecodedObject can only return unicode now

2016-10-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 15a494886c5a by Serhiy Storchaka in branch '3.6':
Issue #28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),
https://hg.python.org/cpython/rev/15a494886c5a

New changeset 50c28727d91c by Serhiy Storchaka in branch 'default':
Issue #28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),
https://hg.python.org/cpython/rev/50c28727d91c

--

___
Python tracker 

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



[issue28531] Improve utf7 encoder memory usage

2016-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The performance of the UTF-7 codec is not important. Unlikely to other UTF-* 
encodings this is not standard Unicode encoding. It is used in minority of 
applications and unlikely is a bottleneck. It is rather in the line of idna and 
punycode than UTF-8 and UTF-32. Actually I'm going to propose replacing it with 
Python implementation.

This encoder was omitted form _PyBytesWriter-using optimizations for purpose. 
The patch complicates the implementation. Since the codec is rarely used some 
bugs lived long time in it. Any change risks to add new long living bug.

--

___
Python tracker 

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



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2016-10-27 Thread Mark Dickinson

Mark Dickinson added the comment:

Actually, here's a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file45244/math-degrees-overflow.diff

___
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-27 Thread Yury Selivanov

Yury Selivanov added the comment:

> Yury, would you like to merge this before 3.6b3?

Yes!

> I'll look this as soon as possible.

Thanks a lot!

--

___
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-27 Thread INADA Naoki

INADA Naoki added the comment:

Wow! Great Job!
Yury, would you like to merge this before 3.6b3?
I'll look this as soon as possible.

(nit fix) Some modules doesn't sort imports in lexicography.

--

___
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-27 Thread Big Stone

Big Stone added the comment:

maybe click on the "WinPython Command Prompt.exe" and do "pip uninstall IDLEX" 
as a first step. so you should see IDLE working

--

___
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-27 Thread Big Stone

Big Stone added the comment:

hi Steve,

You can grab it there 
https://sourceforge.net/projects/winpython/files/WinPython_3.6/3.6.0.0/betas/WinPython-64bit-3.6.0.0Zerorc2.exe/download
 MD5 | SHA-1| 
SHA-256  | Binary   
   | Size  
-|--|--|-|---
dd946ed17ee86ea035361d2e757a1cc1 | f0ec7ffac477a220dd24aea3fb70afaba579df00 | 
af6536f1922a044ac74300efcd275c9e25c5eb56140ded84a99f11d38ae5ac7b | 
WinPython-64bit-3.6.0.0Zerorc2.exe |   24 196 083 Bytes
dabae69ad09e1646625d3a8995a75056 | aaece4907096422c1df78f80a42a2268369d7697 | 
0d530b84f29481e7f03e4615c9da489711ca6883b49996219d9cd13aa5393330 | 
WinPython-64bit-3.6.0.0rc2.exe  |  208 255 944 Bytes

--

___
Python tracker 

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



[issue28531] Improve utf7 encoder memory usage

2016-10-27 Thread Xiang Zhang

Xiang Zhang added the comment:

v2 uses _PyBytesWriter so we can use on stack buffer for short string.

--
Added file: http://bugs.python.org/file45243/utf7_encoder_v2.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-27 Thread Yury Selivanov

Yury Selivanov added the comment:

Also, with this patch uvloop becomes ~3-5% faster too.

--

___
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-27 Thread Elvis Pranskevichus

Changes by Elvis Pranskevichus :


--
nosy: +Elvis.Pranskevichus

___
Python tracker 

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



[issue28526] Use PyUnicode_AsEncodedString instead of PyUnicode_AsEncodedObject

2016-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Josh.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue28526] Use PyUnicode_AsEncodedString instead of PyUnicode_AsEncodedObject

2016-10-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bea48e72cae5 by Serhiy Storchaka in branch '3.5':
Issue #28526: Use PyUnicode_AsEncodedString() instead of
https://hg.python.org/cpython/rev/bea48e72cae5

New changeset fe9f361f3751 by Serhiy Storchaka in branch '3.6':
Issue #28526: Use PyUnicode_AsEncodedString() instead of
https://hg.python.org/cpython/rev/fe9f361f3751

New changeset a6548e230ed6 by Serhiy Storchaka in branch 'default':
Issue #28526: Use PyUnicode_AsEncodedString() instead of
https://hg.python.org/cpython/rev/a6548e230ed6

--
nosy: +python-dev

___
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-27 Thread Yury Selivanov

New submission from Yury Selivanov:

The attached patch implements asyncio.Task in C.  Besides that, it also 
implements Argument Clinic for C Future.

Performance improvement on a simple echo server implementation using 
asyncio.streams:

Python Future & Task   |   C Future & Py Task   |   C Future & C Task
  23K req/s|   26K  |  30K
   |  ~10-15% boost | ~15%

Both Task and Future implemented in C, make asyncio programs up to 25-30% 
faster.

The patch is 100% backwards compatible.  I modified asyncio tests to cross test 
Tasks and Futures implementations, i.e. to run Task+Future, Task+CFuture, 
CTask+Future, CTask+CFuture tests.  No refleaks or other bugs.  All uvloop 
functional tests pass without any problem.

Ned, Guido, are you OK if I merge this in 3.6 before beta 3?  I'm confident 
that the patch is stable and even if something comes up we have time to fix it 
or even retract the patch.  The performance boost is very impressive, and I can 
also make uvloop simpler.

--
assignee: yselivanov
components: asyncio
files: ctask.patch
keywords: patch
messages: 279546
nosy: asvetlov, gvanrossum, haypo, inada.naoki, ned.deily, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Implement asyncio.Task in C
type: performance
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45242/ctask.patch

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-27 Thread Oleg Broytman

Oleg Broytman added the comment:

Then I don't have any objections. But I also couldn't test the change — I only 
use Firefox (and sometimes Chrome).

--

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Currently Netscape is just an alias to Mozilla. Since SeaMonkey is synchronized 
with Firefox, I suppose it dropped the support of the -remote option at the 
same time. Debian rebranded Firefox and SeaMonkey at 2006, therefore IceWeasel 
and IceApe always supported -new-win and -new-tab options. The last IceWeasel 
version was 38, it didn't supported the -remote option.

--

___
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-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch in issue17909 was written to implement encoding detecting described 
in RFC 4627 [1]. And the test uses RFC 4627 conforming data. A single codepoint 
"5" is not valid in RFC 4627, but is valid in RFC 7159 [2].

The comment in your patch is not accurate since '5' is encoded to 1 byte with 
utf-8 and 4 bytes with utf-32*.

[1] https://tools.ietf.org/html/rfc4627
[2] https://tools.ietf.org/html/rfc7159

--

___
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-27 Thread Stefano Rivera

Stefano Rivera added the comment:

I wouldn't say it's *entirely* Debian-specific. It just bites anyone who 
actually needs these tags to differentiate between built extensions. (Mostly 
Debian)

Yes, changing the tag is a more complete solution. It just seemed that that 
option was decided against, in the relevant PEPs.

--

___
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-27 Thread Matthias Klose

Matthias Klose added the comment:

I'm not sure that you really want this, because it would make it impossible to 
build an extension for the stable ABI for a debug build.  The problem is Debian 
specific, because we install the extension modules for normal and debug builds 
in the same location.  A Debian solution would be to use a different soname for 
stable API debug mode extensions.

--
nosy: +doko

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-27 Thread Oleg Broytman

Oleg Broytman added the comment:

I'd rather rename the new class to something like Firefox. So there will be 3 
classes — Netscape, Mozilla and Firefox. Firefox only for firefox executable.

--

___
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-27 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
components: +Cross-Build, Documentation
nosy: +Alex.Willmer

___
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-27 Thread Steve Dower

Steve Dower added the comment:

I suspect there's a .pth file in site-packages that is importing something to 
trigger the failure. Without a crash dump (or debug build) it's going to be 
difficult to find it, but it is certainly an unwrapped invalid parameter 
termination.

To save me some time, where can I get that build of WinPython from?

--

___
Python tracker 

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



[issue28543] Incomplete fast path codecs aliases in codecs doc

2016-10-27 Thread Xiang Zhang

New submission from Xiang Zhang:

The fast path codec aliases in codecs doc is complete especially after 
99818330b4c0.

--
assignee: docs@python
components: Documentation
files: codecs_doc.patch
keywords: patch
messages: 279538
nosy: docs@python, haypo, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Incomplete fast path codecs aliases in codecs doc
type: enhancement
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45241/codecs_doc.patch

___
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-27 Thread Eric Appelt

Eric Appelt added the comment:

I looked back and something is clearly wrong with my coverage reporting setup, 
sorry :(

When I move the test introduced in issue 17909, 'test_bytes_decode' from the 
module Lib/test/test_json/test_unicode.py to Lib/test/test_json/test_decode.py 
that particular test is properly traced and I see that the function is mostly 
covered, so I need to figure out what is going wrong in my setup.

The test already present is more comprehensive as it includes BOM, so I believe 
what I wrote is generally not helpful.

I did notice that the existing test does not cover the edge-case of a 2-byte 
utf-16 sequence that can be generated for a valid JSON object represented by a 
single codepoint, for example '5' or '7'. I created a new patch to augment the 
existing test to cover this special case rather than adding a test.

--
Added file: http://bugs.python.org/file45240/mywork2.patch

___
Python tracker 

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



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2016-10-27 Thread Mark Dickinson

Mark Dickinson added the comment:

Francisco: would you be interested in writing a patch?

--

___
Python tracker 

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



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2016-10-27 Thread Mark Dickinson

Mark Dickinson added the comment:

I agree in principle.

On one hand, it's difficult to care too much, since `math.degrees` is going to 
be all-but-useless for inputs larger than `1e20` or so anyway (the actual angle 
represented is getting lost in floating-point noise by that point).

OTOH, *because* of the above, at least making the change shouldn't break any 
code that wasn't broken already.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue28509] dict.update allocates too much

2016-10-27 Thread INADA Naoki

Changes by INADA Naoki :


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



[issue28509] dict.update allocates too much

2016-10-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8c2615decd2e by INADA Naoki in branch '3.6':
Issue #28509: dict.update() no longer allocate unnecessary large memory
https://hg.python.org/cpython/rev/8c2615decd2e

New changeset deb3e5857d8c by INADA Naoki in branch 'default':
Issue #28509: dict.update() no longer allocate unnecessary large memory
https://hg.python.org/cpython/rev/deb3e5857d8c

--
nosy: +python-dev

___
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-27 Thread Xavier de Gaye

Xavier de Gaye added the comment:

New patch taking into account Martin last review and some updated comments.

>> Why do you remove the code that loops over Modules/Setup? Maybe is it 
>> redundant with the other code for removing the already-built-in modules?
> Yes because this is redundant, maybe not the case when this was written 15 
> years ago.

* sys.builtin_module_names are the modules listed in the _PyImport_Inittab[] 
array that is built by Modules/makesetup from Modules/config.c.in and the 
'*static*' modules configured in the Setup files (those Setup files that are 
listed in the rule of the 'Makefile' target of the Makefile).  This list is 
missing the '*shared*' modules configured in the Setup files and that should 
not be built by setup.py.
* The setup.py code that loops over and loosely parses some of the 
Modules/Setup files, excludes both '*static*' and '*shared*' modules from the 
built modules.
* 'MODNAMES' does the same thing in the patch accurately as the list is built 
by makesetup.

New issue 28542 to document the cross-compilation.

--
Added file: http://bugs.python.org/file45239/removed_modules_3.patch

___
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-27 Thread Xavier de Gaye

New submission from Xavier de Gaye:

Patch adding a section to the README.

--
assignee: xdegaye
files: readme.patch
keywords: patch
messages: 279532
nosy: xdegaye
priority: normal
severity: normal
stage: patch review
status: open
title: document cross compilation
type: enhancement
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45238/readme.patch

___
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-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Isn't the test added in issue17909 enough?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2016-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In issue28014 __getitem__() is idempotent. Multiple calls of __getitem__() 
return the same result and keep the OrderedDict in the same state.

> I'd be perfectly happy with making popitem implemented in terms of pop on 
> subclasses when pop is overridden (if pop isn't overridden though, that's 
> effectively what popitem already does).

I like this idea.

> Note: In the expiring case, the fix is still "wrong" if someone used popitem 
> for the intended purpose (to get and delete).

Good catch! But old implementation still looks doubtful to me.

--

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The problem is that this class is used for Netscape and old Mozilla browsers. 
What if rename old Mozilla class to Netscape and use it for old browsers?

--
Added file: http://bugs.python.org/file45237/webbrowser.py-3.5-2.patch

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file45236/webbrowser.py-3.5.patch

___
Python tracker 

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



[issue28509] dict.update allocates too much

2016-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

28509-smaller-update2.patch LGTM.

Your idea in msg279480 looks worth, but needs benchmarking different corner 
cases to check that it doesn't cause to a regression. I think we will have 
enough time for this at 3.7 developing stage.

--
assignee:  -> inada.naoki
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



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

2016-10-27 Thread Eryk Sun

Eryk Sun added the comment:

You may have uncovered a bug in Python that's causing the invalid parameter 
handler to be invoked. It would help if you uploaded the zipped dump file for 
the crashed process. 

The status code you're getting (i.e. STATUS_STACK_BUFFER_OVERRUN, 0xC409) 
is used by the __fastfail intrinsic [1]. The exception occurred in ucrtbase.dll 
at offset 0x6d5b8. In a debugger you can see it's in the CRT's invoke_watson 
function:

0:000> u ucrtbase + 0x6d5b8 - 0x18 L7
ucrtbase!invoke_watson:
7ffd`8984d5a0 4883ec28sub rsp,28h
7ffd`8984d5a4 b91700  mov ecx,17h
7ffd`8984d5a9 ff1531310400callqword ptr
[ucrtbase!_imp_IsProcessorFeaturePresent (7ffd`898906e0)]
7ffd`8984d5af 85c0testeax,eax
7ffd`8984d5b1 7407je  ucrtbase!invoke_watson+0x1a
(7ffd`8984d5ba)
7ffd`8984d5b3 b90500  mov ecx,5
7ffd`8984d5b8 cd29int 29h

A fast fail executes an int 29h software interrupt, which gets handled by the 
following system function:

lkd> !idt 0x29
Dumping IDT: f801819a8070
29: f8017fd66680 nt!KiRaiseSecurityCheckFailure

In this case the CRT passes a value of 5 (FAST_FAIL_INVALID_ARG) in register 
rcx (ecx), so it's not a critical security failure.

[1]: https://msdn.microsoft.com/en-us/library/dn774154.aspx

--

___
Python tracker 

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



[issue10656] "Out of tree" build fails on AIX

2016-10-27 Thread Michael Haubenwallner

Michael Haubenwallner added the comment:

Modules/python.exp is generated at build-time, thus does not belong to 
$(srcdir).

--

___
Python tracker 

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