[issue25943] Integer overflow in _bsddb leads to heap corruption

2018-07-18 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +7871
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



[issue34147] doc Describe briefly sampling w/out replacement in random

2018-07-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

IMO, this is unnecessary documentation cruft.  I'm concerned that you're 
continuing to spew lots of minor documentation PRs of dubious value and wasting 
our time.  Please direct your efforts to known areas where users have actually 
had a problem with the documentation.

--
nosy: +rhettinger
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



[issue34151] use malloc() for better performance of some list operations

2018-07-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 This looks like a reasonable improvement.

--
nosy: +rhettinger

___
Python tracker 

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



[issue34152] performance of some list slice assignment margin cases can be improved

2018-07-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I recommend against this one.  The cases covered are too exotic to care about 
and don't warrant the code churn.

--
nosy: +rhettinger

___
Python tracker 

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



[issue34149] Behavior of the min/max with key=None

2018-07-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Whouldn't be better to add operator.identity and use it as the default value 
instead of None?

--

___
Python tracker 

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



[issue34149] Behavior of the min/max with key=None

2018-07-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+0 Probably users will never care about this but I don't see a downside beyond 
the small API churn.

--

___
Python tracker 

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



[issue34152] performance of some list slice assignment margin cases can be improved

2018-07-18 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


--
title: performance of some list slice assignment can be improved -> performance 
of some list slice assignment margin cases can be improved

___
Python tracker 

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



[issue34154] Tkinter __init__ documentations sometimes missing valid keyword values

2018-07-18 Thread Creation Elemental


New submission from Creation Elemental :

Priority: Low
Type: Documentation issue

Some of the Tkinter documentation is incomplete. I've only checked it on the 
Listbox so far, but some of the valid keyword arguments are missing. The one I 
noticed was "disabledforeground" which changes how the foreground color of text 
when the Listbox is in the disabled state or has a selection mode of none. I've 
noticed this across multiple versions of python, including Python 2.7 and 
Python 3.6, both of which accepted "disabledforeground" as a valid keyword 
without it being in the list shown in the help for Listbox.__init__

I found the disabledforeground keyword argument when looking at the Listbox 
documentation here: https://www.tcl.tk/man/tcl8.4/TkCmd/listbox.htm

--
components: Tkinter
messages: 321921
nosy: Creation Elemental
priority: normal
severity: normal
status: open
title: Tkinter __init__ documentations sometimes missing valid keyword values
versions: Python 2.7, Python 3.6

___
Python tracker 

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



[issue34138] imaplib RFC 6855 issue

2018-07-18 Thread Sam Varshavchik


Sam Varshavchik  added the comment:

I don't have sufficient python or imaplib exposure to be able to implement full 
UTF8 APPEND functionality. I was merely investigating and researching what IMAP 
UTF8 support there was, in all existing client and server code I knew of.

What I can propose is to reverse this part of the original change:

@@ -360,7 +380,10 @@
 date_time = Time2Internaldate(date_time)
 else:
 date_time = None
-self.literal = MapCRLF.sub(CRLF, message)
+literal = MapCRLF.sub(CRLF, message)
+if self.utf8_enabled:
+literal = b'UTF8 (' + literal + b')'
+self.literal = literal
 return self._simple_command(name, mailbox, flags, date_time)

I don't see that the original patch added any code to test_imaplib.py to test 
UTF8 literals with APPEND. So what this should do is, is go back and use the 
pre-UTF8, RFC 3501 APPEND syntax, with no existing unit test fall-out.

Which is fine. IMAP UTF8 clients are not required to use UTF8 literals with 
APPEND. Enabling UTF8 in the IMAP server does not require using the UTF8 
version of APPEND. It's only required if the IMAP client wishes to send a 
message with UTF8 headers to the IMAP server.

I also looked into mutt's source, and mutt appears to be taking the same 
approach. It enables UTF8 mode in the IMAP server, and swallows UTF8 E-mail, 
and deals with folders whose names are now encoded in UTF8, instead of RFC3501 
IMAP's modified-UTF7 encoding convention. But I did not see anything in mutt 
that used UTF8 literals with APPEND. Searching mutt's source for APPEND code 
finds only one instance which sends the non-UTF8 literal. Looks like mutt will 
accept UTF8 mail, but not generate them itself. Not sure what mutt does 
creating a reply to E-mail with a UTF8 E-mail address. I don't use mutt, but 
I'll test that.

It does not surprise me, that this did not come up previously. All three other 
Libre IMAP server that I know of: UW-IMAP, Cyrus, and Dovecot, do not implement 
RFC 6855. Unless one of them is currently working on it, Courier will be the 
first one to support it. But, I have other sources that confirm otherwise.

I fully understand your lack of interest in imaplib (I really do), and I wish I 
had more Python background to help out here, myself. This is as much as I can 
propose right now, with some level of confidence in my meager Python skills. I 
mostly revolve in C++, C, and Perl orbits.

If in the future more interest develops in improving IMAP support, I'm 
reachable and I'll be open to integration testing as much as my own time 
permits, in these matters...

--

___
Python tracker 

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



[issue11191] test_search_cpp error on AIX (with xlc)

2018-07-18 Thread Michael Felt


Michael Felt  added the comment:

@tarek - anything specific/extra you need?

--

___
Python tracker 

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



[issue27643] test_ctypes fails on AIX with xlc

2018-07-18 Thread Michael Felt


Michael Felt  added the comment:

Again, the PR worked months ago. I expect it to still work.

So, I guess the question is: is there any interest. After several weeks of 
waiting after the last ttt - still waiting :)

