[issue35568] Expose the C raise() function in the signal module, for use on Windows

2018-12-26 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

I'd like to see it in 3.8, but don't know if I'll get to it, and it'd be a good 
onramp issue for someone who wants to get into cpython development. So, let's 
put the keyword on it for now, and see what happens...

--
keywords: +easy (C)

___
Python tracker 

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



[issue35121] Cookie domain check returns incorrect results

2018-12-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Also looking at the docs for different frameworks like 
[Flask](http://flask.pocoo.org/docs/1.0/api/#flask.Response.set_cookie) and 
[Django](https://docs.djangoproject.com/en/2.1/ref/request-response/#django.http.HttpResponse.set_cookie)
 they recommend setting Domain attribute only for cross-domain cookies.

>From Django docs

> Use domain if you want to set a cross-domain cookie. For example, 
> domain="example.com" will set a cookie that is readable by the domains 
> www.example.com, blog.example.com, etc. Otherwise, a cookie will only be 
> readable by the domain that set it.

When there is no domain specified then the frameworks seem to set the cookie 
only for the host only as per [RFC 
6265](https://tools.ietf.org/html/rfc6265#section-5.3). So domain attribute is 
set all the time and it's just that if the domain attribute is set explicitly 
by the server with the set_cookie function in the frameworks then the cookiejar 
has domain_specified set along with dot prefixed for the domain enabling 
stricter validations. I don't know about the metrics of setting the domain 
attribute vs not setting it. Checking with a simple Flask app and set_cookie 
without domain parameter the cookies are passed to suffix domains. With domain 
passed to set_cookie has dot prefixed and the cookies are not passed to suffix 
domains.

I also looked into other implementations

* aiohttp - uses cookiejar but has custom domain checks and update cookie 
methods at 
https://github.com/aio-libs/aiohttp/blob/49261c192ff225372dffb39056c3c311714b12c5/aiohttp/cookiejar.py#L141
 . Thus it's not affected when tested.
* golang implementation - 
https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/net/http/cookiejar/jar.go#L123

--

___
Python tracker 

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



[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict

2018-12-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Hi Vaibhav,

As noted in the thread the issue is fixed in 3.6 and above due to dict order 
being guaranteed. But it would be nice to have the test in the patch converted 
as a unit test. With respect to backport the fixes are backported to 
https://github.com/testing-cabal/mock to make mock library available for older 
versions of Python which would required the fix since dict order is not 
guaranteed in older versions. Once the test to CPython is merged you can make a 
PR to the mock repo with the fix and the test.

I haven't started working on a PR for this so feel free to go ahead.

--

___
Python tracker 

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



[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the feedback. I am closing this as rejected since it's not worth the 
cost of increasing import time and for performance reasons there are other 
options as Serhiy noted in msg332339.

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



[issue1222585] C++ compilation support for distutils

2018-12-26 Thread marsam


Change by marsam :


--
versions: +Python 3.7 -Python 3.5
Added file: https://bugs.python.org/file48016/python-3.x-distutils-C++.patch

___
Python tracker 

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



[issue34855] batch file variables

2018-12-26 Thread Steve Dower


Steve Dower  added the comment:

They should set it, and it will be read in PCbuild/python.props which has the 
"correct" name (I forget what it is right now and am not looking it up on my 
phone)

--

___
Python tracker 

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



[issue34855] batch file variables

2018-12-26 Thread Eric Lindblad


Eric Lindblad  added the comment:

Should windows-steps.yml (line 11) and windows-appx-test.yml committed 6 Dec. 
(line 39) both read EXTERNALS_DIR?

--

___
Python tracker 

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



[issue33661] urllib may leak sensitive HTTP headers to a third-party web site

2018-12-26 Thread Katsuhiko YOSHIDA

Katsuhiko YOSHIDA  added the comment:

Thanks. But I think the “add_unredirected_header” is not enough.

These sensitive headers should be removed only when redirecting to cross-site 
automatically for security like HTTPBasicAuthHandler of urllib2. In order to 
fulfill this requirement, I think the operation should be in 
HTTPRedirectHandler.redirect_request.

--

___
Python tracker 

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



[issue35583] (glibc2.28/MIPS32EL) python 3.7.x interpreter segmentation fault (3.6.x/2.7.x compile fine)

2018-12-26 Thread Gagan


Gagan  added the comment:

i tried compiling using "--without-pymalloc" and experienced the same problem.

there is no REASONABLE explanation for how this anomaly has arisen within 
SUBVERSIONS.

in the words of some infamous rappers:

"what, the 'embedded' (ARM-fellating) [east coast] crew doesn't have any love 
for MIPS [{Dr.} Dre and Snoop Dogg]?" 
(https://www.youtube.com/watch?v=tNfx325Nw78)

"y'all don't love MIPS (us)?"

"well let it be known then. we know you're ARM lovers ('east coast')"

seems those "high minded", "ancient", "lost civilisation" (and "aryan" [LULZ]) 
individuals have polluted computing.

it is unreal how much you guys have destroyed your own language.

--

___
Python tracker 

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



[issue22171] stack smash when using ctypes/libffi to access union

2018-12-26 Thread Sam Kerr


Sam Kerr  added the comment:

I was also able to get the stack smashing behavior with the following:
OS: Linux slaptop 4.19.12-arch1-1-ARCH #1 SMP PREEMPT Fri Dec 21 13:56:54 UTC 
2018 x86_64 GNU/Linux
GCC: gcc (GCC) 8.2.1 20181127

I was able to track down the issue into the src/x86/ffi64.c file inside libffi. 
Because more than 4 (the #define'd MAX_CLASSES value in libffi) items were 
passed, libffi writes outside an array boundary, which is what causes the stack 
smashing. 

I forked libffi and added an assert to prove this is what is happening. You can 
find it at 
https://github.com/stkerr/libffi/commit/80bca6647702ffd846c655be14d8306ef24ca2dd.
 Just as a quick test, I tried to increase the MAX_CLASSES value to 40, which 
is far more than the 9 in the crashing example. I'm 99% positive changing the 
MAX_CLASSES magic value isn't the right way to solve this issue, but it may 
give a hint on the proper way to address it.

I'm not sure at this point if this behavior is something for libffi to fix or 
how Python calls libffi though. I'll keep looking, but hopefully this helps 
someone else make some progress.

--
nosy: +Sam.Kerr

___
Python tracker 

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



[issue26537] ConfigParser has optionxform, but not sectionxform

2018-12-26 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Would it be worthwhile to convert this patch to a PR for 3.8?

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue35495] argparse does not honor default argument for nargs=argparse.REMAINDER argument

2018-12-26 Thread paul j3


paul j3  added the comment:

argparse.REMAINDER matches an empty list of arguments, just like '?' and '*'.  
So they are always 'filled', even by `parse_args([])`.

'?' and '*' have some special handling of defaults in this case, see in

argparse.ArgumentParser._get_values

the two 

value = action.default

REMAINDER has its own section in the function that does nothing with the 
default.

I think it should be left as is.

--
nosy: +paul.j3

___
Python tracker 

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



[issue35592] Not able to use Python 3.7.2 due to SSL issue

2018-12-26 Thread Christian Heimes


Christian Heimes  added the comment:

I don't see any error message. Please describe how you have installed Python 
and which version of Windows you are running. A traceback and an error message 
would be helpful, too.

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
type: crash -> behavior

___
Python tracker 

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



[issue35442] Chain of several subcommands in argparse

2018-12-26 Thread paul j3


Change by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue35537] use os.posix_spawn in subprocess

2018-12-26 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks for all your research and reference links on this!  As a 
_posixsubprocess maintainer, I am not against either posix_spawn or vfork being 
used directly in the future when feasible.

A challenge, especially with platform specific vfork, is making sure we 
understand exactly which platforms it can work properly on and checking for 
those both at compile time _and_ runtime (running kernel version and 
potentially the runtime libc version?) so that we can only use it in situations 
we are sure it is supposed to behave as desired in.  My guiding philosophy: Be 
conservative on choosing when such a thing is safe to use.

--

___
Python tracker 

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



[issue35592] Not able to use Python 3.7.2 due to SSL issue

2018-12-26 Thread Gunasekar Rajendran


New submission from Gunasekar Rajendran :

I am trying to run python code in Visual studio code and get the below error 
while trying to connect to mysql db

Python installation has no SSL support

--
assignee: christian.heimes
components: SSL
files: dbconnect.py
messages: 332564
nosy: Gunasekar Rajendran, christian.heimes
priority: normal
severity: normal
status: open
title: Not able to use Python 3.7.2 due to SSL issue
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48015/dbconnect.py

___
Python tracker 

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



[issue34836] test_ssl.test_default_ecdh_curve needs no tls1.3 flag in 2.7, for now

2018-12-26 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> christian.heimes

___
Python tracker 

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



[issue35559] Optimize base64.b16decode to use compiled regex

2018-12-26 Thread Stefan Behnel


Stefan Behnel  added the comment:

I agree with Antoine. After all, we are optimising a safety check here that 
runs in linear time. If people want speed, they should consider methods that do 
not do this check in the first place.

--

___
Python tracker 

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



[issue35585] Speedup Enum lookup

2018-12-26 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue35585] Speedup Enum lookup

2018-12-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 705b5998035739b1794a862123d3dc6e339a14d0 by Andrew Svetlov (Miss 
Islington (bot)) in branch '3.7':
Speed-up building enums by value, e.g. http.HTTPStatus(200) (GH-11318) 
(GH-11324)
https://github.com/python/cpython/commit/705b5998035739b1794a862123d3dc6e339a14d0


--

___
Python tracker 

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



[issue33661] urllib may leak sensitive HTTP headers to a third-party web site

2018-12-26 Thread Martin Panter

Martin Panter  added the comment:

Are you aware of the “add_unredirected_header” method? Maybe that is enough to 
avoid your problem.
https://docs.python.org/dev/library/urllib.request.html#urllib.request.Request.add_unredirected_header

--
nosy: +martin.panter
title: urllib may leak sensitive HTTP headers to a third-party web site -> 
urllib may leak sensitive HTTP headers to a third-party web site

___
Python tracker 

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



[issue28097] IDLE: document all key bindings, add menu items for more.

2018-12-26 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

PR11325 adds Previous/Next History to the Shell menu.

--
nosy: +cheryl.sabella
stage: patch review -> needs patch

___
Python tracker 

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



[issue28097] IDLE: document all key bindings, add menu items for more.

2018-12-26 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +10588
stage: needs patch -> patch review

___
Python tracker 

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



[issue28097] IDLE: document all key bindings, add menu items for more.

2018-12-26 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
keywords: +patch, patch
pull_requests: +10588, 10589
stage: needs patch -> patch review

___
Python tracker 

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



[issue28097] IDLE: document all key bindings, add menu items for more.

2018-12-26 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
keywords: +patch, patch, patch
pull_requests: +10588, 10589, 10590
stage: needs patch -> patch review

___
Python tracker 

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



[issue35591] IDLE: Traceback on Find Selection

2018-12-26 Thread Cheryl Sabella


New submission from Cheryl Sabella :

This probably isn't a traceback that's likely to happen, but I wanted to 
document it since I was able to recreate it.

To recreate:
In a new shell, do Select All, then Find Selection.


Exception in Tkinter callback
Traceback (most recent call last):
  File "N:\projects\cpython\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
  File "N:\projects\cpython\lib\idlelib\editor.py", line 644, in 
find_selection_event
search.find_selection(self.text)
  File "N:\projects\cpython\lib\idlelib\search.py", line 25, in find_selection
return _setup(text).find_selection(text)
  File "N:\projects\cpython\lib\idlelib\search.py", line 72, in find_selection
return self.find_again(text)
  File "N:\projects\cpython\lib\idlelib\search.py", line 65, in find_again
self.bell()
AttributeError: 'SearchDialog' object has no attribute 'bell'

--
assignee: terry.reedy
components: IDLE
messages: 332559
nosy: cheryl.sabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Traceback on Find Selection
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue35585] Speedup Enum lookup

2018-12-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10587

___
Python tracker 

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



[issue35585] Speedup Enum lookup

2018-12-26 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 34ae04f74dcf4ac97d07c3e82eaf8f619d80cedb by Ethan Furman (Andrew 
Svetlov) in branch 'master':
Speed-up building enums by value, e.g. http.HTTPStatus(200) (#11318)
https://github.com/python/cpython/commit/34ae04f74dcf4ac97d07c3e82eaf8f619d80cedb


--

___
Python tracker 

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



[issue35588] Speed up mod/divmod/floordiv for Fraction type

2018-12-26 Thread Stefan Behnel


Stefan Behnel  added the comment:

Thanks for your review and ideas, Serhiy. I added a couple of test cases, but 
failed to find any case where the new implementation is not much faster.

I also tried "divmod(n_div, d_div)" for implementing __divmod__(), and the 
results are mixed, e.g.

Arithmetic operators:
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'divmod(a,b)'
10 loops, best of 5: 3.11 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**15+1, 10**27+1), F(10**9-1, 10**7-1)' 'divmod(a, b)'
10 loops, best of 5: 3.48 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**350+1, 10**207+1), F(10**89-1, 10**62-1)' 'divmod(a, b)'
2 loops, best of 5: 17.7 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**89-1, 10**611-1), F(10**350+1, 10**207+1)' 'divmod(a, b)'
2 loops, best of 5: 18.2 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**350+1, 10**207+1), F(10**89-1, 10**612-1)' 'divmod(a, b)'
5000 loops, best of 5: 34.4 usec per loop

