[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-18 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

> I'm not sure how exactly the warning print logic will work with a list of 
> tuples in cr_origin, I propose to start working on the implementation and 
> figure that out during the review process.

I think the simplest thing is probably to write the warning code in Python and 
stash it in Lib/_corohelper.py or something. Warnings already go through 
warnings.py (in particular, the warning printing code is still 
warnings.showwarning, it's never been rewritten in C), so we're already 
transitioning to Python at this stage anyway.

--

___
Python tracker 

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



[issue31848] "aifc" module does not always initialize "Aifc_read._ssnd_chunk"

2018-01-18 Thread Zackery Spytz

Change by Zackery Spytz :


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

___
Python tracker 

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



[issue32578] x86-64 Sierra 3.6: test_asyncio fails with timeout after 15 minutes

2018-01-18 Thread Nathan Henrie

Nathan Henrie  added the comment:

Think I am also seeing this, MacOS 10.13.2, making 3.6.4 from source 
test_asyncio hangs indefinitely.

I killed it after 2 hours this morning, last output was: `running: test_asyncio 
(9481 sec)`

--
nosy: +n8henrie

___
Python tracker 

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



[issue31368] Support asynchronous, non-blocking buffered reads (RWF_NONBLOCK)

2018-01-18 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


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



[issue32534] Speed-up list.insert: use memmove()

2018-01-18 Thread Jesse Bakker

Change by Jesse Bakker :


--
nosy: +Jesse Bakker

___
Python tracker 

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



[issue29564] ResourceWarning: suggest to enable tracemalloc in the message

2018-01-18 Thread Jesse Bakker

Change by Jesse Bakker :


--
nosy: +Jesse Bakker

___
Python tracker 

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



[issue32587] Make REG_MULTI_SZ support PendingFileRenameOperations

2018-01-18 Thread Eryk Sun

Eryk Sun  added the comment:

Currently countStrings and fixupMultiSZ halt the outer loop as soon as they hit 
an empty string. Basically, we'd be getting rid of that check. Then we have to 
prevent including an empty string for the final NUL in the normal case. We can 
do this by decrementing the length by 1 if the data ends on a NUL. We also need 
a check in the inner loop of fixupMultiSZ to ensure it doesn't get out of 
bounds. 

Example:

static void
fixupMultiSZ(wchar_t **str, wchar_t *data, int len)
{
int i;
wchar_t *P, *Q;

if (len > 0 && data[len - 1] == '\0') {
Q = data + len - 1;
} else {
Q = data + len;
}

for (P = data, i = 0; P < Q; P++, i++) {
str[i] = P;
for(; P < Q && *P != '\0'; P++)
;
}
}

static int
countStrings(wchar_t *data, int len)
{
int strings;
wchar_t *P, *Q;

if (len > 0 && data[len - 1] == '\0') {
Q = data + len - 1;
} else {
Q = data + len;
}

for (P = data, strings = 0; P < Q; P++, strings++) {
for (; P < Q && *P != '\0'; P++)
;
}
return strings;
}

Also, the REG_MULTI_SZ case in Reg2Py should use wcsnlen instead of wcslen, in 
case of malformed data that doesn't end on at least one NUL character. The 
upper limit would be the remaining length.

--

___
Python tracker 

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



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread MarmiteFox

MarmiteFox  added the comment:

Thanks for the fix and the tip about cross-checking in Python 3 - will remember 
that for the future.

--

___
Python tracker 

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



[issue32537] multiprocessing.pool.Pool.starmap_async - wrong parameter name

2018-01-18 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Closed as is a duplicate of 31304. Thanks for reporting this!

--
nosy: +pablogsal
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Update doc for starmap_async error_back kwarg

___
Python tracker 

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



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks!

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



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 8ca036d4716fc86ff42474ba35d3cd32f0188a15 by Mariatta (Pablo 
Galindo) in branch '2.7':
bpo-32586: Fix code example in urllib2's doc  (GH-5238)
https://github.com/python/cpython/commit/8ca036d4716fc86ff42474ba35d3cd32f0188a15


--
nosy: +Mariatta

___
Python tracker 

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



[issue32532] improve sys.settrace and sys.setprofile documentation

2018-01-18 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

There are some issues in the documentation for this function (slightly related) 
to this described here: https://bugs.python.org/issue17799. 

I can update the PR linked to that issue with this information as well.

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



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Thanks for reporting this issue. Indeed, this is an error in the documentation. 
Notice that this is corrected in Python3 's version:

https://docs.python.org/3.6/howto/urllib2.html#handling-exceptions

I have prepared a Pull Request fixing this. Thanks!

--
nosy: +pablogsal
priority: normal -> low

___
Python tracker 

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



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue31801] vars() manipulation encounters problems with Enum

2018-01-18 Thread Ethan Furman

Change by Ethan Furman :


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



[issue32588] Move _findvs into its own extension module

2018-01-18 Thread Steve Dower

Change by Steve Dower :


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



[issue32588] Move _findvs into its own extension module

2018-01-18 Thread Steve Dower

Steve Dower  added the comment:


New changeset ccf7f05c5d3fdea89d857e775d2c6371f3e15b4a by Steve Dower in branch 
'3.6':
[3.6] bpo-32588 Move _distutils_findvs into its own module (GH-5227) (#5228)
https://github.com/python/cpython/commit/ccf7f05c5d3fdea89d857e775d2c6371f3e15b4a


--

___
Python tracker 

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



[issue32588] Move _findvs into its own extension module

2018-01-18 Thread Steve Dower

Steve Dower  added the comment:


New changeset 2507e29a9e4e9dcac6eab46546bd3d34a69342ba by Steve Dower in branch 
'master':
bpo-32588: Move _findvs into its own module and add missing _queue module to 
installer (#5227)
https://github.com/python/cpython/commit/2507e29a9e4e9dcac6eab46546bd3d34a69342ba


--

___
Python tracker 

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



[issue26163] FAIL: test_hash_effectiveness (test.test_set.TestFrozenSet)

2018-01-18 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5082

___
Python tracker 

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



[issue26163] FAIL: test_hash_effectiveness (test.test_set.TestFrozenSet)

2018-01-18 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
pull_requests: +5081

___
Python tracker 

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



[issue32595] Deque with iterable object as one object

2018-01-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Sorry Jonathan, this is the way the python containers work if they take an 
iterable input.  In the case of a str, it is not possible for us to know 
whether you mean for deque('abc') to go it as three arguments or as one.

FWIW, if you don't what to put the single element in a list, the API provides 
the append() method for adding scalars and extend() method for adding iterables:

   d = deque()
   d.append('abc')
   d.extend('abc')

Note that lists behave the same way.

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



[issue32595] Deque with iterable object as one object

2018-01-18 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue32595] Deque with iterable object as one object

2018-01-18 Thread Jonathan

New submission from Jonathan :

Creating a deque with an iterable object creates extra overhead if you want to 
insert it as one element.

e.g:
import timeit

test1 = '''
str = "x" * 10
lst = [str]
'''

test2 = '''
str = "x" * 10
'''

print(timeit.timeit(test1, number=10))
print(timeit.timeit(test2, number=10))

If I want to add a string to a deque i will have to put it in a list first, 
this causes 23% slower performance in my case.

There should be a deque where this overhead is not needed because in most cases 
this will be used in performance demanding cases.

--
components: Library (Lib)
messages: 310256
nosy: jonathandaniel
priority: normal
severity: normal
status: open
title: Deque with iterable object as one object
type: performance
versions: Python 2.7

___
Python tracker 

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



[issue32590] Proposal: add an "ensure(arg)" builtin for parameter validation

2018-01-18 Thread Brett Cannon

Brett Cannon  added the comment:

I agree w/ David that this idea is premature. Plus I say it's easier to make it 
so -O is more fine-grained so you can leave in asserts but get __debug__ set to 
False.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue31801] vars() manipulation encounters problems with Enum

2018-01-18 Thread Ethan Furman

Change by Ethan Furman :


--
stage: test needed -> needs patch

___
Python tracker 

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



[issue32218] add __iter__ to enum.Flag members

2018-01-18 Thread Ethan Furman

Change by Ethan Furman :


--
assignee:  -> ethan.furman
stage:  -> needs patch

___
Python tracker 

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



[issue32587] Make REG_MULTI_SZ support PendingFileRenameOperations

2018-01-18 Thread Seppo Yli-Olli

Seppo Yli-Olli  added the comment:

I don't personally know enough of CPython (I barely know enough C) to do the 
patches but I'd just comment that as this might increase complexity of 
implementation and wide char API's are used, it might be prudent to make sure 
the new implementation works with some more exotic input than fits into ASCII. 
PendingFileRenameOperations can contain any valid Windows path. Microsoft also 
warns that the end null byte can be redacted in some cases by the party storing 
the data.

--

___
Python tracker 

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



[issue29752] Enum._missing_ not called for __getitem__ failures

2018-01-18 Thread Ethan Furman

Ethan Furman  added the comment:

To move this forward:

The proposal is to add support for a new method, _missing_name_, which is 
called by __getitem__.

If such a method does not exist, the normal AttributeError exception is raised;

otherwise, the _missing_name_ method is called with the invalid name and should 
return a matching member or None;
- if None, the normal AttributeError exception is raised
- if a member, it is returned
- otherwise, a Type(?)Error is raised

--
title: Enum._missing_ not called for __getattr__ failures -> Enum._missing_ not 
called for __getitem__ failures

___
Python tracker 

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



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2018-01-18 Thread stein-k

stein-k  added the comment:

Added a patch containing the fix, is this the proper way or should I create a 
pull request?

--
keywords: +patch
Added file: 
https://bugs.python.org/file47395/urllib_parse_unquote_handle_bytes.patch

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-18 Thread R. David Murray

R. David Murray  added the comment:

I believe you are correct that it is too late to modify the existing behavior.  
Too many programs depend on it.  As far as documenting, my point is that it is 
*not specified* what the name attribute contains.  It can contain literally 
anything, depending on the particular file object involved.

Could we document what the open function actually does?  That perhaps we could 
do, since it is likely that other python implementations will want to copy what 
CPython does in this case.  But as you observe, this can also be *system 
dependent*, so it is not completely clear to me exactly how we should do that.  
That is, the description of what actually happens could be so complex that it 
might be better to just say something like "The exact type and value of the 
name attribute is not specified, but when the file is opened via a file system 
path it will almost always be that path as a string.".

I'd be happy for a better answer, though :)

--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-18 Thread Yury Selivanov

Yury Selivanov  added the comment:

+1 on on the API and for adding it in 3.7 and for deprecating 
set_coroutine_wrapepr.  This will simplify asyncio code and other event loops 
(like uvloop) and will lead to less overhead on asyncio debug mode.

I always disliked the set_coroutine_wrapper API.  Even at the time when I added 
it to PEP 492 I understood that we'll have to replace it eventually with 
something more sensible.

I think we should start working on a patch.  Nathaniel, do you have time to 
champion the work?

> Most important: what format should we use for storing the origin information? 
> I can see three plausible approaches:

I'd be strongly against calling `traceback.StackSummary.extract` when coroutine 
object is created.  Let's go with the option 2.  You can create a list of tuple 
objects without the need of inventing a new struct.  coroutine.cr_origin (let's 
have the "cr_" prefix; dropping the prefixes should be considered in a separate 
issue) should return that list object directly.

I'm not sure how exactly the warning print logic will work with a list of 
tuples in cr_origin, I propose to start working on the implementation and 
figure that out during the review process.

--

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-18 Thread Skip Montanaro

Skip Montanaro  added the comment:

I'm not terribly concerned with the end result, only that we wind up with a 
more consistent system. As I see it, there are two main problems:

1. The type of the name attribute varies

2. The name attribute appears to be undocumented, at least not in the obvious 
place.

Of lesser importance, but still unintuitive, is that the "name" attribute 
doesn't refer to an actual name in the filesystem. (I realize that the "name" 
of sys.std{in,out,err} is also meaningless when interpreted as an actual 
filename, but that ship sailed long ago.)