--
components: +Tests -ctypes

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

Thank you Michael Felt for your big "Implement find_library() support in 
ctypes/util for AIX" contribution, commit 
c5ae169e1b73315672770517bf51cf8464286c76!

I close the issue.

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2018-07-18 Thread Michael Felt


Michael Felt  added the comment:

imho - this should have status "closed"

--

___
Python tracker 

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



[issue34137] Add Path.lexist() to pathlib

2018-07-18 Thread Engin Kayraklioglu


Engin Kayraklioglu  added the comment:

Thanks for the response Brett! I am not going to rush, then. But if I happen to 
have some free time and motivation to create the PR, I will just do it. I don't 
mind revising or getting rejected.

--

___
Python tracker 

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



[issue34151] use malloc() for better performance of some list operations

2018-07-18 Thread Stefan Behnel


Stefan Behnel  added the comment:

Nice! Patch looks good to me, minus the usual naming nit-pick.

--
nosy: +scoder
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



[issue34137] Add Path.lexist() to pathlib

2018-07-18 Thread Brett Cannon


Brett Cannon  added the comment:

If you're okay with the PR being rejected because the decision is the method 
isn't desired, then feel free to go ahead and create a PR, Engin! But if you 
want to a better chance that it will eventually go in then I would wait for 
consensus.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

PR 8287 seems short to me and it seems like psutils doesn't expose Processor 
Queue Length, so I'm not sure why we are talking about depending on psutils?

--

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

Processor Queue Length seems simpler and easier to read. I don't want to log 24 
numbers per regrtest output line if a machine has 24 CPUs... The load average 
is a "raw" value to give the idea if the system is "loaded" or not. More 
precise metrics can be used later to debug a test failure, but manually.

--

___
Python tracker 

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



[issue34153] 10/3 - last digit

2018-07-18 Thread Paul Moore


Paul Moore  added the comment:

See https://docs.python.org/3.7/tutorial/floatingpoint.html. Essentially, the 
behaviour you are seeing is caused by the fact that the results calculations 
you are attempting cannot be exactly represented in binary floating point, so 
approximate results are shown.

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



[issue34153] 10/3 - last digit

2018-07-18 Thread wassersteinchen


New submission from wassersteinchen :

Hi,
I am new to python and just installed it on my win pc.
First thing what I did were some calculations (see below).
There is a failure in th last digit at 10/3 and 100/3.
Sorry if this is a RTFM-issue...
armin


Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit 
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 3+6
9
>>> 10/3
3.3335
>>> 1/3
0.
>>> 10/3
3.3335
>>> 100/3
33.336
>>> 1000/3
333.3
>>> 1/3
.5
>>> 10/3
3.3336
>>> 100/3
33.33
>>> 200/3
66.67

--
components: Windows
messages: 321909
nosy: paul.moore, steve.dower, tim.golden, wassersteinchen, zach.ware
priority: normal
severity: normal
status: open
title: 10/3 - last digit
versions: Python 3.7

___
Python tracker 

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



[issue34152] performance of some list slice assignment can be improved

2018-07-18 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


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

___
Python tracker 

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



[issue34152] performance of some list slice assignment can be improved

2018-07-18 Thread Sergey Fedoseev


New submission from Sergey Fedoseev :

Script for benchmarks:

NAME=list-slice.json