divmod():
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'divmod(a,b)'
10 loops, best of 5: 3.04 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**15+1, 10**27+1), F(10**9-1, 10**7-1)' 'divmod(a, b)'
10 loops, best of 5: 3.56 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**350+1, 10**207+1), F(10**89-1, 10**62-1)' 'divmod(a, b)'
2 loops, best of 5: 17.3 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**89-1, 10**611-1), F(10**350+1, 10**207+1)' 'divmod(a, b)'
2 loops, best of 5: 18.2 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**350+1, 10**207+1), F(10**89-1, 10**612-1)' 'divmod(a, b)'
1 loops, best of 5: 31.7 usec per loop

Current master, for comparison:
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'divmod(a,b)'
2 loops, best of 5: 14.1 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**15+1, 10**27+1), F(10**9-1, 10**7-1)' 'divmod(a, b)'
2 loops, best of 5: 16 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**350+1, 10**207+1), F(10**89-1, 10**62-1)' 'divmod(a, b)'
5000 loops, best of 5: 61.2 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**89-1, 10**611-1), F(10**350+1, 10**207+1)' 'divmod(a, b)'
5000 loops, best of 5: 65.3 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a, b = 
F(10**350+1, 10**207+1), F(10**89-1, 10**612-1)' 'divmod(a, b)'
2000 loops, best of 5: 120 usec per loop