I realize that it might well be infeasible to modify behavior at this point. I 
do think it important to document the "name" attribute (item #2). After all, it 
doesn't appear to be obviously private.

I live in a Linux-only world, so this workaround in my own code is likely not 
useful everywhere, but, when I try to convert a builtin file object to an 
io.TextIOWrapper object using io.open(f.fileno()), I actually do this:

io.open("/dev/fd/{}".format(f.fileno()), ...)

This gives me a meaningful "name" attribute in that it is a string, and that it 
names an actual filename. How this might work on systems without "/dev/fd", I 
don't know, but might be worth thinking about for a couple minutes before 
dismissing it out-of-hand.

--

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-18 Thread Skip Montanaro

Skip Montanaro  added the comment:

Apologies for the incomplete report. In 2.7 this anomaly exists in the 
io.open() function. You are correct, builtin open() in 2.x doesn't support 
opening by file descriptor.

--

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Maybe we could add in the documentation.

"""
if we use a file descriptor as the parameter, the name of the returned file 
object will be the file descriptor itself.
"""

--

___
Python tracker 

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



[issue32570] Python crash 0xc00000fd Windows10 x64 - "fail without words"

2018-01-18 Thread Василь Коломієць

Василь Коломієць  added the comment:

Thanks a lot!
Grace and Honor!

--

___
Python tracker 

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



[issue32570] Python crash 0xc00000fd Windows10 x64 - "fail without words"

2018-01-18 Thread Eryk Sun

Eryk Sun  added the comment:

CPython pushes a frame on the thread's stack for every Python frame. By default 
in Windows Python the thread's stack is allowed to grow up to about 2 MB. On 
Linux the default limit is 8 MB, but a higher limit can be set via `ulimit -s`. 
After the stack is full, pushing another value will crash the process due to a 
stack overflow. Windows raises a STATUS_STACK_OVERFLOW (0xC0FD) exception. 
Linux raises a SIGSEGV signal (segmentation fault).

The default interpreter recursion limit of 1,000 is set to raise a Python 
RecursionError well before you'd see a hard crash from a stack overflow. If we 
ballpark a C stack frame at about 1 KB in 64-bit Python, then the default stack 
size on Windows should support a recursion limit of about 2,000. For a 
recursion limit of 100,000, I would estimate a 100 MB stack size.

You can call threading.stack_size(size_in_bytes) to reserve a larger stack size 
for new threads. However, in Python code it's better to rewrite such deeply 
recursive cases to use loops instead.

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-18 Thread R. David Murray

R. David Murray  added the comment:

This has been discussed previously.  The nature of the 'name' attribute for 
file objects is not really specified, so I'm not even sure what we would 
document.  Maybe just that it is unspecified.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32590] Proposal: add an "ensure(arg)" builtin for parameter validation