python -m perf timeit --name "l[len(l):] = reversed(l)" -l 1 -s "l = [None] * 
100" "l[len(l):] = reversed(l)" --append $NAME
python -m perf timeit --name "l[len(l):] = l" -l 1 -s "l = [None] * 100" 
"l[len(l):] = l" --append $NAME
python -m perf timeit --name "l[::-1] = l" -s "l = [None] * 100" "l[::-1] = 
l" --append $NAME
python -m perf timeit --name "l[:] = l" -s "l = [None] * 100" "l[:] = l" 
--append $NAME
python -m perf timeit --name "l[len(l)//2:] = l" -l 1 -s "l = [None] * 100" 
"l[len(l)//2:] = l"  --append $NAME
python -m perf timeit --name "l[:len(l)//2] = l" -l 1 -s "l = [None] * 100" 
"l[:len(l)//2] = l" --append $NAME
python -m perf timeit --name "l[len(l)//4:len(l)*3//4] = l" -l 1 -s "l = [None] 
* 100" "l[len(l)//4:len(l)*3//4] = l" --append $NAME

Results table:

+--+---++
| Benchmark| list-slice-master | list-slice 
|
+==+===++
| l[len(l):] = reversed(l) | 8.44 ms   | 5.18 ms: 1.63x faster 
(-39%)   |
+--+---++
| l[len(l):] = l   | 7.88 ms   | 3.37 ms: 2.34x faster 
(-57%)   |
+--+---++
| l[::-1] = l  | 10.4 ms   | 582 us: 17.85x faster 
(-94%)   |
+--+---++
| l[:] = l | 10.6 ms   | 86.1 ns: 123128.46x faster 
(-100%) |
+--+---++
| l[len(l)//2:] = l| 11.1 ms   | 2.08 ms: 5.33x faster 
(-81%)   |
+--+---++
| l[:len(l)//2] = l| 11.5 ms   | 1.76 ms: 6.53x faster 
(-85%)   |
+--+---++
| l[len(l)//4:len(l)*3//4] = l | 11.3 ms   | 2.27 ms: 4.98x faster 
(-80%)   |
+--+---++

--
components: Interpreter Core
messages: 321908
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: performance of some list slice assignment can be improved
type: performance

___
Python tracker 

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



[issue34149] Behavior of the min/max with key=None

2018-07-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Accepting None has a drawback. It can hide a bug when the key function 
unexpectedly becomes None.

--
nosy: +bethard, rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue34151] use malloc() for better performance of some list operations

2018-07-18 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


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

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-18 Thread Steve Dower


Steve Dower  added the comment:

> It would probably be simpler to change the policy and allow (at least some) 
> some third party libs in cPython's test suite. =)

I'm actually totally okay with this, as I'd really like to have JUnit XML 
output from the test suite, which is easiest to do with the existing 
third-party libraries.

Can we formalize a way by which optional third-party libraries are allowed? 
Provided they aren't critical for the overall pass/fail state of the test suite 
(or the more strict alternative: pass/fail state of *each* test), I don't see 
any particular harm in certain site packages being used.

(This is probably a discussion for python-dev, assuming the policy is written 
down somewhere.)

--

___
Python tracker 

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



[issue34151] use malloc() for better performance of some list operations

2018-07-18 Thread Sergey Fedoseev


New submission from Sergey Fedoseev :

Currently list concatenation, slicing and repeating operations are using 
PyList_New() which allocates memory for the items by calloc(). malloc() could 
be used instead, since the allocated memory is overwritten by mentioned 
operations.

I made benchmarks with this script:

NAME=list-malloc-master.json

python -m perf timeit --name slice0 -s "l = [None]*100" "l[:0]" 
--duplicate=2048 --append $NAME
python -m perf timeit --name slice1 -s "l = [None]*100" "l[:1]" 
--duplicate=1024 --append $NAME
python -m perf timeit --name slice2 -s "l = [None]*100" "l[:2]" 
--duplicate=1024 --append $NAME
python -m perf timeit --name slice3 -s "l = [None]*100" "l[:3]" 
--duplicate=1024 --append $NAME
python -m perf timeit --name slice100 -s "l = [None]*100" "l[:100]" 
--append $NAME

python -m perf timeit --name cat0 -s "l = [None]*0" "l + l" --duplicate=1024 
--append $NAME
python -m perf timeit --name cat1 -s "l = [None]*1" "l * 1" --duplicate=1024 
--append $NAME
python -m perf timeit --name cat2 -s "l = [None]*2" "l * 1" --duplicate=1024 
--append $NAME
python -m perf timeit --name cat3 -s "l = [None]*3" "l * 1" --duplicate=1024 
--append $NAME
python -m perf timeit --name cat100 -s "l = [None]*100" "l * 1" 
--append $NAME

python -m perf timeit --name 1x0 -s "l = [None]" "l * 0" --duplicate=1024 
--append $NAME
python -m perf timeit --name 1x1 -s "l = [None]" "l * 1" --duplicate=1024 
--append $NAME
python -m perf timeit --name 1x2 -s "l = [None]" "l * 2" --duplicate=1024 
--append $NAME
python -m perf timeit --name 1x3 -s "l = [None]" "l * 3" --duplicate=1024 
--append $NAME
python -m perf timeit --name 1x100 -s "l = [None]" "l * 100" --append 
$NAME 


Here's comparison table:

+--++--+
| Benchmark| list-malloc-master | list-malloc  |
+==++==+
| slice1   | 84.5 ns| 59.6 ns: 1.42x faster (-30%) |
+--++--+
| slice2   | 71.6 ns| 61.8 ns: 1.16x faster (-14%) |
+--++--+
| slice3   | 74.4 ns| 63.6 ns: 1.17x faster (-15%) |
+--++--+
| slice100 | 4.39 ms| 4.08 ms: 1.08x faster (-7%)  |
+--++--+
| cat0 | 23.9 ns| 24.9 ns: 1.04x slower (+4%)  |
+--++--+
| cat1 | 73.2 ns| 51.9 ns: 1.41x faster (-29%) |
+--++--+
| cat2 | 61.6 ns| 53.1 ns: 1.16x faster (-14%) |
+--++--+
| cat3 | 63.0 ns| 54.3 ns: 1.16x faster (-14%) |
+--++--+
| cat100   | 4.38 ms| 4.08 ms: 1.07x faster (-7%)  |
+--++--+
| 1x0  | 27.1 ns| 27.7 ns: 1.02x slower (+2%)  |
+--++--+
| 1x1  | 72.9 ns| 51.9 ns: 1.41x faster (-29%) |
+--++--+
| 1x2  | 60.9 ns| 52.9 ns: 1.15x faster (-13%) |
+--++--+
| 1x3  | 62.5 ns| 54.8 ns: 1.14x faster (-12%) |
+--++--+
| 1x100| 2.67 ms| 2.34 ms: 1.14x faster (-12%) |
+--++--+

Not significant (1): slice0

--
components: Interpreter Core
messages: 321905
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: use malloc() for better performance of some list operations
type: performance

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-18 Thread Ammar Askar


Ammar Askar  added the comment:

> But then again, if it's solely for our tests, perhaps the best way to 
> approach this is to start a Python thread that periodically runs this command?

This sounds like a very good solution to me, it avoids adding the complexity of 
the C code. We actually have two options here, to keep the results consistent 
with the unix load, we can use `typeperf "\System\Processor Queue Length"`

To get cpu usage, we can use the command Victor posted. I'll make an 
alternative PR with that today just so we can contrast the two approaches.

--

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-18 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

psutil exposes this functionality as "psutil.cpu_percent()":

https://github.com/giampaolo/psutil/blob/ac9dccab6b038835b5d612f92cf4804ec2662c2e/psutil/_psutil_windows.c#L992

https://github.com/giampaolo/psutil/blob/ac9dccab6b038835b5d612f92cf4804ec2662c2e/psutil/__init__.py#L1675

I'm not sure if it's worth it to copy all that stuff into Modules/_winapi.c and 
test/libregrtest/main.py though. It would probably be simpler to change the 
policy and allow (at least some) some third party libs in cPython's test suite. 
=)

--

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

> I also haven't seen it suggested, but perhaps GetProcessTimes 
> (https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getprocesstimes)
>  (or GetThreadTimes) would provide enough information to detect the same 
> information?

My intent is to get an idea if the whole system is busy. Not if the current 
Python process is busy. Most buildbots run tests with multiple worker processes 
(at least 2).

--

___
Python tracker 

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



[issue32692] [3.6] test_threading.test_set_and_clear fails in AppVeyor CI

2018-07-18 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue32692] [3.6] test_threading.test_set_and_clear fails in AppVeyor CI

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

The test rely on time. Using smaller timeouts, I'm able to reproduce the bug on 
Linux as well.

--

___
Python tracker 

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



[issue33808] ssl.get_server_certificate fails with openssl 1.1.0 but works with 1.0.2g for self-signed certificate

2018-07-18 Thread Alan Huang


Alan Huang  added the comment:

This is an issue of cipher support, not a Python bug.

mail.mani.pt supports the following (outdated) ciphers:
RC4-SHA (0x05)
RC4-MD5 (0x04)
DES-CBC3-SHA (0x0a)
EXP1024-DES-CBC-SHA (0x62)
DES-CBC-SHA (0x09)
EXP1024-RC4-SHA (0x64)
EXP-RC2-CBC-MD5 (0x06)
EXP-RC4-MD5 (0x03)

OpenSSL 1.0.2k supports RC4-SHA, RC4-MD5, and DES-CBC3-SHA.
OpenSSL 1.1.0g supports none of the above ciphers.

As such, OpenSSL 1.1.0 cannot negotiate a shared cipher suite, but OpenSSL 
1.0.2g can.

Update your mailserver to use modern cipher suites and protocols.

--
nosy: +Alan.Huang

___
Python tracker 

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



[issue32692] [3.6] test_threading.test_set_and_clear fails in AppVeyor CI

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.7 and master are likely impacted as well since Lib/test/lock_tests.py 
is the same file in 3.6, 3.7 and master branches.

--
versions: +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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, test_signal should now be more reliable on Windows in 3.6, 3.7 and master 
branches.

If test_signal.test_warn_on_full_buffer() fails again, we should just increase 
the timeout of 50 ms to 100 ms or more.

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e13180bc4c40a9ac300590c62a6efbcaf10ae6df by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-34130: Fix test_signal.test_socket() (GH-8326) (GH-8330)
https://github.com/python/cpython/commit/e13180bc4c40a9ac300590c62a6efbcaf10ae6df


--

___
Python tracker 

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



[issue32692] test_threading.test_set_and_clear fails in AppVeyor CI

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

Another failure on Python 3.6 on my PR 8330:

https://ci.appveyor.com/project/python/cpython/build/3.6build19434/job/n24xudh8egp8i78j

==
FAIL: test_set_and_clear (test.test_threading.EventTests)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\lock_tests.py", line 417, in 
test_set_and_clear
self.assertEqual(results, [True] * N)
AssertionError: Lists differ: [False, False, False, True, True] != [True, True, 
True, True, True]
First differing element 0:
False
True
- [False, False, False, True, True]
+ [True, True, True, True, True]
--

--

___
Python tracker 

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



[issue32692] [3.6] test_threading.test_set_and_clear fails in AppVeyor CI

2018-07-18 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_threading.test_set_and_clear fails in AppVeyor CI -> [3.6] 
test_threading.test_set_and_clear fails in AppVeyor CI

___
Python tracker 

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



[issue34150] test_multiprocessing_spawn: Dangling processes leaked on AMD64 FreeBSD 10.x Shared 3.x

2018-07-18 Thread STINNER Victor


New submission from STINNER Victor :

https://buildbot.python.org/all/#/builders/87/builds/1175

0:07:52 load avg: 4.38 [369/417/1] test_multiprocessing_spawn failed (env 
changed) (2 min 43 sec) -- running: test_lib2to3 (1 min 11 sec), test_tools (2 
min 4 sec)
(...)
test_lock (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok
test_lock_context (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok
test_rlock (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok
test_enable_logging (test.test_multiprocessing_spawn.WithProcessesTestLogging) 
... ok
test_level (test.test_multiprocessing_spawn.WithProcessesTestLogging) ... ok
test_rapid_restart 
(test.test_multiprocessing_spawn.WithProcessesTestManagerRestart) ... ok
Warning -- Dangling processes: {}
test_access 
(test.test_multiprocessing_spawn.WithProcessesTestPicklingConnections) ... ok
test_pickling 
(test.test_multiprocessing_spawn.WithProcessesTestPicklingConnections) ... ok
test_boundaries (test.test_multiprocessing_spawn.WithProcessesTestPoll) ... ok
test_dont_merge (test.test_multiprocessing_spawn.WithProcessesTestPoll) ... ok
(...)
1 test altered the execution environment:
test_multiprocessing_spawn
(...)
Tests result: ENV CHANGED

--
components: Tests
messages: 321895
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn: Dangling processes leaked on AMD64 FreeBSD 
10.x Shared 3.x
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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 296e5720921f1837dfd09a16457ac5bba7cb1676 by Victor Stinner in 
branch '3.7':
[3.7] bpo-34130: Fix 2 race conditions in test_signal (GH-8329)
https://github.com/python/cpython/commit/296e5720921f1837dfd09a16457ac5bba7cb1676


--

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

Python 2.7 is not impacted: it doesn't have test_socket() nor 
test_warn_on_full_buffer() tests in test_signal.

Python 3.6 only has test_socket() in test_signal.

--
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7867

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7866

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 686b4b5ff219ed66714f3b811815776dafadc23b by Victor Stinner in 
branch 'master':
bpo-34130: Fix test_signal.test_warn_on_full_buffer() (GH-8327)
https://github.com/python/cpython/commit/686b4b5ff219ed66714f3b811815776dafadc23b


--

___
Python tracker 

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



[issue34149] Behavior of the min/max with key=None

2018-07-18 Thread Alexander Marshalov


Change by Alexander Marshalov <_...@marshalov.org>:


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

___
Python tracker 

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



[issue34149] Behavior of the min/max with key=None

2018-07-18 Thread Alexander Marshalov


New submission from Alexander Marshalov <_...@marshalov.org>:

I was faced with the fact that the behavior of the functions "min"/"max" and 
"sorted" is a little different.

For example, this code works fine:

>>> sorted([3, 2, 1], key=None)
[1, 2, 3]

But the same example for "min" and "max" doesn't work:

>>> min([3, 2, 1], key=None)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'NoneType' object is not callable

That is why the heapq library has this code:

...
def nsmallest(n, iterable, key=None):
...
if key is None:
result = min(it, default=sentinel)
else:
result = min(it, default=sentinel, key=key)
...

At the same time, there are many places where such checks are not performed for 
the "sorted" function. I think the behavior of the "min" / "max" / "sorted" 
functions should be unified. That is, they should work as if "None" is the 
default value for "key".

--
messages: 321891
nosy: amper
priority: normal
severity: normal
status: open
title: Behavior of the min/max with key=None
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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 99bb6df66a42625367c4f38e6802c8bb527baf4a by Victor Stinner in 
branch 'master':
bpo-34130: Fix test_signal.test_socket() (GH-8326)
https://github.com/python/cpython/commit/99bb6df66a42625367c4f38e6802c8bb527baf4a


--

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

I tried to modify the test_warn_on_full_buffer() code filling the socketpair 
buffer:

* iterate on multiple chunk sizes: 2**16, 2**10, 2**5, 1 bytes
* first try in non-blocking mode then retry with a timeout of 100 ms
* I also tried to play with SO_SNDBUF and SO_RCVBUF socket options

The problem is that I failed to fail a reliable way to fill the socketpair 
buffer.

I will stick with Nathaniel's very simple idea: retry once if the test fails. I 
implemented exactly this idea in my PR 8327 (with additional minor changes to 
enhance the test).

--

___
Python tracker 

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



[issue34138] imaplib RFC 6855 issue

2018-07-18 Thread R. David Murray


R. David Murray  added the comment:

Maybe we'll be luck and Maciej will still be interested :)

--
nosy: +maciej.szulik

___
Python tracker 

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



[issue34138] imaplib RFC 6855 issue

2018-07-18 Thread R. David Murray


R. David Murray  added the comment:

Would you care to propose a patch?  That's likely the only way this is going to 
get fixed, unfortunately, as currently we have no one on the core team 
interested in imaplib.  Which means it is also going to be hard to come up with 
someone to do the review (I'm the most likely candidate and have a distinct 
lack of time currently), but we'll deal with that when we get that far.

--
title: RFC 6855 issue -> imaplib RFC 6855 issue

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7863

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-18 Thread Steve Dower


Steve Dower  added the comment:

> wmic cpu ...

This is the WMI solution we are trying to avoid.

But then again, if it's solely for our tests, perhaps the best way to approach 
this is to start a Python thread that periodically runs this command?

I also haven't seen it suggested, but perhaps GetProcessTimes 
(https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getprocesstimes)
 (or GetThreadTimes) would provide enough information to detect the same 
information?

--

___
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-07-18 Thread yjq


Change by yjq :


--
nosy:  -asvetlov, yselivanov

___
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-07-18 Thread yjq


yjq  added the comment:

More information:
https://github.com/omz/Pythonista-Issues/issues/555

--

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote a simple fix for test_signal.test_socket(): PR 8326.

Just configure the read end of the socket pair as blocking, so read.recv(1) 
blocks until we get the signal handler.

This fix is simple and should be more portable than my previous attempt of 
workaround:

write.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 0)

--

___
Python tracker 

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



[issue30480] samefile and sameopenfile fail for WebDAV mapped drives

2018-07-18 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


Change by STINNER Victor :


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

___
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-07-18 Thread yjq


New submission from yjq :

Fatal read error on socket transport
protocol: 
transport: <_SelectorSocketTransport fd=47 read=polling write=>
Traceback (most recent call last):
File 
"/var/containers/Bundle/Application/9F565D30-C54B-4210-902B-874D7A5AB814/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/selector_events.py",
 line 725, in _read_ready
data = self._sock.recv(self.max_size)
TimeoutError: [Errno 60] Operation timed out

--
components: asyncio
messages: 321883
nosy: asvetlov, yjqiang, yselivanov
priority: normal
severity: normal
status: open
title: Fatal error on SSL transport
type: behavior
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



[issue34147] doc Describe briefly sampling w/out replacement in random

2018-07-18 Thread Andrés Delfino

Change by Andrés Delfino :


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

___
Python tracker 

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



[issue34147] doc Describe briefly sampling w/out replacement in random

2018-07-18 Thread Andrés Delfino

New submission from Andrés Delfino :

I think a short footnote explaining these terms could be useful to those 
without statistics knowledge.

--
assignee: docs@python
components: Documentation
messages: 321882
nosy: adelfino, docs@python
priority: normal
severity: normal
status: open
title: doc Describe briefly sampling w/out replacement in random
type: enhancement
versions: Python 2.7, 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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

I modified test_warn_on_full_buffer() to fill the socket pair using chunks of 
64 KiB instead of sending b'x' byte per byte, just to make the test faster.

Using two terminals, I ran "python -m test test_signal -m 
test_warn_on_full_buffer -F": I reproduced the bug in 2 minutes.

Ok. The problem is in that is that the code responsible to full the socketpair 
is not reliable. *Sometimes*, send() blocks, whereas if I retry *immediately*, 
the send() complete (the socketpair is not full).

The issue seems to be related to the test_socket() failure where send() is 
"asynchronous".

--

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

I ran "python -m test test_signal -v -F" 4 times in parallel (in 4 terminals), 
and I reproduced test_warn_on_full_buffer() failure after one hour: 2 terminals 
got the failures (the 2 others are still running).

I ran this test using "write.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 
0)" fix on test_socket().

--

___
Python tracker 

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



[issue16512] imghdr doesn't recognize variant jpeg formats

2018-07-18 Thread Govind Vijay


Change by Govind Vijay :


--
pull_requests: +7860
stage: test needed -> patch review

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

I found two different articles on microsoft.com which confirms that SO_SNDBUF=0 
is valid and is intended to completely disable kernel buffering:
* 
https://support.microsoft.com/en-gb/help/181611/socket-overlapped-i-o-versus-blocking-nonblocking-mode
* 
https://blogs.msdn.microsoft.com/larryosterman/2004/08/06/the-consequences-of-ignoring-nagling-and-delayed-acks/

"If SO_SNDBUF=0, each send() or WriteFile() must wait for an acknowledgement 
from the other side before returning. (That is the only way for the protocol to 
implement retransmissions)"

--

___
Python tracker 

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



[issue34146] PyCData_Type.tp_hash doesn't use PyObject_HashNotImplemented

2018-07-18 Thread Dan Snider


New submission from Dan Snider :

So not only does the function it does use (`PyCData_nohash`) prevent 
PyType_Ready from setting _ctypes._SimpleCData.__dict__["__hash__"] to `None`, 
(contrary to to every other unhashable type in the standard library) but the 
error message it returns is less detailed.

It seems like a big deal if this were to be changed as it could break backwards 
compatibility so I won't open PR myself as I'm still not that familiar with the 
contribution process.

--
components: ctypes
messages: 321878
nosy: bup
priority: normal
severity: normal
status: open
title: PyCData_Type.tp_hash doesn't use PyObject_HashNotImplemented
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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

Using "write.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 0)", I ran a 
stress test on test_socket() in 3 different terminals and I failed to reproduce 
the bug, whereas the same test (in 3 terminals) usually reproduces the bug in 
less than 30 seconds.

Using "write.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1)", I still 
reproduce the bug.

It seems like Windows behaves differently with SO_SNDBUF=0 as if the socket has 
really no kernel buffer and so respects user preference for SO_SNDBUF=0 ;-)

--

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I found a test written by Nathaniel in trio source code and he wrote that 
"if SNDBUF = 0 freezes, so that's useless" :-)