Definitely not an obvious decision, although there is a tendency towards faster 
execution for very large numbers. Whether it's faster or slower would probably 
depend on the data and the application at hand.
I could live with either choice, but would use divmod() for now since it 
simplifies the implementation.

--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset dcf14d1a9875143747cd87c66fae6e693b21c6de by Miss Islington (bot) 
in branch '3.7':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/dcf14d1a9875143747cd87c66fae6e693b21c6de


--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset 3a81076bbf899b1a549f005dd9299e7ae0946321 by Miss Islington (bot) 
(Vaibhav Gupta) in branch 'master':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/3a81076bbf899b1a549f005dd9299e7ae0946321


--

___
Python tracker 

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



[issue35588] Speed up mod/divmod/floordiv for Fraction type

2018-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I want to check whether removing the normalization step has a negative 
performance effect larger than the time spent on normalization.

--

___
Python tracker 

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



[issue35588] Speed up mod/divmod/floordiv for Fraction type

2018-12-26 Thread Stefan Behnel


Stefan Behnel  added the comment:

Sure, I can add tests, but I wonder what kind of regression you expect. The 
algorithm is still the same as before, it's just implemented more efficiently. 
It does trade a bit of memory for the speed, though, since there is no longer 
an intermediate normalisation step, and therefore the integers can get larger 
during the calculation. Shouldn't make a big difference in practice, though. We 
are talking about bytes, not megabytes here.