2018-01-18 Thread R. David Murray

R. David Murray  added the comment:

I'm not clear why we want a bug tracker issue for something that is still only 
an idea.  We generally *send* people to python-ideas when they propose 
half-baked ideas here :)  (Not actually saying your idea is half-baked, but it 
clearly isn't fully baked since there's no PEP.)  

There is literally no point in discussing this proposal here.  Normally for an 
issue like this (where we've redirected someone to python-ideas for discussion) 
we would close the issue and tell them to come back and re-open it if there is 
a positive consensus on python-ideas.  Since you are designating this as PEP 
level, there seems to be no reason to keep the issue open.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32589] Statistics as a result from timeit

2018-01-18 Thread Matthias Gilch

Matthias Gilch  added the comment:

Added sample stdev and variance to the PR

--

___
Python tracker 

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



[issue31399] Let OpenSSL verify hostname and IP address

2018-01-18 Thread Christian Heimes

Christian Heimes  added the comment:

https://github.com/libressl-portable/portable/issues/381

--

___
Python tracker 

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



[issue31399] Let OpenSSL verify hostname and IP address

2018-01-18 Thread Christian Heimes

Christian Heimes  added the comment:

Bad news, LibreSSL is the worst. Even the latest release 2.6.4 does not 
implement 
https://www.openssl.org/docs/man1.0.2/crypto/X509_VERIFY_PARAM_set1_host.html 
or X509_VERIFY_PARAM_set_hostflags(). I don't get why it provides 
X509_check_host() but not X509_VERIFY_PARAM_set1_host().