https://github.com/python-trio/trio/blob/master/notes-to-self/socketpair-buffering.py

--

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

Note: socket.socketpair() has been implemented for Windows in pure Python in 
Python 3.5: bpo-18643.

--

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

> write.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 0)

Instead of that, I also tried:

read.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
write.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

But I'm able to reproduce the bug with TCP_NODELAY=1 on the write end. (The 
option should have no impact on the read end, but I added it anyway, just in 
case, I still reproduce the bug.)

MSDN documentation for TCP_NODELAY:

"Disables the Nagle algorithm for send coalescing.This socket option is 
included for backward compatibility with Windows Sockets 1.1 "

https://docs.microsoft.com/en-us/windows/desktop/api/winsock/nf-winsock-setsockopt

--
nosy: +yselivanov

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

On Windows 10, when I run "python -m test test_signal -v -F" in 3 terminals in 
parallel, sometimes test_socket() fails.

I debugged test_socket() and I validated that the C signal handler called 
send() and that the signal byte (signal number) has been sent properly (send() 
returns 1) when the bug occurs. I added an internal "static size_t written = 
0;" variable which is incremented when send() succeed and I added a 
signal.get_written() method to get the value after read.recv(1) fails in the 
unit test. But recv() fails with BlockingIOError, as if the single byte has not 
be transfered from the write end to the read end of the TCP socket pair.

