[issue27200] make doctest in CPython has failures

2016-08-09 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Thanks for committing all of these patches! I have local patches for some more 
tests; I'll try to find some time to upload them.

--

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

All of the current dependencies have been committed.  I still see failures in:

Doc/faq/programming.rst
Doc/library/configparser.rst (also leaves Doc/example.ini)
Doc/library/copyreg.rst
Doc/library/ctypes.rst
Doc/library/datetime.rst
Doc/library/functions.rst
Doc/library/ipaddress.rst
Doc/library/pathlib.rst
Doc/library/re.rst
Doc/library/reprlib.rst
Doc/library/shlex.rst
Doc/library/turtle.rst (possibly only due to lack of usable tkinter)
Doc/library/unittest.mock-examples.rst
Doc/library/unittest.mock.rst
Doc/library/urllib.parse.rst
Doc/library/weakref.rst

For a total of 450 failures (1 in setup code) out of 1726 tests on 3.6.  Also, 
some test leaves 'Doc/foo'.

--
components: +Documentation, Tests
type:  -> behavior
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f3a04d19e5cb by Zachary Ware in branch '3.5':
Issue #27200: Fix doctests in Doc/library/hashlib.rst
https://hg.python.org/cpython/rev/f3a04d19e5cb

New changeset d0302d8ecbc1 by Zachary Ware in branch 'default':
Issue #27200: Merge with 3.5
https://hg.python.org/cpython/rev/d0302d8ecbc1

--
nosy: +python-dev

___
Python tracker 

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



[issue27210] Failing doctests due to environmental dependencies in Lib/{nntp, ftp, diff}lib.rst

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the patch!  I made a couple changes in difflib.rst to avoid issues 
with sys.stdout.write() returning the number of characters written.