--

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-18 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
versions:  -Python 2.7

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

but I can confirm your issue with 3.6.4+

Python 3.6.4+ (heads/3.6:f31c70b0d6, Jan 18 2018, 14:57:01) 
[GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stderr.name
''
>>> f = open(sys.stderr.fileno())
>>> f.name
2
>>>

--

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Skip,

I only tested with the last revision of 2.7

Python 2.7.14+ (heads/2.7:b1a52b1167, Jan 18 2018, 14:53:29) 
[GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stderr.name
''
>>> f = open(sys.stderr.fileno())
Traceback (most recent call last):
  File "", line 1, in 
TypeError: coercing to Unicode: need string or buffer, int found


I can't create a file with an int.

--
nosy: +matrixise

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-18 Thread Skip Montanaro

New submission from Skip Montanaro :

I stumbled on what I think is an inconsistency in the "name" attribute of file 
objects. When a file is opened with an existing file descriptor, the "name" 
attribute is of type int (this from a 3.6.4 session, but it also exists in 2.7):

>>> import sys
>>> sys.stderr.name
''
>>> f = open(sys.stderr.fileno())
>>> f.name
2
>>> type(f.name)


I thought it odd that the standard I/O objects would be blessed with string 
filenames (despite not representing real filesystem paths), but that files 
opened by file descriptor would have that file descriptor as their name.

I looked in the documentation for open():

https://docs.python.org/3/library/functions.html#open

but saw no mention of the "name" attribute at all. In fact, the first argument 
to open() is called "file", so it's not obvious that the "name" attribute needs 
to be a copy of that parameter.

It seems to me that "name" attributes of open file objects should be of a 
consistent type, even if they might not represent an actual path in the 
filesystem. Even if this dual-type behavior is retained, it should be 
documented.

--
assignee: docs@python
components: Documentation, IO, Interpreter Core
messages: 310237
nosy: docs@python, skip.montanaro
priority: normal
severity: normal
status: open
title: File object 'name' attribute inconsistent type and not obviously 
documented
type: behavior
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



[issue32593] Drop support of FreeBSD 9 and older in Python 3.7

2018-01-18 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +5080

___
Python tracker 

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



[issue32570] Python crash 0xc00000fd Windows10 x64 - "fail without words"

2018-01-18 Thread Василь Коломієць

Василь Коломієць  added the comment:

sorry - wrong ideone example
this one better to look:
https://ideone.com/aV9Z8p

--

___
Python tracker 

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



[issue29871] Enable optimized locks on Windows

2018-01-18 Thread STINNER Victor

STINNER Victor  added the comment:

FYI I proposed a PR which removes the emulation of condition variable:
https://github.com/python/cpython/pull/5231

This PR removes code specific to Windows Vista: see bpo-32592.

--
nosy: +vstinner

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.7

2018-01-18 Thread STINNER Victor

STINNER Victor  added the comment:

> If you don't get to it, reassign the bug to me once you've merged the first 
> part and I'll look at the installer.

I like that :-) Will me. Right now, my PR doesn't compile, I broke something 
and I don't understand the error.

--

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.7

2018-01-18 Thread Steve Dower

Steve Dower  added the comment:

The only changes necessary in the installer should be in 
PythonBootstrapperApplication.cpp to make it an error when run on pre-Win7 OS. 
The pattern is already there, and the string references are in 
Tools/msi/bundle/Default.wxl

If you don't get to it, reassign the bug to me once you've merged the first 
part and I'll look at the installer.

--

___
Python tracker 

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



[issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own.

2018-01-18 Thread Tzu-ping Chung

Tzu-ping Chung  added the comment:

Plot twist: the workaround does not work on Windows.

$ cd SOMEDIR   ; Placeholder for a valid directory.
$ virtualenv env1
...
$ env\Scripts\python.exe
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sysconfig
>>> print(sysconfig.get_config_var('BINDIR'))
SOMDIR\env1\Scripts

This points to the virtualenv's BINDIR, not the real Python installation's :(

--

___
Python tracker 

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



[issue32590] Proposal: add an "ensure(arg)" builtin for parameter validation

2018-01-18 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Since this is intended for argument checking, i.e. testing preconditions, the 
Eiffel term "require" seems more appropriate.

https://www.eiffel.org/doc/eiffel/ET:%20Design%20by%20Contract%20(tm),%20Assertions%20and%20Exceptions#Preconditions

--

___
Python tracker 

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



[issue9566] Compilation warnings under x64 Windows

2018-01-18 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 05d68a8bd84cb141be9f9335f5b3540f15a989c4 by Victor Stinner in 
branch 'master':
bpo-9566: Fix size_t=>int downcast warnings (#5230)
https://github.com/python/cpython/commit/05d68a8bd84cb141be9f9335f5b3540f15a989c4


--

___
Python tracker 

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



[issue32593] Drop support of FreeBSD 9 and older in Python 3.7

2018-01-18 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +koobs

___
Python tracker 

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



[issue32593] Drop support of FreeBSD 9 and older in Python 3.7

2018-01-18 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32593] Drop support of FreeBSD 9 and older in Python 3.7

2018-01-18 Thread STINNER Victor

New submission from STINNER Victor :

FreeBSD 9.3 support ended at December 31, 2016. It's time to drop code for 
compatibility with FreeBSD 9 and older.
https://www.freebsd.org/security/unsupported.html

Attached PR removes this code.

--
components: Build
messages: 310229
nosy: vstinner
priority: normal
severity: normal
status: open
title: Drop support of FreeBSD 9 and older in Python 3.7
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



[issue29564] ResourceWarning: suggest to enable tracemalloc in the message

2018-01-18 Thread Me01100Nobody

Change by Me01100Nobody :


--
nosy: +Me01100Nobody

___
Python tracker 

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



[issue32576] concurrent.futures.thread deadlock due to Queue in weakref callback

2018-01-18 Thread Antoine Pitrou

Change by Antoine Pitrou :


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



[issue32576] concurrent.futures.thread deadlock due to Queue in weakref callback

2018-01-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:


New changeset ab74504346a6e2569b3255b7b621c589716888c4 by Antoine Pitrou in 
branch 'master':
bpo-32576: use queue.SimpleQueue in critical places (#5216)
https://github.com/python/cpython/commit/ab74504346a6e2569b3255b7b621c589716888c4


--

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.7

2018-01-18 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.7

2018-01-18 Thread STINNER Victor

New submission from STINNER Victor :

https://docs.python.org/dev/using/windows.html#supported-versions

"As specified in PEP 11, a Python release only supports a Windows platform 
while Microsoft considers the platform under extended support. This means that 
Python 3.7 supports Windows Vista and newer. If you require Windows XP support 
then please install Python 3.4."

But Windows Vista extended supported already ended last year, in April 2017.

Attached PR removes code to support Windows Vista.

--
components: Windows
messages: 310227
nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: Drop support of Windows Vista in Python 3.7
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



[issue9566] Compilation warnings under x64 Windows

2018-01-18 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +5077

___
Python tracker 

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