On Windows, a socket pair is a pair of two TCP sockets connected on the local 
link (IPv4 127.0.0.1). It's not a UNIX socket as on Linux.

Questions.

(*) Is the socket pair properly connected when the bug occurs? 
socket.socketpair() sets the socket as non-blocking to call connect() and 
ignores when connect() fails with BlockingIOError or InterruptedError (EINTR). 
I modified the Windows implementation of socketpair() (in socket.py) to use a 
blocking call and the bug occurs even if connect() is made in blocking mode. I 
also checked that csock.getpeername() == lsock.getsockname(). So the socket is 
connected.

(*) Does the socket pair use buffering somewhere? Both socekts are set to 
non-blocking mode by test_signal.test_socket(). By default, SO_SNDBUF is 64 KiB 
(65 536 bytes) for the write end of the socket pair, and SO_RCVBUF is 64 KiB 
(65 536 bytes) for the read end of the socket pair.

It *seems* like adding the following call to test_socket() works around the bug:

write.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 0)

I'm not sure if it's "correct" to use SO_SNDBUF=0. I'm not sure that 
SO_SNDBUF=0 really *fix* the bug: it's a race condition, so it's hard to check 
if it's really fixed or not.

--

___
Python tracker 

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



[issue34134] multiprocessing memory huge usage

