[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Unpacking the int would mean having one sig_atomic_t for 'invalid', using 
> that instead of INVALID_FD, plus an array of sig_atomic_t for the fd itself.  
> Every time you want to change the fd you first set the 'invalid' flag, then 
> the individual bytes, then clear 'invalid'.

I'm not sure that this is thread-safe as processors can reorder instructions, 
so there is no guarantee that memory is written in the expected order. That's 
one of the problems that C11/C++11 atomics solve.

--

___
Python tracker 

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



[issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential)

2019-04-09 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

> """
Since the documentation seems to be silent the guarantee (or expectation) is 
implied - logging systems emit records atomically - if this isn't true across 
fork() then the exception should be documented.
"""

We can add a note to the docs.  As a general rule: documentation being silent 
means there are zero guarantees.  Behavior of the existing implementations over 
time is the only source of truth.


> """
but it didn't address the more fundamental problem:

- when the child enters the code 'b' is undefined

i.e., breaking the lock will allow the child to access data in an undefined 
state.  This will result in either core dumps or hangs (presumably the 
motivation for the original change was to prevent this?).
"""

nope.  the contrived emit() pseudocode from msg339650 never defined b in the 
first place.  that code, if massaged into python syntax would raise an 
UnboundLocalError no matter who executed it.  a fork() from another thread 
would not change that.  There is no concept of undefined/uninitialized state 
from the Python perspective.

The motivation for the original fix was entirely deadlock avoidance in code 
that uses fork.  It failed and introduced an alternate form of deadlock in code 
that had been lucky up until that point.  Thus my new PR proposing to fix the 
regression by making that not fail yet still preventing locks from starting out 
held in the child process.

--

___
Python tracker 

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



[issue36582] collections.UserString encode method returns a string

2019-04-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Trey, would you like to submit a PR to fix this?  (Be sure to add a test case).

--
assignee:  -> rhettinger
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



[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> You could also use the internal _sha512 module. 
> It's always present, small, lean and provides a SHA512
> implementation with sufficient performance.

I suppose we could do this but it borders on telling folks that we're worried 
about using our own public APIs, that importing hashlib is bad for them.  It 
shouldn't be that way, hashlib is a collection of hash functions -- it is clear 
why this import isn't small and fast.  It suggests that something is wrong with 
the implementation.

The focus on client code in random seems like the wrong focus.  That is just 
typical of what other clients would do.

--

___
Python tracker 

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



[issue12910] urllib.quote quotes too many chars, e.g., '()'

2019-04-09 Thread Senthil Kumaran


Change by Senthil Kumaran :


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



[issue12910] urllib.quote quotes too many chars, e.g., '()'

2019-04-09 Thread miss-islington


miss-islington  added the comment:


New changeset 796698adf558f2255474945082856538b1effb0b by Miss Islington (bot) 
in branch '3.7':
bpo-12910: update and correct quote docstring (GH-2568)
https://github.com/python/cpython/commit/796698adf558f2255474945082856538b1effb0b


--
nosy: +miss-islington

___
Python tracker 

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



[issue14826] urlopen URL with unescaped space

2019-04-09 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +12682
stage:  -> patch review

___
Python tracker 

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



[issue36276] [CVE-2019-9740] Python urllib CRLF injection vulnerability

2019-04-09 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +12683

___
Python tracker 

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



[issue12910] urllib.quote quotes too many chars, e.g., '()'

2019-04-09 Thread Senthil Kumaran

Senthil Kumaran  added the comment:


New changeset 750d74fac5c510e39958b3f79641fe54096ee54f by Senthil Kumaran (Jörn 
Hees) in branch 'master':
bpo-12910: update and correct quote docstring (#2568)
https://github.com/python/cpython/commit/750d74fac5c510e39958b3f79641fe54096ee54f


--

___
Python tracker 

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



[issue12910] urllib.quote quotes too many chars, e.g., '()'

2019-04-09 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
pull_requests: +12681

___
Python tracker 

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



[issue29858] inspect.signature includes bound argument for wrappers around decorated bound methods

2019-04-09 Thread Cheryl Sabella


Change by Cheryl Sabella :


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

___
Python tracker 

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



[issue36581] __dir__ on unittest.mock not safe for all spec types

2019-04-09 Thread Dylan Semler


Dylan Semler  added the comment:

I agree docs only say "list of strings" and so this isn't a case where there's 
behavior that contrasts with the documentation. I merely ran into this issue in 
my project and found it difficult to get to the root of so wanted to fix it 
upstream. I made a patch and reported this bug only as a formality to accompany 
my patch.

--

___
Python tracker 

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



[issue36582] collections.UserString encode method returns a string

2019-04-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue36582] collections.UserString encode method returns a string

2019-04-09 Thread Trey Hunner


New submission from Trey Hunner :

It looks like the encode method for UserString incorrectly wraps its return 
value in a str call.

```
>>> from collections import UserString
>>> UserString("hello").encode('utf-8') == b'hello'
False
>>> UserString("hello").encode('utf-8')
"b'hello'"
>>> type(UserString("hello").encode('utf-8'))

```

--
components: Library (Lib)
messages: 339818
nosy: trey
priority: normal
severity: normal
status: open
title: collections.UserString encode method returns a string
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



[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2019-04-09 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

What would be the best way to resolve the discussion between this and issue 
32949?  Would it be good to try to get one of them into 3.8?

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue36581] __dir__ on unittest.mock not safe for all spec types

2019-04-09 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue36541] Make lib2to3 grammar more closely match Python

2019-04-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue36580] unittest.mock does not understand dataclasses

2019-04-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

To add to this mock.Mock also copies dir(spec) but creating an instance from 
mock doesn't copy it where it's not a problem with create_autospec. Mock with 
spec does only attribute validation whereas create_autospec does signature 
validation. There is another open issue to make mock use spec passed as if it's 
autospecced issue30587 where this could be used as a data point to change API. 
I am adding mock devs for confirmation.

--
nosy: +cjw296, mariocj89, michael.foord
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



[issue36581] __dir__ on unittest.mock not safe for all spec types

2019-04-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock

> spec: This can be either a list of strings or an existing object (a class or 
> instance) that acts as the specification for the mock object. If you pass in 
> an object then a list of strings is formed by calling dir on the object 
> (excluding unsupported magic attributes and methods). Accessing any attribute 
> not in this list will raise an AttributeError.

Docs state it should be list of strings. Can you please link to docs where an 
iterable of strings is mentioned? A simple patch would be to wrap it inside a 
list() call but I am not sure of making the interface more relaxed which was 
documented to accept list of strings. I am adding module mock devs to take a 
call on this.


diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 8684f1dfa5..35dc7b044e 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -679,7 +679,7 @@ class NonCallableMock(Base):
 if not FILTER_DIR:
 return object.__dir__(self)

-extras = self._mock_methods or []
+extras = list(self._mock_methods or [])
 from_type = dir(type(self))
 from_dict = list(self.__dict__)

--
nosy: +cjw296, mariocj89, michael.foord, xtreak

___
Python tracker 

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



[issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None

2019-04-09 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@barry, you started a review of PR10016 and I believe all your requested 
changes have been made, so please review again when you get a chance.  Please 
also take a look at PR10376.  Thanks!

--
nosy: +cheryl.sabella
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



[issue36581] __dir__ on unittest.mock not safe for all spec types

2019-04-09 Thread Dylan Semler

New submission from Dylan Semler :

If a MagicMock is created with a spec or spec_set that is a non-list iterable 
of strings (like a tuple), calling dir() on said mock produces a Traceback.  
Here's a minimum example:

 cat poc.py
from unittest.mock import MagicMock

mock = MagicMock(spec=('a', 'tuple'))
dir(mock)

 python3 poc.py 
Traceback (most recent call last):
  File "poc.py", line 4, in 
dir(mock)
  File "/usr/lib64/python3.6/unittest/mock.py", line 677, in __dir__
return sorted(set(extras + from_type + from_dict +
TypeError: can only concatenate tuple (not "list") to tuple

--
components: Library (Lib)
messages: 339813
nosy: Dylan Semler
priority: normal
severity: normal
status: open
title: __dir__ on unittest.mock not safe for all spec types
type: crash
versions: 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



[issue36580] unittest.mock does not understand dataclasses

2019-04-09 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

mock.Mock doesn't do signature validation by default for constructor and 
methods. This is expected. create_autospec [0] should be used to make sure the 
signature is validated.'

import dataclasses
import unittest.mock

@dataclasses.dataclass
class Foo:
name: str
baz: float
bar: int = 12

FooMock = unittest.mock.create_autospec(Foo)
fooMock = FooMock()  # Will fail now since it's specced

➜  cpython git:(master) ./python.exe ../backups/bpo36580.py
Traceback (most recent call last):
  File "../backups/bpo36580.py", line 11, in 
fooMock = FooMock()  # should fail: Foo.__init__ takes two arguments
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", 
line 984, in __call__
_mock_self._mock_check_sig(*args, **kwargs)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", 
line 103, in checksig
sig.bind(*args, **kwargs)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/inspect.py", 
line 3021, in bind
return args[0]._bind(args[1:], kwargs)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/inspect.py", 
line 2936, in _bind
raise TypeError(msg) from None
TypeError: missing a required argument: 'name'

On the other hand 'name' in dir(FooMock) doesn't have the attributes (name and 
baz) present I suppose they are constructed dynamically when an object is 
created from Foo since they are present in dir(Foo()) and mock is not able to 
detect them? mock.create_autospec does an initial pass of dir(Foo) to copy the 
attributes [1] and perhaps it's not able to copy name and bar while baz is 
copied. Below are for FooMock = create_autospec(Foo) . So 'name' in dir(Foo) is 
False for dataclasses. Is this a known behavior?

dir(Foo)

['__annotations__', '__class__', '__dataclass_fields__', 
'__dataclass_params__', '__delattr__', '__dict__', '__dir__', '__doc__', 
'__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', 
'__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', 
'__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
'__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'bar']


dir(Foo(1, 2))

['__annotations__', '__class__', '__dataclass_fields__', 
'__dataclass_params__', '__delattr__', '__dict__', '__dir__', '__doc__', 
'__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', 
'__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', 
'__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
'__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'bar', 'baz', 
'name']

dir(create_autospec(Foo))

['__annotations__', '__class__', '__dataclass_fields__', 
'__dataclass_params__', '__delattr__', '__dict__', '__dir__', '__doc__', 
'__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', 
'__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', 
'__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
'__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'assert_any_call', 
'assert_called', 'assert_called_once', 'assert_called_once_with', 
'assert_called_with', 'assert_has_calls', 'assert_not_called', 'attach_mock', 
'bar', 'call_args', 'call_args_list', 'call_count', 'called', 'configure_mock', 
'method_calls', 'mock_add_spec', 'mock_calls', 'reset_mock', 'return_value', 
'side_effect']


print('name' in dir(fooMock)) # False
print('baz' in dir(fooMock)) # False
print('bar' in dir(fooMock)) # True

[0] 
https://docs.python.org/3/library/unittest.mock.html#unittest.mock.create_autospec
[1] 
https://github.com/python/cpython/blob/0e10766574f4e287cd6b5e5860a1ca75488f4119/Lib/unittest/mock.py#L2263

--
nosy: +xtreak

___
Python tracker 

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



[issue36580] unittest.mock does not understand dataclasses

2019-04-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm not sure why dataclasses would be different here:

>>> import dataclasses
>>> import unittest.mock
>>> @dataclasses.dataclass
... class Foo:
... name: str
... baz: float
... bar: int = 12
...
>>> import inspect
>>> inspect.signature(Foo)
 None>
>>>

Foo is just a normal class with a normal __init__.

This is no different than if you don't use dataclasses:

>>> class Bar:
... def __init__(self, name: str, baz: float, bar: int = 12) -> None:
... pass
...
>>> Bar()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() missing 2 required positional arguments: 'name' and 'baz'
>>> inspect.signature(Bar)
 None>
>>> BarMock = unittest.mock.Mock(Bar)
>>> barMock = BarMock()

--
nosy: +eric.smith

___
Python tracker 

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



[issue36569] @staticmethod seems to work with setUpClass, but docs say it shouldn't

2019-04-09 Thread Brett Cannon


Brett Cannon  added the comment:

It's more of a "can't be an instance method" than a strict "only classmethod".

Can I ask why you want it to be a strictmethod instead of a classmethod? I 
personally don't want to change the docs as I think that encourages a 
potentially bad situation where someone meant to have a classmethod and didn't 
realize the difference between that and staticmethod. But if there's a 
legitimate need for staticmethod then I'm open to reconsidering how the docs 
are written.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue20074] open() of read-write non-seekable streams broken

2019-04-09 Thread cagney


cagney  added the comment:

Another example is PTY:

Python 2.7.15 (default, Oct 15 2018, 15:24:06) 
[GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> pty, tty = os.openpty()
>>> print(pty, tty)
(3, 4)
>>> import io
>>> rw = io.open(pty, "r+")
Traceback (most recent call last):
  File "", line 1, in 
IOError: File or stream is not seekable.
>>> rw = open("/dev/tty", "r+")
>>> rw.write("hi")
>>> rw.flush()
hi>>> 

Python 3.7.3+ (heads/3.7-dirty:0a16bb15af, Apr  9 2019, 13:45:22) 
[GCC 8.3.1 20190223 (Red Hat 8.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> pty, tty = os.openpty()
>>> import io
>>> rw = io.open(pty, "r+")
Traceback (most recent call last):
  File "", line 1, in 
io.UnsupportedOperation: File or stream is not seekable.

--
nosy: +cagney

___
Python tracker 

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



[issue36580] unittest.mock does not understand dataclasses

2019-04-09 Thread John Parejko


New submission from John Parejko :

The new dataclasses.dataclass is very useful for describing the properties of a 
class, but it appears that Mocks of such decorated classes do not catch the 
members that are defined in the dataclass. I believe the root cause of this is 
the fact that unittest.mock.Mock generates the attributes of its spec object 
via `dir`, and the non-defaulted dataclass attributes do not appear in dir.

Given the utility in building classes with dataclass, it would be very useful 
if Mocks could see the class attributes of the dataclass.

Example code:

import dataclasses
import unittest.mock

@dataclasses.dataclass
class Foo:
name: str
baz: float
bar: int = 12

FooMock = unittest.mock.Mock(Foo)
fooMock = FooMock()  # should fail: Foo.__init__ takes two arguments
# I would expect these to be True, but they are False
'name' in dir(fooMock)
'baz' in dir(fooMock)
'bar' in dir(fooMock)

--
components: Library (Lib), Tests
messages: 339808
nosy: John Parejko2
priority: normal
severity: normal
status: open
title: unittest.mock does not understand dataclasses
type: behavior
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



[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Adam Olsen


Adam Olsen  added the comment:

Converting to/from sig_atomic_t could have a compile time check on currently 
supported platforms and isn't buggy for them.  For platforms with a different 
size you could do a runtime check, only allowing a fd in the range of 0-254 
(with 255 reserved); that could sometimes fail, yes, but at least it's 
explicit, easily understood failure.  Just using int would fail in undefined 
ways down the road, likely writing to a random fd instead (corrupting whatever 
it was doing), with no way to trace it back.

Unpacking the int would mean having one sig_atomic_t for 'invalid', using that 
instead of INVALID_FD, plus an array of sig_atomic_t for the fd itself.  Every 
time you want to change the fd you first set the 'invalid' flag, then the 
individual bytes, then clear 'invalid'.

--

___
Python tracker 

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



[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> unpack the int into an array of sig_atomic_t.

What do you mean with this? You can't write a complete array atomically, so I 
don't see how this would help.

--

___
Python tracker 

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



[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

I'm not sure with what you disagree. At least, you have to admit that using 
sig_atomic_t is buggy for different reasons than signal safety, namely that 
there is no guarantee that one can safely convert back and forth to an "int".

--

___
Python tracker 

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



[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-09 Thread Kingsley McDonald


Kingsley McDonald  added the comment:

Hello there,

I'm an absolute beginner here and this whole thing is a little overwhelming, so 
please bear with me. I think this would be a suitable first task for me to take 
on because it appears to be a simple one-line change (correct me if I'm 
mistaken, though).

--
nosy: +kingsley

___
Python tracker 

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



[issue32884] Adding the ability for getpass to print asterisks when passowrd is typed

2019-04-09 Thread Steven Vascellaro


Steven Vascellaro  added the comment:

@matanya.stroh: Don't forget to erase the asterisks if the user hits backspace.

```
def win_getpass(prompt='Password: ', stream=None, show_asterisks=False):
"""Prompt for password with echo off, using Windows getch()."""
if sys.stdin is not sys.__stdin__:
return fallback_getpass(prompt, stream)

for c in prompt:
msvcrt.putwch(c)
pw = ""
while 1:
c = msvcrt.getwch()
if c == '\r' or c == '\n':
break
if c == '\003':
raise KeyboardInterrupt
if c == '\b':
if len(pw) > 0:
pw = pw[:-1]
msvcrt.putwch('\b')
msvcrt.putwch(' ')
msvcrt.putwch('\b')
else:
pw = pw + c
if show_asterisks:
msvcrt.putwch('*')
msvcrt.putwch('\r')
msvcrt.putwch('\n')
return pw
```

Alternatively, could let the user define the masking character, similar to 
Tkinter's Entry widget.

```
def win_getpass(prompt='Password: ', stream=None, mask=''):
"""Prompt for password with echo off, using Windows getch()."""
if sys.stdin is not sys.__stdin__:
return fallback_getpass(prompt, stream)
if len(mask) > 1:
raise TypeError('mask argument must be a zero- or one-character str')

for c in prompt:
msvcrt.putwch(c)
pw = ""
while 1:
c = msvcrt.getwch()
if c == '\r' or c == '\n':
break
if c == '\003':
raise KeyboardInterrupt
if c == '\b':
if len(pw) > 0:
pw = pw[:-1]
msvcrt.putwch('\b')
msvcrt.putwch(' ')
msvcrt.putwch('\b')
else:
pw = pw + c
if mask:
msvcrt.putwch(mask)
msvcrt.putwch('\r')
msvcrt.putwch('\n')
return pw
```

I'm in favor of supporting masking. While it does reveal the password length, 
it's an accessibility feature many users have come to expect.

I'd rather have this in the standard library than have developers implement 
their own custom, potentially insecure methods for password input.

--
nosy: +stevoisiak

___
Python tracker 

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



[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Adam Olsen


Adam Olsen  added the comment:

Disagree; if you're writing signal-handling code you should be very careful to 
do it properly, even if that's only proper for your current platform.  If you 
can't do it properly you should find an alternative that doesn't involve 
signals.

The fact that sig_atomic_t is only 1 byte on VxWorks strongly implies using int 
WILL fail in strange ways on that platform.  I can see three options:

1) use pycore_atomic.h, implementing it for VxWorks if you haven't already.  
This also implies sig_atomic_t could have been int but wasn't for some reason, 
such as performance.
2) disable wakeup_fd entirely.  It's obscure, GNOME being the biggest user I 
can think of.
3) unpack the int into an array of sig_atomic_t.  Only the main thread writes 
to it so this method is ugly but viable.

--

___
Python tracker 

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



[issue31512] Add non-elevated symlink support for dev mode Windows 10

2019-04-09 Thread Steve Dower


Steve Dower  added the comment:

Done

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



[issue31512] Add non-elevated symlink support for dev mode Windows 10

2019-04-09 Thread Steve Dower


Steve Dower  added the comment:


New changeset 0e10766574f4e287cd6b5e5860a1ca75488f4119 by Steve Dower (Vidar 
Tonaas Fauske) in branch 'master':
bpo-31512: Add non-elevated symlink support for Windows (GH-3652)
https://github.com/python/cpython/commit/0e10766574f4e287cd6b5e5860a1ca75488f4119


--

___
Python tracker 

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



[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Back in 2007 the only POSIX-compliant type allowed for that was sig_atomic_t, 
> anything else was undefined.

Fair enough, but having a non-atomic type is still much better than a 
completely wrong type. In other words, the requirement of fitting a file 
descriptor is more important than being atomic.

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-04-09 Thread Stefan Behnel


Stefan Behnel  added the comment:

This is done now. Thanks everyone who helped in discussing and implementing 
this change.

I will leave Serhiy's last PR (adding the "sort_attrs" flag option) open for a 
while until I'm sure we have a better solution for comparing XML in 3.8, at 
which point I would reject it.

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



[issue36574] Error with self in python

2019-04-09 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

The error message is correct. The bug is in your code. Also, the code you tell 
us that you are running is not the same as the code you are actually running.

You should not call __init__ directly as you do:

# this is wrong
Person.__init__("Some","One",21,"American")

Do this instead:

Person("Some","One",21,"American")


Closing this as it is not a bug in Python, it is a bug in your code.

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



[issue36541] Make lib2to3 grammar more closely match Python

2019-04-09 Thread Tim Hatch


Tim Hatch  added the comment:

Here's approximately what it would look like to do the big change now: 
https://github.com/python/cpython/compare/master...thatch:lib2to3-update-grammar
 (one test failing, and some helpers may need more test coverage)

--

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 22de4ce498b656063e236350e8404981c13e1cd8 by Victor Stinner in 
branch '2.7':
bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12751)
https://github.com/python/cpython/commit/22de4ce498b656063e236350e8404981c13e1cd8


--

___
Python tracker 

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



[issue17561] Add socket.bind_socket() convenience function

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

"""
Fixed. There's a remaining failing BB:
https://buildbot.python.org/all/#/builders/176/builds/185/steps/4/logs/stdio
...but the failure appears unrelated and it has been red for a while.
"""

That's known and unrelated issue: https://bugs.python.org/issue31453

--

___
Python tracker 

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



[issue36574] Error with self in python

2019-04-09 Thread Tommy

Joan Tomas (Tommy) Pujol Muñoz  added the comment:

The python file.
It works in Linux (Ubuntu) but not in Windows; at least for me.
The output error is : 
Traceback (most recent call last):
  File "pySelf.py", line 8, in 
print(Person.__init__("Some","One",21,"American"))
TypeError: __init__() missing 1 required positional argument: 'nationality'

--
Added file: https://bugs.python.org/file48257/pySelf.py

___
Python tracker 

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



[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

I was sure that I already reported the issue... In fact, I commented  bpo-17561 
:-)

--

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2019-04-09 Thread Vy Nguyen


Change by Vy Nguyen :


--
nosy: +Vy Nguyen

___
Python tracker 

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



[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

Note: *Technically*, you can disable the compilation of the _sha512 module 
using "*disabled*" in Modules/Setup, but I'm not sure if it's a common use 
case. At least, it makes sense to me when we are sure that OpenSSL and _hashlib 
are available ;-) I didn't want to mention that since I'm not sure that it's 
really relevant in this discussion. (I was aware of the regression, and 
hopefully it's now fixed!)

--

___
Python tracker 

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



[issue36544] cannot import hashlib when openssl is missing

2019-04-09 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

Thanks Victor for the refactoring of setup.py. That was badly needed indeed.

--

___
Python tracker 

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



[issue36414] Multiple test failures in GCC and Clang optional builds on Travis CI

2019-04-09 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

FWIW PR 12708 has been merged.

--

___
Python tracker 

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



[issue35934] Add socket.create_server() utility function

2019-04-09 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

No problem. My bad that I mistyped the "BPO" thing.

--

___
Python tracker 

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



[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Those are old failures (+/- 17 hours ago). I committed:
> https://github.com/python/cpython/pull/12735

Oh, you wrote "BPO-" rather than "bpo-" and so your commit wasn't mentioned 
here:

commit 8702b67dad62a9084f6c1823dce10653743667c8
Author: Giampaolo Rodola 
Date:   Tue Apr 9 04:42:06 2019 +0200

BPO-17561: set create_server backlog default to None (GH-12735)

It turns out doing socket.listen(0) does not equal to "choose a
reasonable default". It actually means "set backlog to 0".
As such set backlog=None as the default for socket.create_server.
Fixes the following BB failures:
https://github.com/python/cpython/pull/11784#issuecomment-481036369
Ref. BPO-1756, GH-11784.

> ...which fixed them.

Oh, great! Thanks for the fix.

Sorry, I was 10 days late to handle emails from the buildbot-status mailing 
list. I only reported failures, I didn't check if it has been fixed in the 
meanwhile.

I close again the issue.

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

___
Python tracker 

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



[issue34373] test_time errors on AIX

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8709490f48fc27b3dd1a16acb33bea2299c6a575 by Victor Stinner in 
branch 'master':
bpo-34373: Fix time.mktime() on AIX (GH-12726)
https://github.com/python/cpython/commit/8709490f48fc27b3dd1a16acb33bea2299c6a575


--
nosy: +vstinner

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-04-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12678
stage: resolved -> patch review

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, the test failed on Python 2.7 on macOS:

x86-64 High Sierra 2.7
https://buildbot.python.org/all/#/builders/140/builds/211

==
FAIL: test_customize_compiler (distutils.tests.test_sysconfig.SysconfigTestCase)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/2.7.billenstein-sierra/build/Lib/distutils/tests/test_sysconfig.py",
 line 134, in test_customize_compiler
'sc_cc -E')
AssertionError: '/usr/bin/clang -E' != 'sc_cc -E'

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



[issue35934] Add socket.create_server() utility function

2019-04-09 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Those are old failures (+/- 17 hours ago). I committed:
https://github.com/python/cpython/pull/12735
...which fixed them.

--

___
Python tracker 

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



[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

s390x SLES 3.x:
https://buildbot.python.org/all/#/builders/16/builds/2625

FAIL: test_wait_socket (test.test_multiprocessing_fork.TestWait)
FAIL: test_wait_socket (test.test_multiprocessing_spawn.TestWait)
Re-running failed tests in verbose mode
Re-running test 'test_multiprocessing_fork' in verbose mode
FAIL: test_wait_socket (test.test_multiprocessing_fork.TestWait)
Re-running test 'test_multiprocessing_spawn' in verbose mode

--

___
Python tracker 

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



[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

AMD64 FreeBSD CURRENT Shared 3.x:

https://buildbot.python.org/all/#/builders/168/builds/885

test_wait (test.test_multiprocessing_spawn.TestWait) ... ok
test_wait_integer (test.test_multiprocessing_spawn.TestWait) ... ok
test_wait_slow (test.test_multiprocessing_spawn.TestWait) ... ok
Process Process-62:
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py",
 line 302, in _bootstrap
self.run()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py",
 line 99, in run
self._target(*self._args, **self._kwargs)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py",
 line 4337, in _child_test_wait_socket
s.connect(address)
ConnectionResetError: [Errno 54] Connection reset by peer
/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py:318:
 ResourceWarning: unclosed 
  traceback.print_exc()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Process Process-60:
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py",
 line 302, in _bootstrap
self.run()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py",
 line 99, in run
self._target(*self._args, **self._kwargs)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py",
 line 4337, in _child_test_wait_socket
s.connect(address)
ConnectionResetError: [Errno 54] Connection reset by peer
/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py:318:
 ResourceWarning: unclosed 
  traceback.print_exc()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Process Process-59:
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py",
 line 302, in _bootstrap
self.run()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py",
 line 99, in run
self._target(*self._args, **self._kwargs)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py",
 line 4337, in _child_test_wait_socket
s.connect(address)
ConnectionResetError: [Errno 54] Connection reset by peer
/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py:318:
 ResourceWarning: unclosed 
  traceback.print_exc()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Timeout (0:25:00)!
Thread 0x000800acc000 (most recent call first):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/socket.py", line 
212 in accept
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py",
 line 4361 in test_wait_socket
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/case.py",
 line 680 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/case.py",
 line 740 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/runner.py",
 line 176 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py",
 line 1968 in _run_suite
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py",
 line 2064 in run_unittest
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest.py",
 line 178 in test_runner
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest.py",
 line 182 in runtest_inner
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest.py",
 line 137 in runtest
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/main.py",
 line 305 in rerun_failed_tests
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/main.py",
 line 623 in _main
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/main.py",
 

[issue36560] test_functools leaks randomly 1 memory block

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 86f0354fcb815312295b923c55e39364d85d0388 by Victor Stinner in 
branch '3.7':
[3.7] bpo-36560: regrtest: don't collect the GC twice (GH-12747) (GH-12749)
https://github.com/python/cpython/commit/86f0354fcb815312295b923c55e39364d85d0388


--

___
Python tracker 

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



[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

AMD64 Ubuntu Shared 3.x:

https://buildbot.python.org/all/#/builders/141/builds/1498

FAIL: test_wait_socket (test.test_multiprocessing_fork.TestWait)
--
Traceback (most recent call last):
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/_test_multiprocessing.py",
 line 4377, in test_wait_socket
self.assertEqual(b''.join(v), expected)
AssertionError: b'1\n2\n3\n4\n5\n6\n7\n8\n9\n' != 
b'0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n'

--

___
Python tracker 

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



[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

The change broke multiple buildbots, please fix buildbots or the change will be 
reverted:
https://github.com/python/cpython/pull/11784#issuecomment-481036369

Revert on fail: https://pythondev.readthedocs.io/ci.html#revert-on-fail

--
nosy: +pablogsal, vstinner
resolution: duplicate -> 
status: closed -> open

___
Python tracker 

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



[issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x

2019-04-09 Thread STINNER Victor


New submission from STINNER Victor :

https://buildbot.python.org/all/#/builders/10/builds/2389

0:45:36 [412/420/1] test_venv crashed (Exit code 1)
Timeout (0:15:00)!
Thread 0x0001 (most recent call first):
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py",
 line 987 in communicate
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py",
 line 476 in run
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py",
 line 396 in check_output
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/venv/__init__.py",
 line 271 in _setup_pip
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/venv/__init__.py",
 line 68 in create
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/venv/__init__.py",
 line 373 in create
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py",
 line 68 in run_with_capture
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py",
 line 400 in do_test_with_pip
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py",
 line 460 in test_with_pip
...
Re-running test 'test_venv' in verbose mode
test_defaults (test.test_venv.BasicTest) ... ok
...
test_devnull (test.test_venv.EnsurePipTest) ... ok
test_explicit_no_pip (test.test_venv.EnsurePipTest) ... ok
test_no_pip_by_default (test.test_venv.EnsurePipTest) ... ok
Timeout (0:15:00)!
Thread 0x0001 (most recent call first):
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/selectors.py", 
line 415 in select
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py",
 line 1807 in _communicate
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py",
 line 1000 in communicate
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py",
 line 39 in check_output
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py",
 line 428 in do_test_with_pip
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py",
 line 460 in test_with_pip
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py",
 line 680 in run
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py",
 line 740 in __call__
  ...
test_with_pip (test.test_venv.EnsurePipTest) ... Makefile:1139: recipe for 
target 'buildbottest' failed
make: *** [buildbottest] Error 1
program finished with exit code 2

--
components: Tests
messages: 339778
nosy: David.Edelsohn, Michael.Felt, vstinner
priority: normal
severity: normal
status: open
title: test_venv: test_with_pip() hangs on PPC64 AIX 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



[issue36577] setup doesn't report missing _ssl and _hashlib

2019-04-09 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue36560] test_functools leaks randomly 1 memory block

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

> _abc was written for optimization. Your PR makes it using slower Python code. 
> Could you please test how much this hits the performance of abc?

I mostly wrote PR 12743 to debug this issue. Please see the discussion directly 
on the PR ;-)

--

___
Python tracker 

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



[issue36146] Refactor setup.py

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

For the record, I introduced a regression which has been fixed in bpo-36544.

--

___
Python tracker 

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



[issue36146] Refactor setup.py

2019-04-09 Thread miss-islington


miss-islington  added the comment:


New changeset 8abc3f4f91e6b523c761c7a6fa2e3405019803a1 by Miss Islington (bot) 
(Christian Heimes) in branch 'master':
bpo-36577: setup.py reports missing OpenSSL again (GH-12746)
https://github.com/python/cpython/commit/8abc3f4f91e6b523c761c7a6fa2e3405019803a1


--

___
Python tracker 

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



[issue36577] setup doesn't report missing _ssl and _hashlib

2019-04-09 Thread miss-islington


miss-islington  added the comment:


New changeset 8abc3f4f91e6b523c761c7a6fa2e3405019803a1 by Miss Islington (bot) 
(Christian Heimes) in branch 'master':
bpo-36577: setup.py reports missing OpenSSL again (GH-12746)
https://github.com/python/cpython/commit/8abc3f4f91e6b523c761c7a6fa2e3405019803a1


--
nosy: +miss-islington

___
Python tracker 

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



[issue36544] cannot import hashlib when openssl is missing

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

Xavier de Gaye: Oops! I also saw such errors but I didn't understand them. 
Thanks for the fix!

I wrote PR 12750 to fix another minor issue which isn't directly related to 
your fix (nor to my previous refactoring).

--

___
Python tracker 

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



[issue36544] cannot import hashlib when openssl is missing

2019-04-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12677

___
Python tracker 

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



[issue36560] test_functools leaks randomly 1 memory block

2019-04-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12676

___
Python tracker 

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



[issue36560] test_functools leaks randomly 1 memory block

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bb4447897a5f141eecf42987a1191a3330c5d7ed by Victor Stinner in 
branch 'master':
bpo-36560: regrtest: don't collect the GC twice (GH-12747)
https://github.com/python/cpython/commit/bb4447897a5f141eecf42987a1191a3330c5d7ed


--

___
Python tracker 

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



[issue36508] python-config --ldflags must not contain LINKFORSHARED ("-Xlinker -export-dynamic" on Linux)

2019-04-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12675

___
Python tracker 

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



[issue36508] python-config --ldflags must not contain LINKFORSHARED ("-Xlinker -export-dynamic" on Linux)

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e65f01f78d7bda3013fc5be485afa87ff56511d9 by Victor Stinner in 
branch 'master':
bpo-36508: python-config don't export LINKFORSHARED (GH-12661)
https://github.com/python/cpython/commit/e65f01f78d7bda3013fc5be485afa87ff56511d9


--

___
Python tracker 

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



[issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange

2019-04-09 Thread SilentGhost


SilentGhost  added the comment:

The error you're seeing stems from this bit of code:

random.randint(1, 0)

With zero resulting from `taskid % 5` operation for values of taskid divisible 
by 5. Obviously, when you comment out this line you're not seeing the error.

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange

2019-04-09 Thread 孑影

孑影  added the comment:

My python version info:

Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
[GCC 6.3.0 20170516] on linux2

Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux

--

___
Python tracker 

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



[issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange

2019-04-09 Thread 孑影

Change by 孑影 :


Added file: https://bugs.python.org/file48256/demo.py

___
Python tracker 

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



[issue36560] test_functools leaks randomly 1 memory block

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9c14061a2c2df9a9b84d0aab190a50c24a0d52f4 by Victor Stinner in 
branch '2.7':
bpo-36560: Fix reference leak hunting in regrtest (GH-12744) (GH-12745)
https://github.com/python/cpython/commit/9c14061a2c2df9a9b84d0aab190a50c24a0d52f4


--

___
Python tracker 

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



[issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange

2019-04-09 Thread 孑影

Change by 孑影 :


Removed file: https://bugs.python.org/file48255/demo.py

___
Python tracker 

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



[issue36560] test_functools leaks randomly 1 memory block

2019-04-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12674

___
Python tracker 

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



[issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange

2019-04-09 Thread 孑影

Change by 孑影 :


Removed file: https://bugs.python.org/file48254/demo.py

___
Python tracker 

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



[issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange

2019-04-09 Thread 孑影

Change by 孑影 :


Added file: https://bugs.python.org/file48255/demo.py

___
Python tracker 

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



[issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange

2019-04-09 Thread 孑影

Change by 孑影 :


Added file: https://bugs.python.org/file48254/demo.py

___
Python tracker 

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



[issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange

2019-04-09 Thread 孑影

Change by 孑影 :


Removed file: https://bugs.python.org/file48253/demo.py

___
Python tracker 

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



[issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange

2019-04-09 Thread 孑影

New submission from 孑影 :

== output ==
python2 /tmp/demo.py 
31749 task#1 result:(False, 'ls: cannot access alksdfjalkdsfadsfk: No such file 
or directoryn') 
31751 task#2 result:(False, 'ls: cannot access alksdfjalkdsfadsfk: No such file 
or directoryn') 
31752 task#3 result:(False, '3n') 
31750 task#4 result:(False, '4n') 
31749 task#6 result:(False, '6n') 
31752 task#7 result:(False, '7n') 
31750 task#8 result:(False, '8n') 
31751 task#9 result:(False, '9n') 
Traceback (most recent call last):
  File "/tmp/demo.py", line 74, in 
runner()
  File "/tmp/demo.py", line 64, in runner
rc_orig = value.get()
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 554, in get
raise self._value
ValueError: empty range for randrange() (1,1, 0)

== The python2.7 demo ==
http://paste.ubuntu.org.cn/4379593

== More ==
The interesting thing is if you modify demo.py like this .

http://paste.ubuntu.org.cn/4379595

Almost the code can be run normal.

--
components: Library (Lib)
files: demo.py
messages: 339767
nosy: 孑影
priority: normal
severity: normal
status: open
title: multiprocessing pool + subprocess ValueError: empty range for randrange
versions: Python 3.6
Added file: https://bugs.python.org/file48253/demo.py

___
Python tracker 

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



[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Adam Olsen


Adam Olsen  added the comment:

The fd field may be written from the main thread simultaneous with the signal 
handler activating and reading it out.  Back in 2007 the only POSIX-compliant 
type allowed for that was sig_atomic_t, anything else was undefined.

Looks like pycore_atomic.h should have alternatives now but I'm not at all 
familiar with it.

--

___
Python tracker 

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



[issue36544] cannot import hashlib when openssl is missing

2019-04-09 Thread Xavier de Gaye


Change by Xavier de Gaye :


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



[issue35907] Unnecessary URL scheme exists to allow file:// reading file in urllib

2019-04-09 Thread Ryan Ware


Change by Ryan Ware :


--
nosy: +ware

___
Python tracker 

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



[issue35906] Header Injection in urllib

2019-04-09 Thread Ryan Ware


Change by Ryan Ware :


--
nosy: +ware

___
Python tracker 

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



[issue30458] [CVE-2019-9740][security] CRLF Injection in httplib

2019-04-09 Thread Ryan Ware


Change by Ryan Ware :


--
nosy: +ware

___
Python tracker 

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



[issue36146] Refactor setup.py

2019-04-09 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +12673

___
Python tracker 

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



[issue36577] setup doesn't report missing _ssl and _hashlib

2019-04-09 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue36577] setup doesn't report missing _ssl and _hashlib

2019-04-09 Thread Christian Heimes


New submission from Christian Heimes :

setup does not report _ssl and _hashlib as failed to build in case OpenSSL libs 
or headers are missing. Related to #36544 and #36146



Reproducer:
$ ./configure --with-openssl=/invalid
$ make
...
running build
running build_ext

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  atexitpwd
time   

running build_scripts
...



With fix:
$ ./configure --with-openssl=/invalid
$ make
...
running build
running build_ext

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_hashlib  _ssl 
To find the necessary bits, look in setup.py in detect_modules() for the 
module's name.


The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  atexitpwd
time   


Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with 
X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, 
https://github.com/libressl-portable/portable/issues/381

running build_scripts
...

--
components: Build
messages: 339765
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: setup doesn't report missing _ssl and _hashlib
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue14817] pkgutil.extend_path has no tests

2019-04-09 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

@Windson please open a PR for review with your code.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-09 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks for pointing to the other issue. This is clearly a regression and should 
be fixed ASAP. I have ACKed your PR and pushed it.

--

___
Python tracker 

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



[issue36146] Refactor setup.py

2019-04-09 Thread miss-islington


miss-islington  added the comment:


New changeset 2ee077f7955e0349074f16a7afee40b4914619f7 by Miss Islington (bot) 
(xdegaye) in branch 'master':
bpo-36544 : Fix regression introduced in bpo-36146 (GH-12708)
https://github.com/python/cpython/commit/2ee077f7955e0349074f16a7afee40b4914619f7


--
nosy: +miss-islington

___
Python tracker 

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



[issue36544] cannot import hashlib when openssl is missing

2019-04-09 Thread miss-islington


miss-islington  added the comment:


New changeset 2ee077f7955e0349074f16a7afee40b4914619f7 by Miss Islington (bot) 
(xdegaye) in branch 'master':
bpo-36544 : Fix regression introduced in bpo-36146 (GH-12708)
https://github.com/python/cpython/commit/2ee077f7955e0349074f16a7afee40b4914619f7


--
nosy: +miss-islington

___
Python tracker 

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



[issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential)

2019-04-09 Thread cagney


cagney  added the comment:

I pointed out two issues with breaking the locks.

Your response addressed the less important issue:

- the guarantee that log records don't interleave is lost

Since the documentation seems to be silent the guarantee (or expectation) is 
implied - logging systems emit records atomically - if this isn't true across 
fork() then the exception should be documented.

but it didn't address the more fundamental problem:

- when the child enters the code 'b' is undefined

i.e., breaking the lock will allow the child to access data in an undefined 
state.  This will result in either core dumps or hangs (presumably the 
motivation for the original change was to prevent this?).

For instance, if the fork() happens while a thread is holding the  
FILE lock on a log file, then the child trying to access that FILE will hang.

--

___
Python tracker 

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



[issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition)

2019-04-09 Thread Jesse Farnham


Change by Jesse Farnham :


--
nosy: +jesse.farnham

___
Python tracker 

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



[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-09 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

> You could also use the internal _sha512 module. It's always present

This is not true at the moment, the _sha512 module is not present when openssl 
is missing. This is a bug in setup.py that prevents building the _sha512 module 
when openssl is missing. See issue 36544.

It is possible that this issue (since it started because of hashlib failures) 
and also issue 36414 are caused by this problem.

--
nosy: +xdegaye

___
Python tracker 

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



[issue36576] Some test_ssl and test_asyncio tests fail with OpenSSL 1.1.1 on Python 3.4 and 3.5

2019-04-09 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue36576] Some test_ssl and test_asyncio tests fail with OpenSSL 1.1.1 on Python 3.4 and 3.5

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

I wasn't sure if tests pass or not on OpenSSL 1.1.0. My colleague Miro checked: 
the full Python 3.5 test suite pass on Fedora 28 with OpenSSL 1.1.0.

python35 is linked to OpenSSL 1.1.0 on Fedora 28:
https://src.fedoraproject.org/rpms/python35/blob/f28/f/python35.spec#_121

Example of successful python35 build:
https://koji.fedoraproject.org/koji/buildinfo?buildID=1236291

--

___
Python tracker 

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



[issue36574] Error with self in python

2019-04-09 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

The file you have attached doesn't seem to be a Python script, it seems to be 
some sort of Windows batch file or similar.

Please supply an actual Python file. (Hint: remove the "del code.py" line from 
your batch file.) Also, copy and paste the traceback you receive, as text (not 
a screenshot).

It may help if you read this for ways to submit good bug reports:

http://www.sscce.org/


Thank you.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue36576] Some test_ssl and test_asyncio tests fail with OpenSSL 1.1.1 on Python 3.4 and 3.5

2019-04-09 Thread STINNER Victor


New submission from STINNER Victor :

On Fedora 29, test_ssl and test_asyncio when Python 3.5 is linked with OpenSSL 
1.1.1b (Fedora package openssl-1.1.1b-3.fc29.x86_64):

test_ssl:

* test_options (test.test_ssl.ContextTests)
* test_alpn_protocols (test.test_ssl.ThreadedTests)
* test_default_ecdh_curve (test.test_ssl.ThreadedTests)
* test_shared_ciphers (test.test_ssl.ThreadedTests)

test_asyncio:

* test_create_server_ssl_match_failed 
(test.test_asyncio.test_events.EPollEventLoopTests)
* test_create_server_ssl_match_failed 
(test.test_asyncio.test_events.PollEventLoopTests)
* test_create_server_ssl_match_failed 
(test.test_asyncio.test_events.SelectEventLoopTests)

Fixing these tests would require to backport some ssl features, and I don't 
think that it's worth it.

Attached PR 12694 skip these tests on OpenSSL 1.1.1.

Note: these tests pass with OpenSSL 1.1.0.

FYI for Fedora, we also care of having the Python 3.4 test suite passing with 
OpenSSL 1.1.1 and so we will maintain a similar change downstream.


==
FAIL: test_options (test.test_ssl.ContextTests)
--
Traceback (most recent call last):
  File "/home/vstinner/prog/python/3.5/Lib/test/test_ssl.py", line 866, in 
test_options
self.assertEqual(default, ctx.options)
AssertionError: 2181169236 != 2182217812

==
FAIL: test_alpn_protocols (test.test_ssl.ThreadedTests)
--
Traceback (most recent call last):
  File "/home/vstinner/prog/python/3.5/Lib/test/test_ssl.py", line 3205, in 
test_alpn_protocols
self.assertIsInstance(stats, ssl.SSLError)
AssertionError: {'client_alpn_protocol': None, 'server_alpn_protocols': [None], 
'version': 'TLSv1.2', 'client_npn_protocol': None, 'server_npn_protocols': 
[None], 'server_shared_ciphers': [[('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256), 
('TLS_CHACHA20_POLY1305_SHA256', 'TLSv1.3', 256), ('TLS_AES_128_GCM_SHA256', 
'TLSv1.3', 128), ('TLS_AES_128_CCM_SHA256', 'TLSv1.3', 128), 
('ECDHE-ECDSA-AES256-GCM-SHA384', 'TLSv1.2', 256), 
('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256), 
('ECDHE-ECDSA-AES128-GCM-SHA256', 'TLSv1.2', 128), 
('ECDHE-RSA-AES128-GCM-SHA256', 'TLSv1.2', 128), 
('ECDHE-ECDSA-CHACHA20-POLY1305', 'TLSv1.2', 256), 
('ECDHE-RSA-CHACHA20-POLY1305', 'TLSv1.2', 256), ('DHE-DSS-AES256-GCM-SHA384', 
'TLSv1.2', 256), ('DHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256), 
('DHE-DSS-AES128-GCM-SHA256', 'TLSv1.2', 128), ('DHE-RSA-AES128-GCM-SHA256', 
'TLSv1.2', 128), ('DHE-RSA-CHACHA20-POLY1305', 'TLSv1.2', 256), 
('ECDHE-ECDSA-AES256-CCM8', 'TLSv1.2', 256), ('ECDHE-ECDSA-AES256-CCM', 
'TLSv1.2', 256), ('
 ECDHE-ECDSA-AES256-SHA384', 'TLSv1.2', 256), ('ECDHE-RSA-AES256-SHA384', 
'TLSv1.2', 256), ('ECDHE-ECDSA-AES256-SHA', 'TLSv1.0', 256), 
('ECDHE-RSA-AES256-SHA', 'TLSv1.0', 256), ('DHE-RSA-AES256-CCM8', 'TLSv1.2', 
256), ('DHE-RSA-AES256-CCM', 'TLSv1.2', 256), ('DHE-RSA-AES256-SHA256', 
'TLSv1.2', 256), ('DHE-DSS-AES256-SHA256', 'TLSv1.2', 256), 
('DHE-RSA-AES256-SHA', 'SSLv3', 256), ('DHE-DSS-AES256-SHA', 'SSLv3', 256), 
('ECDHE-ECDSA-AES128-CCM8', 'TLSv1.2', 128), ('ECDHE-ECDSA-AES128-CCM', 
'TLSv1.2', 128), ('ECDHE-ECDSA-AES128-SHA256', 'TLSv1.2', 128), 
('ECDHE-RSA-AES128-SHA256', 'TLSv1.2', 128), ('ECDHE-ECDSA-AES128-SHA', 
'TLSv1.0', 128), ('ECDHE-RSA-AES128-SHA', 'TLSv1.0', 128), 
('DHE-RSA-AES128-CCM8', 'TLSv1.2', 128), ('DHE-RSA-AES128-CCM', 'TLSv1.2', 
128), ('DHE-RSA-AES128-SHA256', 'TLSv1.2', 128), ('DHE-DSS-AES128-SHA256', 
'TLSv1.2', 128), ('DHE-RSA-AES128-SHA', 'SSLv3', 128), ('DHE-DSS-AES128-SHA', 
'SSLv3', 128), ('ECDHE-ECDSA-ARIA256-GCM-SHA384', 'TLSv1.2', 256), 
('ECDHE-ARIA256-
 GCM-SHA384', 'TLSv1.2', 256), ('ECDHE-ECDSA-ARIA128-GCM-SHA256', 'TLSv1.2', 
128), ('ECDHE-ARIA128-GCM-SHA256', 'TLSv1.2', 128), 
('ECDHE-ECDSA-CAMELLIA256-SHA384', 'TLSv1.2', 256), 
('ECDHE-RSA-CAMELLIA256-SHA384', 'TLSv1.2', 256), 
('ECDHE-ECDSA-CAMELLIA128-SHA256', 'TLSv1.2', 128), 
('ECDHE-RSA-CAMELLIA128-SHA256', 'TLSv1.2', 128), 
('DHE-DSS-ARIA256-GCM-SHA384', 'TLSv1.2', 256), ('DHE-RSA-ARIA256-GCM-SHA384', 
'TLSv1.2', 256), ('DHE-DSS-ARIA128-GCM-SHA256', 'TLSv1.2', 128), 
('DHE-RSA-ARIA128-GCM-SHA256', 'TLSv1.2', 128), ('DHE-RSA-CAMELLIA256-SHA256', 
'TLSv1.2', 256), ('DHE-DSS-CAMELLIA256-SHA256', 'TLSv1.2', 256), 
('DHE-RSA-CAMELLIA128-SHA256', 'TLSv1.2', 128), ('DHE-DSS-CAMELLIA128-SHA256', 
'TLSv1.2', 128), ('DHE-RSA-CAMELLIA256-SHA', 'SSLv3', 256), 
('DHE-DSS-CAMELLIA256-SHA', 'SSLv3', 256), ('DHE-RSA-CAMELLIA128-SHA', 'SSLv3', 
128), ('DHE-DSS-CAMELLIA128-SHA', 'SSLv3', 128), ('AES256-GCM-SHA384', 
'TLSv1.2', 256), ('AES128-GCM-SHA256', 'TLSv1.2', 128), ('AES256-CCM8', 
'TLSv1.2', 256)
 , ('AES256-CCM', 'TLSv1.2', 256), ('AES128-CCM8', 'TLSv1.2', 128), 
('AES128-CCM', 'TLSv1.2', 128), ('AES256-SHA256', 'TLSv1.2', 256), 

[issue22377] %Z in strptime doesn't match EST and others

2019-04-09 Thread Paul Ganssle


Paul Ganssle  added the comment:

@Alex LordThorsen: It will accept EST if EST is one of your "local" time zones, 
so whatever's in `time.tzname`.

In the short term, I think the right thing to do would be to update the 
documentation to remove the reference to "EST", and add an explanatory note in 
the section about %Z that explains that it accepts a few hard-coded values + 
whatever's in `time.tzname`.

In the long run, I think the best "out of the box" support we can provide would 
be supporting %Z when %z is present (per Alexander's suggestion), and possibly 
something akin to `dateutil`'s "tzinfos", where a mapping between abbreviations 
and `tzinfo` objects could be passed to `strptime` explicitly.

--

___
Python tracker 

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



  1   2   >