--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset 3a81076bbf899b1a549f005dd9299e7ae0946321 by Miss Islington (bot) 
(Vaibhav Gupta) in branch 'master':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/3a81076bbf899b1a549f005dd9299e7ae0946321


--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset 3a81076bbf899b1a549f005dd9299e7ae0946321 by Miss Islington (bot) 
(Vaibhav Gupta) in branch 'master':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/3a81076bbf899b1a549f005dd9299e7ae0946321


--

___
Python tracker 

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



[issue34148] Fatal error on SSL transport

2018-12-26 Thread yjq


yjq  added the comment:

I'm sure that this should be a bug in python. But because I'm naive, I'm not 
sure about how to fix it. I think we can just add the exception to 
base_events._FATAL_ERROR_IGNORE.

--

___
Python tracker 

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



[issue34148] Fatal error on SSL transport

2018-12-26 Thread yjq


yjq  added the comment:

https://github.com/aio-libs/aiohttp/issues/3202#issuecomment-439644135

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset dcf14d1a9875143747cd87c66fae6e693b21c6de by Miss Islington (bot) 
in branch '3.7':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/dcf14d1a9875143747cd87c66fae6e693b21c6de


--

___
Python tracker 

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



[issue35588] Speed up mod/divmod/floordiv for Fraction type

2018-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Please make several additional tests, and ensure that there is no regression.