2018-07-18 Thread Windson Yang


Change by Windson Yang :


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

___
Python tracker 

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



[issue26543] [EASY] imaplib noop Debug: bytes vs Unicode bug in debug mode

2018-07-18 Thread Govind Vijay


Change by Govind Vijay :


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



[issue34143] There is a constant definition error in errno.py

2018-07-18 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Please ignore about how it's generated. I tried `errno.errorcode` and can get 
the dictionary as in the picture with 
https://docs.python.org/3.8/library/errno.html#errno.errorcode. I think this 
has to be used as below and also would like to know how other error names have 
the correct numeric value except for the EDEADLK and EAGAIN which is generated 
at Modules/errnomodule.c . Using them with `os.strerror` also gets me the 
correct information 

➜  cpython git:(master) ✗ rlwrap ./python
Python 3.8.0a0 (heads/master:35c0809, Jul 16 2018, 10:29:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.strerror(35)
'Resource deadlock avoided'
>>> os.strerror(11)
'Resource temporarily unavailable'

Thanks

--

___
Python tracker 

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



[issue34143] There is a constant definition error in errno.py

2018-07-18 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Can you please add some info on how the errorcode dictionary is generated as 
shown in the picture along with your OS, system information? They seem to have 
the right values as per the Linux error codes in my Ubuntu box. I might be 
wrong on the OS on which this happens since you have mentioned it's the 
opposite of Linux.

cpython git:(master) ✗ rlwrap ./python
Python 3.8.0a0 (heads/master:35c0809, Jul 16 2018, 10:29:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import errno
>>> errno.EDEADLK
35
>>> errno.EAGAIN
11

➜  cpython git:(master) ✗ rlwrap python2.7
Python 2.7.12 (default, Dec  4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import errno
>>> errno.EDEADLK
35
>>> errno.EAGAIN
11

Machine details and values in header files as below

➜  cpython git:(master) ✗ rg 'EDEADLK|EAGAIN' 
/usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h

/usr/include/asm-generic/errno-base.h
14:#define  EAGAIN  11  /* Try again */

/usr/include/asm-generic/errno.h
6:#define   EDEADLK 35  /* Resource deadlock would occur */

➜  cpython git:(master) ✗ uname -a
Linux ubuntu-s-1vcpu-1gb-blr1-01 4.4.0-127-generic #153-Ubuntu SMP Sat May 19 
10:58:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34139] Remove stale unix datagram socket before binding

2018-07-18 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue34145] uuid3 and uuid5 hard to use portably between Python 2 and 3

2018-07-18 Thread Bence Romsics


New submission from Bence Romsics :

The issue I'd like to report may not be an outright bug neither in cPython 2 
nor in cPython 3, but more of a wishlist item to help Python programmers 
writing UUID-handling code that's valid in Python 2 and 3 at the same time.

Please consider these one-liners:

$ python2 -c 'import uuid ; 
uuid.uuid5(namespace=uuid.UUID("850aeee8-e173-4da1-9d6b-dd06e4b06747"), 
name="foo")'
$ python3 -c 'import uuid ; 
uuid.uuid5(namespace=uuid.UUID("850aeee8-e173-4da1-9d6b-dd06e4b06747"), 
name="foo")'

As long as the 'name' input to uuid.uuid3() or uuid.uuid5() is the literal 
string type of the relevant Python version there's no problem at all. However 
if you'd like to handle both unicode and non-unicode 'name' input in valid 
Python2/3 code then I find that's impossible to express without relying on 
Python version checking.

cPython2's uuid module is incompatible with unicode input:

$ python2 -c 'import uuid ; 
uuid.uuid5(namespace=uuid.UUID("850aeee8-e173-4da1-9d6b-dd06e4b06747"), 
name=u"foo")'
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/uuid.py", line 589, in uuid5
hash = sha1(namespace.bytes + name).digest()
UnicodeDecodeError: 'ascii' codec can't decode byte 0x85 in position 0: 
ordinal not in range(128)

cPython3's uuid module is incompatible with non-unicode input:

$ python3 -c 'import uuid ; 
uuid.uuid5(namespace=uuid.UUID("850aeee8-e173-4da1-9d6b-dd06e4b06747"), 
name=b"foo")'
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/uuid.py", line 608, in uuid5
hash = sha1(namespace.bytes + bytes(name, "utf-8")).digest()
TypeError: encoding without a string argument

The reason is obvious looking at the uuid modules' source code:

cPython 2.7:
https://github.com/python/cpython/blob/ea9a0994cd0f4bd37799b045c34097eb21662b3d/Lib/uuid.py#L603

cPython 3.6:
https://github.com/python/cpython/blob/e9e2fd75ccbc6e9a5221cf3525e39e9d042d843f/Lib/uuid.py#L628

Therefore portable code has to resort to version checking like this:

import six
import uuid

if six.PY2:
name = name.encode('utf-8')
uuid.uuid5(namespace=namespace, name=name)

IMHO this inconvenience could be avoided if cPython2's uuid.uuid3() and 
uuid.uuid5() had been changed to also accept unicode 'name' arguments and 
encode() them implicitly.

What do you think?

--
components: Library (Lib)
messages: 321870
nosy: rubasov
priority: normal
severity: normal
status: open
title: uuid3 and uuid5 hard to use portably between Python 2 and 3
versions: Python 2.7, Python 3.6

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

I found a command to get the CPU usage in percent *per* CPU. Here with 2 CPUs:

vstinner@WIN C:\vstinner\python\master>wmic cpu get loadpercentage  
LoadPercentage  
100 
100

--

___
Python tracker 

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



[issue34144] venv activate.bat reset codepage fails on windows 10

2018-07-18 Thread Lorenz Mende


Change by Lorenz Mende :


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

___
Python tracker 

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



[issue34144] venv activate.bat reset codepage fails on windows 10

2018-07-18 Thread Lorenz Mende


New submission from Lorenz Mende :

environment: Windows 10 Pro German/ 1803
cpython @master

When running the venv activate.bat the script fails to reset the codepage to 
the stored.

# Parameterformat falsch - 65001.

It seems that version 1803 brought a small change to the output of chcp.com - a 
dot is appended at the output

The issue can be solved by modifying the codepage grep of activate.bat:
for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do (...

A pull will be requested.

--
components: Library (Lib)
messages: 321868
nosy: LorenzMende
priority: normal
severity: normal
status: open
title: venv activate.bat reset codepage fails on windows 10
type: behavior
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



[issue34134] multiprocessing memory huge usage

2018-07-18 Thread Xiang Zhang


Xiang Zhang  added the comment:

I'm +1 for INADA's change, but not more examples trying to distinguish every 
detail difference.

--

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party module fails on Python 3.5)

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is very specific to *third party* extensions, not C extensions which 
are part of the standard library. That's why I asked if it wouldn't be better 
to open a new issue, if your use case concerns the stdlib and/or Python core.

--
title: 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the 
third-party yt module fails on Python 3.5) -> 3.5: Include/pyatomic.h is 
incompatible with OpenMP (compilation of the third-party module fails on Python 
3.5)

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party yt module fails on Python 3.5)