--
nosy: +zach.ware
title: Failing doctests due to environmental dependencies in Lib/*lib.rst -> 
Failing doctests due to environmental dependencies in Lib/{nntp,ftp,diff}lib.rst
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



[issue27210] Failing doctests due to environmental dependencies in Lib/*lib.rst

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6b00ccf5e435 by Zachary Ware in branch '3.5':
Issue #27210: Fix doctests for a few modules.
https://hg.python.org/cpython/rev/6b00ccf5e435

New changeset 0a569e4b1d57 by Zachary Ware in branch 'default':
Closes #27210: Merge with 3.5
https://hg.python.org/cpython/rev/0a569e4b1d57

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27209] Failing doctests in Library/email.*.rst

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the patch!

--
nosy: +zach.ware
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



[issue27209] Failing doctests in Library/email.*.rst

2016-08-09 Thread Roundup Robot

New submission from Roundup Robot:

New changeset bb443518141e by Zachary Ware in branch '3.5':
Issue #27209: Fix doctests in Doc/library/email*.rst
https://hg.python.org/cpython/rev/bb443518141e

New changeset 81dc2d250209 by Zachary Ware in branch 'default':
Closes #27209: Merge with 3.5
https://hg.python.org/cpython/rev/81dc2d250209

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27208] Failing doctests in Library/traceback.rst

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eadf2905f424 by Zachary Ware in branch '3.5':
Issue #27208: Fix doctest in Doc/library/traceback.rst
https://hg.python.org/cpython/rev/eadf2905f424

New changeset 76c04e780cd5 by Zachary Ware in branch 'default':
Closes #27208: Merge with 3.5
https://hg.python.org/cpython/rev/76c04e780cd5

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27208] Failing doctests in Library/traceback.rst

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the patch!

--
nosy: +zach.ware
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



[issue27207] Failing doctests in Doc/whatsnew/3.2.rst

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the patch!  I added a couple more skips to get everything passing 
(the ones I skipped could not be properly tested).

--
nosy: +zach.ware
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



[issue27207] Failing doctests in Doc/whatsnew/3.2.rst

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cee3074233e6 by Zachary Ware in branch '3.5':
Issue #27207: Fix doctests in Doc/whatsnew/3.2.rst
https://hg.python.org/cpython/rev/cee3074233e6

New changeset ea43895ebfd9 by Zachary Ware in branch 'default':
Closes #27207: Merge with 3.5
https://hg.python.org/cpython/rev/ea43895ebfd9

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27687] Linux shutil.move between mountpoints as root does not retain ownership

2016-08-09 Thread Antti Haapala

Antti Haapala added the comment:

And as it is documented, it would be a change against documentation.
However as a stop-gap it is rather trivial to make your own copy function to 
fix this. copy2 returns the actual destination, so you could do

 def copy_with_ownership(src, dest, *, follow_symlinks=True):
 actual_dest = copy2(src, dest, follow_symlinks=follow_symlinks)
 fix_ownership(src, actual_dest)
 return actual_dest

implement fix_ownership to do what it needs to do, and pass copy_with_ownership 
as the copy_function argument to move.

--
nosy: +ztane

___
Python tracker 

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



[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Yes, but 3.4 is out of bugfix maintenance and thus its docs are no longer 
updated.

--
status: open -> closed
versions:  -Python 3.4

___
Python tracker 

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



[issue23591] Add Flags and IntFlags

2016-08-09 Thread Ethan Furman

Ethan Furman added the comment:

The idea behind Flags is that they are easily combined enums.  The advantage 
they have over IntFlags is they do not interact with integers, and they cannot 
have non-existing values used.  By keeping the same API as IntFlags we only 
have two APIs instead of three (Enum and Flag instead of Enum, EnumSet, and 
IntFlag), and also make life easier for changing code from one to the other 
(Flag <-> IntFlag).

--

___
Python tracker 

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



[issue12345] Add math.tau

2016-08-09 Thread Tim Peters

Tim Peters added the comment:

Hmm.  I'd test that tau is exactly equal to 2*pi.  All Python platforms  (past, 
present, and plausible future ones) have binary C doubles, so the only 
difference between pi and 2*pi _should_ be in the exponent (multiplication by 2 
is exact).  Else we screwed up one or both mantissas (typed the constant wrong, 
and/or the C compiler is rounding incorrectly) - which would be bad.

--
nosy: +tim.peters

___
Python tracker 

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



[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Ankur Dedania

Ankur Dedania added the comment:

Path.touch is also incorrect in python 3.4 documents

--
status: closed -> open
versions: +Python 3.4

___
Python tracker 

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



[issue12345] Add math.tau

2016-08-09 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, here's a diff with a test that math.tau ~~ 2*math.pi.

--
Added file: http://bugs.python.org/file44065/tau2.diff

___
Python tracker 

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



[issue27708] Rounding/Large Int representation error with multiplication and division

2016-08-09 Thread Eric V. Smith

Changes by Eric V. Smith :


--
title: Roudning/Large Int representation error with multiplication and division 
-> Rounding/Large Int representation error with multiplication and division

___
Python tracker 

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



[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Eric V. Smith

Eric V. Smith added the comment:

Thanks for giving an example.

You misunderstand how the "/" operator works in python 3.x: the result is 
always a float. If you use "//", you'll get an integer:

>>> 346624232496199842417306589390203563969059156941566239998694701635250663711452284218031962223891107456
>>>  // 8
4332802906202498030216332367377544549613239461769577836837704406332963931535527253995277986388432

--
status: open -> closed

___
Python tracker 

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



[issue12345] Add math.tau

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Builds fine on Windows.  Happily, `math.tau == 2*math.pi` is True.

--
nosy: +zach.ware
stage: needs patch -> commit review
versions: +Python 3.6

___
Python tracker 

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



[issue27712] Tiny typos in import.rst

2016-08-09 Thread Martin Panter

New submission from Martin Panter:

Looks good to me

--
nosy: +martin.panter
stage:  -> commit review
versions: +Python 3.5

___
Python tracker 

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



[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Ethan Glass

Ethan Glass added the comment:

As I said in a previous post, the numbers used are not stored. I ran the 
algorithm again in the shell with the following result.
>>>4332802906202498030216332367377544549613239461769577836837704406332963931535527253995277986388432*8

346624232496199842417306589390203563969059156941566239998694701635250663711452284218031962223891107456
>>>346624232496199842417306589390203563969059156941566239998694701635250663711452284218031962223891107456/8

4.332802906202498e+100

--
status: closed -> open

___
Python tracker 

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



[issue19489] move quick search box above TOC

2016-08-09 Thread Ammar Askar

Ammar Askar added the comment:

> 1. It would be better to make "Quick search" a placeholder

Do you mean in addition to the "Quick search" text that is already on the page 
or do you want to remove that? Because placeholder isn't fully compatible with 
some older browsers http://caniuse.com/#feat=input-placeholder

> 2.  will add an unnecessary border in search page. I'd 
> change it to

Good idea, will fix this.

> may cause weird compatibility problems in some (old?) browsers.

What problems are you thinking of? I think `display: inline` is the right 
choice here since we want the inputs to inherit the height of the header. The 
page renders fine on all versions of IE from my testing.

Also, newer versions of sphinx come with a newer jquery that breaks 
compatibility with IE8 which would cause the search box to not appear anyway.

>Is there a way to send this to upstream Sphinx?

I don't think so, it's one of those things that make sense as a theme, which is 
perfect since we have our own sphinx theme anyway.

--
Added file: http://bugs.python.org/file44064/searchbar_in_header.diff3

___
Python tracker 

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



[issue26686] email.parser stops parsing headers too soon when given a defective message.

2016-08-09 Thread Martin Panter

Martin Panter added the comment:

.
It would be nice to get feedback if my patch is sensible, especially from 
people familiar with normal usage of the “email” module, as opposed with the 
usage by the HTTP module.

--
stage:  -> patch review

___
Python tracker 

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



[issue27716] http.client truncates UTF-8 encoded headers

2016-08-09 Thread Martin Panter

Martin Panter added the comment:

For the test case given, the main problem is actually that a header field is 
being incorrectly split on a Latin-1 “next line” control code U+0085. The 
problem is already described under Issue 22233. It looks like I wrote a patch 
for that a while ago, so it would be good to revisit and see if it is worth 
applying.

Also, the problem would have been less severe if Issue 24363 was addressed; I 
proposed a patch at Issue 26686 which may help.

Here are the relevant header fields returned by the server:
>>> conn.request("GET", "/slownik/angielski-polski/")
>>> pprint(conn.sock.recv().splitlines(keepends=True))
[b'HTTP/1.1 200 OK\r\n',
 . . .
 b'Link: ; rel="alternate"; hreflang="zh-Hans", '
 . . .
 b'Transfer-Encoding: chunked\r\n',
 b'Content-Type: text/html;charset=UTF-8\r\n',
 b'\r\n',
 b'104c\r\n',
 b'\n',
 . . .]

Regarding header value character encoding, revision cb09fdef19f5 is an example 
of where I assumed a Latin-1 transformation to handle non-ASCII redirect 
targets. Perhaps just document how the bytes are transformed, and how to get 
the original bytes back?

FWIW UTF-8 is used in RTSP, which is based on HTTP.

--
nosy: +martin.panter
superseder:  -> http.client splits headers on non-\r\n characters

___
Python tracker 

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



[issue12345] Add math.tau

2016-08-09 Thread Guido van Rossum

Changes by Guido van Rossum :


--
keywords: +patch
Added file: http://bugs.python.org/file44063/tau.diff

___
Python tracker 

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



[issue12345] Add math.tau

2016-08-09 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm just going to do this.

--
assignee:  -> gvanrossum
resolution: rejected -> 
status: closed -> open

___
Python tracker 

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



[issue27723] Document typing.Text and typing.AnyStr

2016-08-09 Thread Michael Lee

New submission from Michael Lee:

This patch documents typing.Text and typing.AnyStr.

I decided against creating a new top-level section to document Text/AnyStr 
mainly because it seems like how exactly str/bytes/unicode is handled by mypy 
and described in PEP 484 might be changing sometime in the future and didn't 
want to add text that would need to be changed later on -- I'm not sure if that 
was the right call or not.

--
assignee: docs@python
components: Documentation
files: document-text-and-anystr.patch
keywords: patch
messages: 272286
nosy: docs@python, gvanrossum, michael0x2a
priority: normal
severity: normal
status: open
title: Document typing.Text and typing.AnyStr
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44062/document-text-and-anystr.patch

___
Python tracker 

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



[issue27414] http.server.BaseHTTPRequestHandler inconsistence with Content-Length value

2016-08-09 Thread Martin Panter

Changes by Martin Panter :


--
stage:  -> needs patch

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-08-09 Thread Yury Selivanov

Yury Selivanov added the comment:

I'd also think about implementing asyncio.Handle in C (with a freelist).

--

___
Python tracker 

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



[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Ned Deily

Ned Deily added the comment:

Joseph, thanks for taking an interest in improving Python and submitting this 
patch.  Alas, I don't think we should apply it.  There are always tradeoffs 
that have to be considered when changing existing code.  Distutils is one of 
the oldest and most external facing of Python's standard library modules.  
Distutils is a key dependency of many other critical third-party projects, like 
setuptools and pip. Also, Numpy subclasses and extends parts of Distutils.  
Many third-party projects are set up to work with multiple versions of Python 
so we always need to be careful about introducing changes in one version that 
might break that version independence.  On the one hand, this change is small 
and seems to be likely to be safe, although it is very difficult to know for 
sure how third-parties may currently be using strtobool() in their own code.  
On the other hand, what does making this change buy us and users?  The only 
thing I can see is a more modern return type and slightly cleaner code.
   In cases like that, we usually say that the status quo wins: we choose to 
not make changes that have no real benefit (other than a minor aesthetic one) 
but could possibly introduce an incompatibility.  Yes, if we were writing 
Distutils today, it would definitely return a boolean but that's not a good 
enough reason to change it now.  Other opinions?

--
nosy: +ned.deily

___
Python tracker 

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



[issue27720] decimal.Context.to_eng_string wrong docstring

2016-08-09 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +skrah

___
Python tracker 

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



[issue27719] Misleading note about "args" attribute in "User-defined Exceptions" section of tutorial

2016-08-09 Thread Berker Peksag

Berker Peksag added the comment:

Thank you for your detailed report! Would you like to propose a patch?

This behavior is already tested in testAttributes in 
Lib/test/test_exceptions.py so we just need a documentation patch.

--
keywords: +easy
nosy: +berker.peksag
stage:  -> needs patch
type:  -> behavior
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Berker Peksag

Berker Peksag added the comment:

Could you also update documentation in Doc/distutils/apiref.rst?

Also, test_strtobool in Lib/distutils/tests/test_util.py doesn't test the 
following case:

>>> from distutils.util import strtobool
>>> strtobool('x')
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/berker/projects/cpython/default/Lib/distutils/util.py", line 
317, in strtobool
raise ValueError("invalid truth value %r" % (val,)) 
ValueError: invalid truth value 'x'

Bonus points if you add a test for that :)

Thanks!

--
nosy: +berker.peksag
stage: commit review -> patch review

___
Python tracker 

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



[issue21018] [patch] added missing documentation about escaping characters for configparser

2016-08-09 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch. Two things:

* We want to keep docstrings short so could you please revert the changes in 
Lib/configparser.py?

* It would be better to just add an example of escaping these characters in the 
"Interpolation of values" section (preferably with a short comment.)

--
nosy: +berker.peksag
stage:  -> patch review
versions: +Python 3.6

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-09 Thread Yury Selivanov

Yury Selivanov added the comment:

> WRT boolean for SSL, I think it's very common for clients to verify server 
> certificates, but relatively uncommon for servers to require client 
> certificates.  The impression I have from reading docs and stack overflow 
> posts that the most common use case for the SSL module is connection to HTTPS 
> sites. For this use case, using a default context makes a lot of sense.

> It seems extremely unlikely to me for a server to use a default context.

I think in this case we should just mimic the API of create_server and 
create_unix_server.

As for restricting socket family type - I think Guido is right.  Although I'd 
love uvloop to be 100% compatible, I guess we shouldn't add artificial 
restrictions: if asyncio already supports AF_BLUETOOTH then let's keep it that 
way.

--

___
Python tracker 

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



[issue19489] move quick search box above TOC

2016-08-09 Thread Berker Peksag

Berker Peksag added the comment:

This looks pretty good to me, thanks! I have two minor suggestions:

1. It would be better to make "Quick search" a placeholder:

   

2.  will add an unnecessary border in search page. I'd change 
it to

   

Also,

+form.inline-search input {
+display: inline;
+}

may cause weird compatibility problems in some (old?) browsers. We can change 
it to use display: inline-block instead.

Is there a way to send this to upstream Sphinx?

--

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-08-09 Thread Yury Selivanov

Yury Selivanov added the comment:

> What parts of Future are performance critical? Maybe it is worth to implement 
> in C only the most critical code.

Basically everything.  Contrary to @contextmanager, Futures are the building 
blocks of asyncio, so instantiation + awaiting on them + setting results must 
be fast.

To cover instantiation, I want to add a freelist for Futures, so this basically 
requires them to be implemented in C (and it's not a lot of C code actually).

--

___
Python tracker 

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



[issue27206] Failing doctests in Doc/tutorial/

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the patch!

--
assignee: docs@python -> zach.ware
nosy: +zach.ware
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



[issue27206] Failing doctests in Doc/tutorial/

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8b7efeeefa50 by Zachary Ware in branch '3.5':
Issue #27206: Fix doctests in Doc/tutorial.
https://hg.python.org/cpython/rev/8b7efeeefa50

New changeset 61d7aeb6aa1b by Zachary Ware in branch 'default':
Closes #27206: Merge with 3.5
https://hg.python.org/cpython/rev/61d7aeb6aa1b

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27205] Failing doctests in Library/collections.rst

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the patch!

--
assignee: docs@python -> zach.ware
nosy: +zach.ware
type:  -> behavior
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue27205] Failing doctests in Library/collections.rst

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e399930d14f0 by Zachary Ware in branch '2.7':
Issue #27205: Fix doctests in Doc/library/collections.rst
https://hg.python.org/cpython/rev/e399930d14f0

New changeset 0d95e47cfe3e by Zachary Ware in branch '3.5':
Issue #27205: Fix doctests in Doc/library/collections.rst.
https://hg.python.org/cpython/rev/0d95e47cfe3e

New changeset 6817b8112f6e by Zachary Ware in branch 'default':
Closes #27205: Merge with 3.5
https://hg.python.org/cpython/rev/6817b8112f6e

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27713] Spurious "platform dependent libraries" warnings when running make

2016-08-09 Thread Ned Deily

Changes by Ned Deily :


--
components: +Build -Installation
nosy: +ned.deily
stage:  -> needs patch
versions: +Python 3.6

___
Python tracker 

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



[issue27204] Failing doctests in Doc/howto/

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the patch!

--
assignee:  -> zach.ware
components: +Documentation
nosy: +zach.ware
type:  -> behavior
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the report!

--
nosy: +zach.ware
versions:  -Python 3.4

___
Python tracker 

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



[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 773bc9a3172d by Zachary Ware in branch '3.5':
Issue #27722: Fix default for touch method's 'mode' argument
https://hg.python.org/cpython/rev/773bc9a3172d

New changeset 763d98f0a105 by Zachary Ware in branch 'default':
Closes #27722: Merge with 3.5
https://hg.python.org/cpython/rev/763d98f0a105

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27204] Failing doctests in Doc/howto/

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0eaa05a3db02 by Zachary Ware in branch '2.7':
Issue #27204: Fix doctests in Doc/howto
https://hg.python.org/cpython/rev/0eaa05a3db02

New changeset df92f9856b59 by Zachary Ware in branch '3.5':
Issue #27204: Fix doctests in Doc/howto
https://hg.python.org/cpython/rev/df92f9856b59

New changeset e31597cbf52c by Zachary Ware in branch 'default':
Closes #27204: Merge with 3.5
https://hg.python.org/cpython/rev/e31597cbf52c

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Ankur Dedania

New submission from Ankur Dedania:

Path.touch's keyword argument mode documented incorrectly.

In the documents, it shows keyword argument mode defaulted to 0o777, however 
within the code it is set to 0o666.

--
assignee: docs@python
components: Documentation
messages: 272269
nosy: AnkurDedania, docs@python
priority: normal
severity: normal
status: open
title: Path.touch's keyword argument mode documented incorrectly
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2016-08-09 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +zach.ware

___
Python tracker 

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



[issue27128] Add _PyObject_FastCall()

2016-08-09 Thread STINNER Victor

STINNER Victor added the comment:

> Benchmarking results look nice, but despite the fact that this patch is
only small part of issue26814, it looks to me larger that it could be.

Oh I failed to express my intent. This initial patch is not expected to
introduce any speedup. In fact I noticed major performance regressions on
the CPython benchmark suite using my full fastcall patch. It took me time
to understand that they are more issues with benchmarks than my work. This
minimum patch only adds new functions but don't really use them. I patched
a few functions to show how the new functions can be used. I spent most of
my time just to ensure that the minimum patch doesn't introduce performance
regression.

> 1. The patch includes two parts: adding _PyObject_FastCall() and adding
PyObject_CallNoArg() and PyObject_CallArg1(). How large the role of latter
functions in the speed up?

See my remark above, no speedup is expected.

Do you suggest to not add these 2 new functions? Since they are well
defined and simple, I chose to make them public. Their API is nicer than
_PyObject_Call().

> Can existing function PyObject_Call() be optimized to achieve a
comparable benefit?

Sorry, I don't understand. This function requires a tuple. The whole
purpose of my patch is to avoid temporary tuples.

In my full patch, PyObject_Call() calls _PyObject_FastCall() in most cases.

> 2. I think that supporting keyword arguments in _PyObject_FastCall()
doesn't make much sense now.

Well, I can add support for keyword arguments later and start with an
assertion (fail if they are used). But I really need them in the API, and I
don't want to change to API later.

I plan to add a new METH_FASTCALL calling convention for C functions. I
would prefer to not have two new calling conventions, but use Argument
Clinic to emit efficient code to parse arguments.

> Calling with keyword arguments adds such much overhead, that it dwarfs
the benefit of avoiding the creation of one tuple. I think that the patch
can be simpler if drop the support of keyword arguments.

Keyword arguments are optional. Having support for them cost nothing when
they are not used.

> 3. The patch adds two files for one function _PyStack_AsTuple(). I would
prefer something like _PyTuple_FromArray(). It could be used in other
places, not just in argument parsing.

I really want to have a "pystack" API. In this patch, the new file looks
useless, but in the full patch there are many functions including a few
complex functions. I prefer to add the file now and complete it later.

I'm limited by Mercurial and our workflow (tools), it would be much easier
to explain my work using a patch serie, but it's not possible to publish a
patch serie...

--

___
Python tracker 

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



[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread SilentGhost

SilentGhost added the comment:

LGTM

--
stage:  -> commit review

___
Python tracker 

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



[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Joseph Bane

Joseph Bane added the comment:

Thank you for the feedback. Please find an updated patch attached.

--
Added file: http://bugs.python.org/file44061/patch.diff

___
Python tracker 

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



[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread SilentGhost

SilentGhost added the comment:

Couple of things: your patch doesn't seem to apply cleanly for whatever reason 
(most likely because it's a patch against python2); the change from lowercasing 
to casefolding doesn't seem justified to me; the formatted value needs to be 
repr-formatted - though again - a change that's beyond the scope of this issue.

The tests are unaffected by this change, however.

--
nosy: +SilentGhost
type: enhancement -> behavior

___
Python tracker 

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



[issue26526] In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA

2016-08-09 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue27128] Add _PyObject_FastCall()

2016-08-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Benchmarking results look nice, but despite the fact that this patch is only 
small part of issue26814, it looks to me larger that it could be.

1. The patch includes two parts: adding _PyObject_FastCall() and adding 
PyObject_CallNoArg() and PyObject_CallArg1(). How large the role of latter 
functions in the speed up? Can we first just add _PyObject_FastCall() and 
measure the effect of adding PyObject_CallNoArg() and PyObject_CallArg1() 
separately? Can existing function PyObject_Call() be optimized to achieve a 
comparable benefit?

2. I think that supporting keyword arguments in _PyObject_FastCall() doesn't 
make much sense now. Calling with keyword arguments adds such much overhead, 
that it dwarfs the benefit of avoiding the creation of one tuple. I think that 
the patch can be simpler if drop the support of keyword arguments.

3. The patch adds two files for one function _PyStack_AsTuple(). I would prefer 
something like _PyTuple_FromArray(). It could be used in other places, not just 
in argument parsing.

--

___
Python tracker 

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



[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread R. David Murray

Changes by R. David Murray :


--
title: strtobool returns 0 and 1 rather than False and True -> distutils 
strtobool returns 0 and 1 rather than False and True

___
Python tracker 

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



[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.6 -Python 2.7, Python 3.5

___
Python tracker 

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



[issue27721] strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Joseph Bane

New submission from Joseph Bane:

The distutils strtobool function returns 0 or 1 rather than the native boolean 
type True or False values:

https://hg.python.org/cpython/file/3.5/Lib/distutils/util.py#l304

Please see the attached patch for updates to this function. I have included 
updates to use a f-string in the raise and casefold instead of lower.

--
components: Distutils
files: patch.diff
keywords: patch
messages: 272263
nosy: Joseph Bane, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: strtobool returns 0 and 1 rather than False and True
type: enhancement
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file44060/patch.diff

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-08-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also a discussion on Python-Dev about rewriting contextlib.contextmanager 
in C: 
https://mail.python.org/pipermail/python-dev/2016-August/thread.html#145786 .

What parts of Future are performance critical? Maybe it is worth to implement 
in C only the most critical code.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27704] bytes(x) is slow when x is bytearray

2016-08-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

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

___
Python tracker 

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



[issue27704] bytes(x) is slow when x is bytearray

2016-08-09 Thread INADA Naoki

INADA Naoki added the comment:

Thanks for comments.

--
Added file: http://bugs.python.org/file44059/fast-bytearray-fromobject.patch

___
Python tracker 

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



[issue27720] decimal.Context.to_eng_string wrong docstring

2016-08-09 Thread Antti Haapala

New submission from Antti Haapala:

https://docs.python.org/3/library/decimal.html#decimal.Context.to_eng_string

The docstring for `Context.to_eng_string` says "Converts a number to a string, 
using scientific notation.", which is, less extra comma, exactly the docstring 
for `Context.to_sci_string`. It should probably say "using engineering 
notation".

Additionally, docstring for Decimal.to_eng_string uses the term "an 
engineering-type string", which no one uses outside the said docstring. It 
should probably also say "Convert to a string using engineering notation."

--
assignee: docs@python
components: Documentation
messages: 272259
nosy: docs@python, ztane
priority: normal
severity: normal
status: open
title: decimal.Context.to_eng_string wrong docstring

___
Python tracker 

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



[issue27712] Tiny typos in import.rst

2016-08-09 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: docs@python -> brett.cannon
nosy: +brett.cannon

___
Python tracker 

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



[issue27704] bytes(x) is slow when x is bytearray

2016-08-09 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi Serhiy

Thank you for your feedback.

Stephane

--

___
Python tracker 

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



[issue27719] Misleading note about "args" attribute in "User-defined Exceptions" section of tutorial

2016-08-09 Thread Ben Hoyt

Ben Hoyt added the comment:

Note that I added the committers from issue 1692335 to the Nosy List -- 
probably overzealous and probably not the folks who maintain the docs, but oh 
well. :-)

--

___
Python tracker 

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



[issue27719] Misleading note about "args" attribute in "User-defined Exceptions" section of tutorial

2016-08-09 Thread Ben Hoyt

New submission from Ben Hoyt:

In the official tutorial in the "User-defined Exceptions" section 
(https://docs.python.org/3.5/tutorial/errors.html#user-defined-exceptions) 
there's a note about a user-defined Exception subclass as follows:

"In this example, the default __init__() of Exception has been overridden. The 
new behavior simply creates the value attribute. This replaces the default 
behavior of creating the args attribute."

That last sentence is wrong: it used to be that way (it is in Python 2.x and I 
believe in Python pre 3.2), but now the implementation of BaseException.__new__ 
now sets args, so even when you override __init__ and don't call super() args 
is set. I think that's what you want, so I'm putting this down to a 
documentation bug. I think the sentence "This replaces the default behavior of 
creating the args attribute." should simply be removed (BaseException.__init__ 
basically does nothing now).

This change happened for Python 3.3 and was backported to Python 3.2. See also:

* The relevant part of BaseException.__new__ in the CPython codebase: 
https://github.com/python/cpython/blob/601ee5fab5df81a25611da0667030de531c1cda9/Objects/exceptions.c#L44-L48
* The issue where this behaviour was changed: 
http://bugs.python.org/issue1692335
* The commit where it was changed: 
https://hg.python.org/cpython/rev/68e2690a471d (on GitHub at 
https://github.com/python/cpython/commit/a71a87e695b05a67bd22c6ac74311b1f56f3932e)
* You can repro this and confirm that "args" is definitely set with the 
attached script:

$ python exception_args_test.py 
sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0)
Error args: ('error!',)

--
assignee: docs@python
components: Documentation
files: exception_args_test.py
messages: 272256
nosy: benhoyt, docs@python, georg.brandl, sbt
priority: normal
severity: normal
status: open
title: Misleading note about "args" attribute in "User-defined Exceptions" 
section of tutorial
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44058/exception_args_test.py

___
Python tracker 

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



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-09 Thread R. David Murray

R. David Murray added the comment:

Kristján: right, what I'm saying about the possible bug is the final part of 
the traceback resulting from (apparently) wsgiref being closed and a new 
operation being attempted.  *Probably* that is a django bug in handling a 
network error, but maybe it is a wsgiref bug in handling the network error.  
(I'm assuming here that the Windows error is triggered by the retry, but I 
could of course be completely wrong about that.)

--

___
Python tracker 

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



[issue21999] shlex: bug in posix mode handling of empty strings

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f02ad46a0a8 by Vinay Sajip in branch '3.5':
Closes #21999: Handled empty strings correctly when in POSIX mode.
https://hg.python.org/cpython/rev/4f02ad46a0a8

New changeset a8e74448678c by Vinay Sajip in branch 'default':
Closes #21999: (Empty) merge from 3.5.
https://hg.python.org/cpython/rev/a8e74448678c

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



[issue27716] http.client truncates UTF-8 encoded headers

2016-08-09 Thread R. David Murray

R. David Murray added the comment:

Well, email will happily parse bytes and treat the non-ascii data as opaque 
(though it does record errors in an internal data structure), but the python3 
http api expects the parsed headers to be strings when you access them, so 
you'd just hit the decoding problem at that point rather than earlier.

This is a hard problem. Since headers *can* be latin1 (I'd forgotten that) 
SMTPUTF8 won't work.  We are stuck against the problem that python makes a 
careful distinction between bytes and string, but http does not.

In theory we could pass bytes to email, and then provide a new API for getting 
at the "raw" (bytes) header so you can decode it however you want.  That runs 
into backward compatibility problems, though, since we currently do decode from 
latin-1 and many programs are probably relying on that.  

Throwing out an idea here: maybe having the http policy decode the parsed bytes 
header from latin-1 when headers are accessed through the normal API would 
preserve backward compatibility.  I'm not too worried about back-compat in the 
http policy, since it is provisional until 3.6 comes out and I doubt anyone is 
currently using it.

--

___
Python tracker 

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



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-09 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

As already stated, this error bubbles up from the TCP layer.  It means that the 
tcp stack, for example, gave up resending a tcp frame and timed out, 
determining that the recipient was no longer listening.
You cannot create this error yourself.  If you, for example, call 
s.shutdown(SHUT_WR), you get a WSAESHUTDOWN error.  If the connection is closed 
(via s.close()) you get a EBADF error.
Now, the interaction with the client may cause the client to misbehave, but 
this sort of error is usually either due to the network (other host becomes 
unreachable) or misconfiguration of the local host's tcp stack.

--

___
Python tracker 

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



[issue21999] shlex: bug in posix mode handling of empty strings

2016-08-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cf04243e8d7d by Vinay Sajip in branch '2.7':
Issue #21999: Handled empty strings correctly when in POSIX mode.
https://hg.python.org/cpython/rev/cf04243e8d7d

--
nosy: +python-dev

___
Python tracker 

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



[issue27716] http.client truncates UTF-8 encoded headers

2016-08-09 Thread Cory Benfield

Cory Benfield added the comment:

Honestly, David, everything's a mess on this front. The authoritative document 
here is RFC 7230 Section 3.2.4 
(https://tools.ietf.org/html/rfc7230#section-3.2.4). The last paragraph of that 
section reads:

   Historically, HTTP has allowed field content with text in the
   ISO-8859-1 charset [ISO-8859-1], supporting other charsets only
   through use of [RFC2047] encoding.  In practice, most HTTP header
   field values use only a subset of the US-ASCII charset [USASCII].
   Newly defined header fields SHOULD limit their field values to
   US-ASCII octets.  A recipient SHOULD treat other octets in field
   content (obs-text) as opaque data.

In the case of http.client, actually maps pretty closely to Python 3's bytes 
object: header field values are basically ASCII + arbitrary opaque bytes. While 
UTF-8 is not strictly called out as allowed, neither is it called out as 
forbidden.

In this case, I'd say that there's no need to be too pedantic about Latin 1 at 
this stage in the pipeline. Python 3 is welcome to decode using Latin 1 *after* 
the header block has been split, because at least then it can be fixed up due 
to the round-tripping nature of Latin 1. But doing it here seems to just 
confuse the email parser.

--

___
Python tracker 

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



[issue27704] bytes(x) is slow when x is bytearray

2016-08-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

bytearray suffers from the same issue. It would be nice to optimize it too.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2016-08-09 Thread R. David Murray

R. David Murray added the comment:

The conversion of the module from a pure python module to a mixed module 
apparently caused a number of changes to the pydoc output.  This should be 
addressed to make the pydoc output complete, even if it still different in 
detail.

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



[issue27717] sqlite documentation bug

2016-08-09 Thread R. David Murray

R. David Murray added the comment:

I think it is pretty hard to miss "Never do this" when reading the code 
section.  That said, I don't have a strong objection to changing it.

I've reduced the versions field to those branches this might get changed in, as 
is our standard practice with the versions field.  Nor is this a security issue 
in our usage of that type, so I've changed the type to behavior.

--
nosy: +r.david.murray
type: security -> behavior
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-08-09 Thread Yury Selivanov

Yury Selivanov added the comment:

> Yury, could you review this before 3.6a4?

Left a couple of comments; the important one -- Future.__await__ (and 
Future.__iter__) should always return a *new* instance of a generator-like 
object (tied to the Future object).

--

___
Python tracker 

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



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2016-08-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +ethan.furman, giampaolo.rodola

___
Python tracker 

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



[issue27716] http.client truncates UTF-8 encoded headers

2016-08-09 Thread R. David Murray

R. David Murray added the comment:

utf-8 headers are contrary to the http spec, aren't they?  Or has that changed? 
 (It's been a long time since I've looked at any http RFCs.)

This could be fixed by using SMTPUTF8 mode when parsing the headers, which in 
theory ought to be backward compatible.  We could make SMTPUTF8 the default for 
email.policy.http, if this is correct per the RFCs.

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



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-09 Thread R. David Murray

R. David Murray added the comment:

Given that django is involved, it looks like it is most likely django that is 
calling the method after wsgiref is closed.  This doesn't *look* like a stdlib 
problem from what we can see so far, but it certainly could be.  We'd need a 
reproducer that didn't involve django to make any further progress from our 
side.

--

___
Python tracker 

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



[issue27698] socketpair not in socket.__all__ on Windows

2016-08-09 Thread R. David Murray

R. David Murray added the comment:

Ah, I see.  Yes, the normal "automatic adding" probably made that easy to 
forget.  The lack of "windows" comment there fooled me...it looks like what was 
really added was "support for any platform that supports sockets but not 
socketpair" :)

--

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-08-09 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: needs patch -> patch review
versions:  -Python 3.5

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-08-09 Thread INADA Naoki

INADA Naoki added the comment:

Yury, could you review this before 3.6a4?

--

___
Python tracker 

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



[issue12319] [http.client] HTTPConnection.request not support "chunked" Transfer-Encoding to send data

2016-08-09 Thread Rolf Krahl

Rolf Krahl added the comment:

I just wrote:

> There were also requests to drop support for stuff that is working
> in the current library, although not documented, and that is
> explicitly covered by the test suite.  I'm fine with dropping that
> and also adapted the tests accordingly.  But please be sure that
> what you are asking for is really what you want.

Sorry, please disregards this comment.  I just realized that these tests were 
added by previous versions of the patch by Damien.

--

___
Python tracker 

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



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2016-08-09 Thread Gabriel Pettier (Tshirtman)

New submission from Gabriel Pettier (Tshirtman):

Up to apparently python 3.5, using help('signal') used to show the 
'signal.signal' function among others, now it's not in the list, while of 
course help('signal.signal') does work, it was reported to me to still be the 
case in 3.6a1.

--
assignee: docs@python
components: Documentation
messages: 272240
nosy: Gabriel Pettier (Tshirtman), docs@python
priority: normal
severity: normal
status: open
title: help('signal') incomplete (e.g: signal.signal not visible)
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue12319] [http.client] HTTPConnection.request not support "chunked" Transfer-Encoding to send data

2016-08-09 Thread Rolf Krahl

Rolf Krahl added the comment:

Ok, here comes yet another version of the patch, addressing the review comments.

As indicated in the last post and requested by Martin, I moved the logic to 
deal with the different body types out of send() into _send_output().  I also 
removed the conversion from byte-like to bytes.

I had some problems with some comments mainly on the documentation of 
urllib.request, asking for stuff unrelated to chunked transfer encoding and the 
present issue.  I have the impression this is starting to get out of hands.  
Time is running out and I suggest that we should keep the focus on the present 
issue.

There were also requests to drop support for stuff that is working in the 
current library, although not documented, and that is explicitly covered by the 
test suite.  I'm fine with dropping that and also adapted the tests 
accordingly.  But please be sure that what you are asking for is really what 
you want.

Please note that this patch is not yet complete.  I still need your decision on 
the two issues raised in the last post: the test method to use for text streams 
and whether I should drop the sanity checks for the transfer-encoding header.

--
Added file: http://bugs.python.org/file44057/issue12319_10.patch

___
Python tracker 

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



[issue27717] sqlite documentation bug

2016-08-09 Thread Eyal Mor

New submission from Eyal Mor:

In the SQlite module documentation there a code section showing how to securely 
use the sqlite.execute method.
The problem with this code section is that just from a glance, without reading 
the paragraph before, or the comments in the section, users could use the 
insecure version.
It would be better if only a secure example would be in the code section.

https://docs.python.org/2/library/sqlite3.html

Section:
# Never do this -- insecure!
symbol = 'RHAT'
c.execute("SELECT * FROM stocks WHERE symbol = '%s'" % symbol)

# Do this instead
t = ('RHAT',)
c.execute('SELECT * FROM stocks WHERE symbol=?', t)
print c.fetchone()

# Larger example that inserts many records at a time
purchases = [('2006-03-28', 'BUY', 'IBM', 1000, 45.00),
 ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00),
 ('2006-04-06', 'SELL', 'IBM', 500, 53.00),
]
c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases)

--
assignee: docs@python
components: Documentation
files: Screen Shot 2016-08-09 at 3.28.05 PM.png
messages: 272238
nosy: Eyal Mor, docs@python
priority: normal
severity: normal
status: open
title: sqlite documentation bug
type: security
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44056/Screen Shot 2016-08-09 at 3.28.05 
PM.png

___
Python tracker 

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



[issue27716] http.client truncates UTF-8 encoded headers

2016-08-09 Thread Cory Benfield

Cory Benfield added the comment:

Simple repro case:

import http.client
conn = http.client.HTTPConnection('pl.bab.la')
conn.request("GET", '/slownik/angielski-polski/')
resp = conn.getresponse()
resp.read()  # Hangs here

--

___
Python tracker 

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



[issue27716] http.client truncates UTF-8 encoded headers

2016-08-09 Thread Cory Benfield

New submission from Cory Benfield:

Originally reported as Requests issue #3485: 
https://github.com/kennethreitz/requests/issues/3485

On Python 3, http.client uses the email module to parse its HTTP headers. The 
email module, for better or worse, requires that it parse headers as *text*: 
that is, that they be decoded from bytes first and then parsed.

This doesn't work for UTF-8 encoded headers. For example, the URL 
`'http://pl.bab.la/slownik/angielski-polski/'` returns the following Link 
header, encoded as UTF-8: `Link: ; 
rel="alternate"; hreflang="zh-Hans", 
; rel="alternate"; hreflang="cs", 
; rel="alternate"; hreflang="da", 
; rel="alternate"; 
hreflang="de", ; rel="alternate"; 
hreflang="el", ; rel="alternate"; 
hreflang="en", ; rel="alternate"; 
hreflang="eo", ; rel="alternate"; 
hreflang="es", ; rel="alternate"; 
hreflang="fi", ; 
rel="alternate"; hreflang="fr", ; 
rel="alternate"; hreflang="hi", ; 
rel="alternate"; hreflang="hu", 
; rel="alternate"; 
hreflang="id", ; rel="alternate"; 
hreflang="it", ; rel="alternate"; 
hreflang="ja", ; rel="alternate"; hreflang="ko", 
; rel="alternate"; hreflang="nl", 
; rel="alternate"; hreflang="no", 
; rel="alternate"; hreflang="pl", 
; rel="alternate"; hreflang="pt", 
; rel="alternate"; hreflang="ro", 
; rel="alternate"; hreflang="ru", 
; rel="alternate"; hreflang="sv", 
; rel="alternate"; 
hreflang="sw", ; rel="alternate"; 
hreflang="th", ; rel="alternate"; 
hreflang="tr", ; rel="alternate"; 
hreflang="vi"`.

When decoded using ISO-8859-1, this header gets truncated and this also causes 
the header block parsing to stop. This means that we don't see the 
Content-Length header, causing the HTTP client to wait for connection closure 
to consider the body terminated.

Really the only correct fix for this is for http.client to stop insisting that 
the headers be decoded before they are parsed, and instead to decode *after*. 
That way, at least, user code can recover the headers and handle them more 
sensibly.

--
components: Library (Lib)
messages: 272236
nosy: Lukasa
priority: normal
severity: normal
status: open
title: http.client truncates UTF-8 encoded headers
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



[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Eric V. Smith

Eric V. Smith added the comment:

Since your result is 6.754791118045615e+200, it's definitely not stored as an 
integer.

If you would show us exactly how you calculated this value, we can explain 
where the conversion to floating point is taking place. 

In the meantime, I'm going to close this issue, since it's not an problem with 
python integers.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2016-08-09 Thread koobs

koobs added the comment:

@Brett / Ned I'm happy to carry the proposed patch in the FreeBSD 
ports/packages until the next releases if that helps your confidence levels.

--
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-09 Thread Jim Fulton

Jim Fulton added the comment:

+1 restricting uvloop to AF_INET or AF_UNIX and SOCK_STREAM, at least until 
someone requests something else.

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-09 Thread Jim Fulton

Jim Fulton added the comment:

WRT boolean for SSL, I think it's very common for clients to verify server 
certificates, but relatively uncommon for servers to require client 
certificates.  The impression I have from reading docs and stack overflow posts 
that the most common use case for the SSL module is connection to HTTPS sites. 
For this use case, using a default context makes a lot of sense.

It seems extremely unlikely to me for a server to use a default context.

But I'm not an SSL expert.

--

___
Python tracker 

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



[issue27574] Faster parsing keyword arguments

2016-08-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed, in issue17170 this issue was discussed first.

--

___
Python tracker 

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



[issue23591] Add Flags and IntFlags

2016-08-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The name IntFlags is inspired by the Flags attribute in C# (this is the most 
close concept). The "Int" prefix is added for parallel with IntEnum and because 
the class behaves as int in some contexts (supports operators |, &, ^, ~ and 
can be passed to functions that require int). I don't know whether there is a 
need in Flags class that is not a subclass of int.

Other languages provide something like EnumSet - a specialized set of enums. 
But it has different interface.

1) If there are enum members FOO and BAR, their union is {FOO, BAR}, not 
FOO|BAR.
2) The union member itself is not a set.
3) A set can contain only predefined set of values (IntFlag allows non-defined 
bits be set).

If you thing that non-int flags could be useful, you can consider adding 
EnumSet for general enums and IntFlags (or just Flags) for int-like enums. But 
I think that new API can just use a set or a tuple of enums. IntFlags is needed 
for compatibility with old API or C API.

--

___
Python tracker 

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



[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Ethan Glass

Ethan Glass added the comment:

I actually started with a very small integer, said integer being 14. I then 
multiplied it by two large integers(10^100 or higher).I no longer have access 
to the two large integers, as they were never stored. When I divided the 
product by the two large integers, the quotient is returned as 13, 14, or 15.  
I have done more testing and found that the correct quotient of 14 is almost 
always returned, but 13 or 15 are returned occasionally. I am not trying to 
convert anything to/from a float to/from an integer. I typed a similar equation 
into the python shell and found that if I only divide by one of the factors, 
the return is a floating point that appears something like this:
6.754791118045615e+200
This is displayed in scientific notation as a float multiplied by 10^200. I do 
not know if this is how the computer processes and stored the integer or just 
how it is displayed,but if it is in fact how the integer is stored, it would 
theoretically be subject to rounding errors.

--

___
Python tracker 

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



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-09 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

This error is a protocol error.  It is the analog to WSAECONNRESET.
ECONNRESET occurs when the local host receives a RST packet from the peer, 
usually because the peer closed the connection.
WSAECONNABORT occurs when the local tcp layer decides that the connection is 
dead, (it may have sent RST to the peer itself).  This can occur for various 
reasons.  Often because the client has cone away, closed the connection or 
other things.  It is best to treat WSACONNRESET as WSACONNABORT, i.e., there 
was a TCP protocol error and the transaction (http request) probably wasn't 
completed completely by both parties.  See also here:
https://www.chilkatsoft.com/p/p_299.asp

In your case, I would expect a problem with the client uploading the file.  It 
probably closes the connection after sending the data without waiting for the 
http response.

--

___
Python tracker 

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



[issue26209] TypeError in smtpd module with string arguments

2016-08-09 Thread Ram Vallury

Ram Vallury added the comment:

added space before word portnumber. column space adjusted

--
Added file: http://bugs.python.org/file44055/smtpd_doc_updated_3.patch

___
Python tracker 

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



[issue27703] Replace two Py_XDECREFs with Py_DECREFs in do_raise

2016-08-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

do_raise_v2.patch (with asserts) LGTM. There are two ways that lead to this 
point (and third way leads to raising an exception), and additional assertions 
make the code clearer, because a reader shouldn't follow all these patch for 
reading the code after assertions.

--

___
Python tracker 

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



[issue27181] Add geometric mean to `statistics` module

2016-08-09 Thread Ram Rachum

Ram Rachum added the comment:

I meant the mathematical definition.

--

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2016-08-09 Thread devurandom

Changes by devurandom :


--
nosy: +devurandom

___
Python tracker 

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



  1   2   >