1. Test with fractions with the same large denominator (for example 2**50, 
2**100, 10**30, 3**50, factorial(30), or a large pseudo-primary number) and 
small and large numerators.

2. Test with fractions with the same large numerator (as above) and small and 
large denominators.

3. Test with fractions with random numerators and denominators and find worst 
cases (in which the optimization effect is the smallest or negative).

--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset dcf14d1a9875143747cd87c66fae6e693b21c6de by Miss Islington (bot) 
in branch '3.7':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/dcf14d1a9875143747cd87c66fae6e693b21c6de


--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset 3a81076bbf899b1a549f005dd9299e7ae0946321 by Miss Islington (bot) 
(Vaibhav Gupta) in branch 'master':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/3a81076bbf899b1a549f005dd9299e7ae0946321


--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset 3a81076bbf899b1a549f005dd9299e7ae0946321 by Miss Islington (bot) 
(Vaibhav Gupta) in branch 'master':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/3a81076bbf899b1a549f005dd9299e7ae0946321


--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset 3a81076bbf899b1a549f005dd9299e7ae0946321 by Miss Islington (bot) 
(Vaibhav Gupta) in branch 'master':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/3a81076bbf899b1a549f005dd9299e7ae0946321


--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset 3a81076bbf899b1a549f005dd9299e7ae0946321 by Miss Islington (bot) 
(Vaibhav Gupta) in branch 'master':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/3a81076bbf899b1a549f005dd9299e7ae0946321


--

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset dcf14d1a9875143747cd87c66fae6e693b21c6de by Miss Islington (bot) 
in branch '3.7':
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://github.com/python/cpython/commit/dcf14d1a9875143747cd87c66fae6e693b21c6de


--
nosy: +miss-islington

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10585, 10586

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10585

___
Python tracker 

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



[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict

2018-12-26 Thread Vaibhav Gupta


Vaibhav Gupta  added the comment:

Hi.
I would like to make a PR for this.
Also, I am not very familiar with the process of backporting. Is something 
specific needs to be done for that which is related to this?

--
nosy: +dojutsu-user

___
Python tracker 

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



[issue35590] logging.handlers.SysLogHandler with STREAM connects in constructor without timeout

2018-12-26 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
components: +Library (Lib)
type:  -> enhancement

___
Python tracker 

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



[issue35590] logging.handlers.SysLogHandler with STREAM connects in constructor without timeout

2018-12-26 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hi, 

If I don't see bad, if a timeout occur this is catch by the OSError exception.

--
nosy: +eamanu

___
Python tracker 

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



[issue35588] Speed up mod/divmod/floordiv for Fraction type

2018-12-26 Thread Stefan Behnel


Stefan Behnel  added the comment:

Motivation for the latter:

$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a // b'
10 loops, best of 5: 3.7 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a // 3'
10 loops, best of 5: 3.49 usec per loop

$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a // b'
50 loops, best of 5: 899 nsec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a // 3'
50 loops, best of 5: 729 nsec per loop

--
title: Speed up mod/divmod for Fraction type -> Speed up mod/divmod/floordiv 
for Fraction type

___
Python tracker 

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



[issue35588] Speed up mod/divmod for Fraction type

2018-12-26 Thread Stefan Behnel


Stefan Behnel  added the comment:

Similarly, I think "//" (__floordiv__) should be implemented using integer 
operations rather than math.floor():

(a.numerator * b.denominator) // (b.numerator * a.denominator)

Thoughts?

--

___
Python tracker 

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



[issue35590] logging.handlers.SysLogHandler with STREAM connects in constructor without timeout

2018-12-26 Thread jso2460


New submission from jso2460 :

logging.handlers.SysLogHandler in __init__ contains the following code, where 
socket is created and then connected right away. This seem to provide no way to 
specify a connection timeout for the socket being created.

sock = socket.socket(af, socktype, proto)
if socktype == socket.SOCK_STREAM:
sock.connect(sa)

I believe to add an argument to specify the optional timeout would be 
appreciated, i.e., optionally calling sock.settimeout(..), something like:

sock = socket.socket(af, socktype, proto)
if timeout:
sock.settimeout(timeout)
if socktype == socket.SOCK_STREAM:
sock.connect(sa)

--
messages: 332536
nosy: jso2460
priority: normal
severity: normal
status: open
title: logging.handlers.SysLogHandler with STREAM connects in constructor 
without timeout
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35589] BaseSelectorEventLoop.sock_sendall() performance regression: extra copy of data

2018-12-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks for the report!

--
assignee:  -> asvetlov

___
Python tracker 

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