2018-07-18 Thread STINNER Victor


STINNER Victor  added the comment:

(Ah, Benjamin restarted the discussion, so I reopen this issue.)

> I understand the desire to compile Python with OpenMP.

I'm not sure that I understood the use case. Do you want to only compile Python 
core ("python3" binary") or just stdlib C extensions, or both?

> But the resolution here is hiding _Py_atomic symbols all the time, even when 
> OpenMP isn't involved, and even when building a standard extension module.

Sorry, but I don't understand the problem. Why is it an issue to hide 
_Py_atomic symbols?

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

___
Python tracker 

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



[issue34134] multiprocessing memory huge usage

2018-07-18 Thread Windson Yang


Windson Yang  added the comment:

Yes, we should not. But we can do this when use map function. the document 
gives a good example but doesn't say much about real differences between map 
and imap. Maybe we should add some notes like INADA suggest. 

map function will convert iterable to list if it doesn't implement __len__ 
function, so if you are using a generator, you should consider use imap. As 
well as add a warning about don't try to access the result outside the with 
statement. 

But if you guys think the docs are good enough, please close this issue.

--

___
Python tracker 

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



[issue34143] There is a constant definition error in errno.py

2018-07-18 Thread lktoken


New submission from lktoken :

In errno.py, the constant EDEADLK has a defined value of 11, and the constant 
EAGAIN has a defined value of 35, which is exactly the opposite of the linux 
constant definition. See: https://www.thegeekstuff.com/2010/10/linux 
-error-codes/.

--
components: Library (Lib), macOS
files: pythonbug.png
messages: 321863
nosy: lktoken, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: There is a constant definition error in errno.py
type: behavior
versions: Python 2.7
Added file: https://bugs.python.org/file47703/pythonbug.png

___
Python tracker 

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



[issue34141] Speed up pickling simple non-recusive values

2018-07-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue34141] Speed up pickling simple non-recusive values