[issue35589] BaseSelectorEventLoop.sock_sendall() performance regression: extra copy of data

2018-12-26 Thread Huazuo Gao


New submission from Huazuo Gao :

Prior to PR 10419, sock_sendall does not make a copy of the data. PR 10419 
introduced an extra copy, which may cause problem for code that send a huge 
chunk of data simultaneously to many peers. Relevant change is:

https://github.com/python/cpython/pull/10419/files#diff-2d64b02252335b37396e00e56fa66984R443

Bellow is a test that show the regression between 3.7.1 and 3.8-dev

---

import asyncio
import socket
import os
from subprocess import check_output

loop = asyncio.get_event_loop()

def mem_usage():
pid = str(os.getpid())
print(check_output(['ps', '-o', 'rss,comm'], text=True))

async def main():
data = bytearray(10*10**6)
data = memoryview(data)
tasks = []
for i in range(100):
s1, s2 = socket.socketpair()
s1.setblocking(False)
s2.setblocking(False)
tasks.append(loop.create_task(loop.sock_sendall(s1, data)))
tasks.append(loop.create_task(loop.sock_recv(s2, 1)))
await asyncio.sleep(0.1)
mem_usage()
for t in tasks:
t.cancel()
await asyncio.wait(tasks)

loop.run_until_complete(main())

---

result

3.7.1: 24724
3.8-dev: 979184

--
components: asyncio
messages: 332534
nosy: Huazuo Gao, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: BaseSelectorEventLoop.sock_sendall() performance regression: extra copy 
of data
type: resource usage
versions: Python 3.8

___
Python tracker 

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



[issue35588] Speed up mod/divmod for Fraction type

2018-12-26 Thread Stefan Behnel


Change by Stefan Behnel :


--
nosy: +mark.dickinson, serhiy.storchaka

___
Python tracker 

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



[issue35588] Speed up mod/divmod for Fraction type

2018-12-26 Thread Stefan Behnel


Change by Stefan Behnel :


--
keywords: +patch, patch, patch
pull_requests: +10582, 10583, 10584
stage:  -> patch review

___
Python tracker 

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



[issue35588] Speed up mod/divmod for Fraction type

2018-12-26 Thread Stefan Behnel


Change by Stefan Behnel :


--
keywords: +patch, patch
pull_requests: +10582, 10583
stage:  -> patch review

___
Python tracker 

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



[issue35588] Speed up mod/divmod for Fraction type

2018-12-26 Thread Stefan Behnel


Change by Stefan Behnel :


--
keywords: +patch
pull_requests: +10582
stage:  -> patch review

___
Python tracker 

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



[issue35588] Speed up mod/divmod for Fraction type

2018-12-26 Thread Stefan Behnel


New submission from Stefan Behnel :

Spelling out the numerator/denominator calculation in the __mod__ special 
method, and actually implementing __divmod__, speeds up both operations by 
2-3x. This is due to avoiding repeated Fraction instantiation and 
normalisation, as well as less arithmetic operations.

$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a%b'
5 loops, best of 5: 9.53 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a%3'
5 loops, best of 5: 6.61 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'divmod(a, b)'
2 loops, best of 5: 14.1 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'divmod(a, 3)'
2 loops, best of 5: 10.2 usec per loop

$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a%b'  
10 loops, best of 5: 2.96 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a%3'
10 loops, best of 5: 2.78 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'divmod(a, b)'
10 loops, best of 5: 3.93 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'divmod(a, 3)'
5 loops, best of 5: 3.82 usec per loop

--
components: Library (Lib)
messages: 332533
nosy: scoder
priority: normal
severity: normal
status: open
title: Speed up mod/divmod for Fraction type
type: performance
versions: Python 3.8

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread Vaibhav Gupta


Change by Vaibhav Gupta :


--
keywords: +patch, patch, patch, patch
pull_requests: +10578, 10579, 10580, 10581
stage:  -> patch review

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread Vaibhav Gupta


Change by Vaibhav Gupta :


--
keywords: +patch, patch, patch
pull_requests: +10578, 10579, 10580
stage:  -> patch review

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread Vaibhav Gupta


Change by Vaibhav Gupta :


--
keywords: +patch, patch
pull_requests: +10578, 10579
stage:  -> patch review

___
Python tracker 

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



[issue35579] Typo in in asyncio-task documentation

2018-12-26 Thread Vaibhav Gupta


Change by Vaibhav Gupta :


--
keywords: +patch
pull_requests: +10578
stage:  -> patch review

___
Python tracker 

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