2018-07-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 5d4cb54800966947db2e86f65fb109c5067076be by Serhiy Storchaka in 
branch 'master':
bpo-34141: Optimized pickling simple non-recursive values. (GH-8318)
https://github.com/python/cpython/commit/5d4cb54800966947db2e86f65fb109c5067076be


--

___
Python tracker 

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



[issue34142] Windows launcher version lookup flawed

2018-07-18 Thread Eryk Sun


Eryk Sun  added the comment:

This line in the docs is incorrect:

If PY_PYTHON=3 and PY_PYTHON3=3.1, the commands python and python3 
will both use specifically 3.1

It implies that setting the `python` virtual command to "3" or "2" will use the 
configured version of the `python3` or `python2` virtual command. As 
implemented, these three virtual commands are separately configured.

The `python` command is different in one way, since it's also the overall 
default. If the version set for `python2` or `python3` doesn't match an 
installed version, that's the end of the search. OTOH, the `python` command 
will continue to search for any version. For a shebang it prefers "2" over "3", 
and vice versa for the REPL or a script without a shebang.

--
nosy: +eryksun

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party yt module fails on Python 3.5)

2018-07-18 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Yes, why not fix this by putting the offending code under "#ifndef _OPENMP"?

What would be even better if is pyatomic.h wasn't included in Python.h, which 
should be fine since pyatomic.h doesn't have any public APIs. Maybe we can do 
that for 3.8.

--
nosy: +benjamin.peterson

___
Python tracker 

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