[issue36824] Refactor str tests to reflect that str and unicode are merged in Python 3

2019-05-07 Thread Daniel Fortunov


Daniel Fortunov  added the comment:

Agreed. This functionality is in `BaseTest` (which is the base for 
`CommonTest`) and I don't propose to change this.

--

___
Python tracker 

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



[issue26278] BaseTransport.close() does not trigger connection_lost()

2019-05-07 Thread Sümer Cip

Sümer Cip  added the comment:

I do not know I still have the issue since I have circumvented the problem. I 
have been using Python3.4, I think it was one of the earliest asyncio 
implementations. The way it can be reproduced is as following: 
1) There are lots of active TCP connections connected to asyncio server 
(300-400 of them)
2) One of the clients close connection ungracefully(without sending a FIN)
3) We have a PING/PONG mechanism in the server (similar to http keep-alive), we 
call transport.close() on the socket if pong is not received within an interval.
connection_lost() event is never gets called for the socket. This is not 
happening all the time, this is a random issue, the key here is to disconnect 
client without sending a FIN and there is outgoing buffer for client.

Above is all I got.

Thanks!

--

___
Python tracker 

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



[issue36817] Add = to f-strings for easier debugging.

2019-05-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

> Except that I think that !f is not needed. You can use repr by default only 
> when no format spec is specified, and add explicit !r if you want to use repr 
> with the format spec. If you want to format the value without repr and the 
> format spec -- specify the empty format spec: f"{foo=:}".

I had this working in issue36774, but it seems like a little too much magic. It 
also prevents you from formatting the result of the repr, which works in 
f-strings without the =.

Say you wanted a fixed width output. You need to apply a format to the value of 
the repr:

>>> nums = [1/3, 1.0, 10.0, math.pi]
>>> for n in nums:
...   print(f'*{n=}*')
... 
*n=0.*
*n=1.0*
*n=10.0*
*n=3.141592653589793*

>>> for n in nums:
...   print(f'*{n=:30}*')
... 
*n=0.*
*n=1.0   *
*n=10.0  *
*n=3.141592653589793 *

If the presence of a format spec meant automatically apply the format to the 
value being printed, this wouldn't be possible.

--

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2019-05-07 Thread Alexey Muranov


Alexey Muranov  added the comment:

IMO "overriding" a method with itself should not change the behaviour. So it 
seems to me that the following is a bug:

class C:
def __init__(self, m):
print(m)

class D:
@staticmethod
def __new__(cls, *args, **kwargs):
return super(__class__, __class__).__new__(cls, *args, **kwargs)

def __init__(self, m):
print(m)

C(42) # fine
D(42) # TypeError: object.__new__() takes exactly one argument

Of course such overriding makes little sense in itself, but forbidding it makes 
even less sense and creates bugs in more complex scenarios.

--

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2019-05-07 Thread Alexey Muranov


Alexey Muranov  added the comment:

Here is a use case for writable bases:

https://stackoverflow.com/q/56007866

class Stateful:
"""
Abstract base class for "stateful" classes.

Subclasses must implement InitState mixin.
"""

@staticmethod
def __new__(cls, *args, **kwargs):
super_new = super(__class__, __class__).__new__

# XXX: see https://stackoverflow.com/a/9639512
class CurrentStateProxy(cls.InitState):
@staticmethod
def _set_state(state_cls=cls.InitState):
__class__.__bases__ = (state_cls,)

class Eigenclass(CurrentStateProxy, cls):
@staticmethod
def __new__(cls, *args, **kwargs):
cls.__new__ = None  # just in case
return super_new(cls, *args, **kwargs)

return Eigenclass(*args, **kwargs)

class StatefulThing(Stateful):
class StateA:
"""First state mixin."""

def say_hello(self):
print("Hello!")
self.hello_count += 1
self._set_state(self.StateB)
return True

def say_goodbye(self):
print("Another goodbye?")
return False

class StateB:
"""Second state mixin."""

def say_hello(self):
print("Another hello?")
return False

def say_goodbye(self):
print("Goodbye!")
self.goodbye_count += 1
self._set_state(self.StateA)
return True

# This one is required by Stateful.
class InitState(StateA):
"""Third state mixin -- the initial state."""

def say_goodbye(self):
print("Why?")
return False

def __init__(self):
self.hello_count = self.goodbye_count = 0

def say_hello_followed_by_goodbye(self):
self.say_hello() and self.say_goodbye()

# --
# ## Demo ##
# --
if __name__ == "__main__":
t1 = StatefulThing()
t2 = StatefulThing()
print("> t1, say hello:")
t1.say_hello()
print("> t2, say goodbye:")
t2.say_goodbye()
print("> t2, say hello:")
t2.say_hello()
print("> t1, say hello:")
t1.say_hello()
print("> t1, say hello followed by goodbye:")
t1.say_hello_followed_by_goodbye()
print("> t2, say goodbye:")
t2.say_goodbye()
print("> t2, say hello followed by goodbye:")
t2.say_hello_followed_by_goodbye()
print("> t1, say goodbye:")
t1.say_goodbye()
print("> t2, say hello:")
t2.say_hello()
print("---")
print( "t1 said {} hellos and {} goodbyes."
   .format(t1.hello_count, t1.goodbye_count) )
print( "t2 said {} hellos and {} goodbyes."
   .format(t2.hello_count, t2.goodbye_count) )

# Expected output:
#
# > t1, say hello:
# Hello!
# > t2, say goodbye:
# Why?
# > t2, say hello:
# Hello!
# > t1, say hello:
# Another hello?
# > t1, say hello followed by goodbye:
# Another hello?
# > t2, say goodbye:
# Goodbye!
# > t2, say hello followed by goodbye:
# Hello!
# Goodbye!
# > t1, say goodbye:
# Goodbye!
# > t2, say hello:
# Hello!
# ---
# t1 said 1 hellos and 1 goodbyes.
# t2 said 3 hellos and 2 goodbyes.

--
nosy: +alexey-muranov

___
Python tracker 

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



[issue36817] Add = to f-strings for easier debugging.

2019-05-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You can use f'*{n=!r:30}*' if you want to format the result of the repr.

In you example the format spec is applied to both the value and the literal 
representation of the expression. Is it an error? I do not think this is an 
expected behavior. If you want to apply it to both the literal expression and 
its value you can use the nested f-string: f"*{f'{n=}':30}*".

There is not too much more magic here: if both converter and format specifier 
are omitted use !r because it is a common special case. I think it is better 
than the other difference in the default converter used for debugging and 
normal formatting.

--

___
Python tracker 

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



[issue33777] dummy_threading: .is_alive method returns True after execution has completed

2019-05-07 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

It looks like the problem is that Thread._tstate_lock doesn't get released 
until Thread.join() is called. _tstate_lock is of type LockType, which has 
different definitions when using the threading module or the dummy_threading 
module. It is defined in Modules/_threadmodule.c when using the threading 
module, and in Lib/_dummy_thread.py when using the dummy_threading module.

The lock is acquired when the new thread starts and is supposed to be released 
when the thread exits. Thread.is_alive() and Thread.join() both call 
Thread._wait_for_tstate_lock(), which in turn calls 
Thread._tstate_lock.acquire(). When Thread._wait_for_tstate_lock() successfully 
acquires the lock, it calls Thread._stop() to set the Thread._is_stop flag to 
indicate that the thread has exited. The Thread._is_stop flag is checked by 
Thread.is_alive() before trying to acquire the lock.

Thread.is_alive() passes False to Thread._wait_for_tstate_lock(), while 
Thread.join() effectively passes True as the default parameter. 
Thread._wait_for_tstate_lock() then passes the parameter value to 
Thread._tstate_lock.acquire() to indicate whether to block until the lock is 
acquired (True) or try to acquire the lock and return immediately (False).

The return value of the LockType.acquire() function indicates whether (True) or 
not (False) the lock was acquired. The function defined in the dummy_threading 
module always returns True when passed True and False when passed False. Since 
Thread.is_alive() passes False to Thread._wait_for_tstate_lock() and onwards to 
Thread._tstate_lock.acquire(), Thread._tstate_lock.acquire() returns False 
which causes Thread._wait_for_tstate_lock() to skip calling Thread._stop() and 
the Thread._is_stop flag doesn't get set. Thread.is_alive() returns "not 
self._is_stop", so it always returns True.

Thread.join() passes True, so Thread._tstate_lock.acquire() returns True and 
Thread._wait_for_tstate_lock() calls Thread._stop to set the Thread._is_stop 
flag. Subsequent calls to Thread.is_alive() see that Thread._is_stop flag is 
set and return False (i.e. "not self._is_stop") without checking the lock.

In a nutshell, the way the code is written, Thread.is_alive() always returns 
True until after Thread.join() is called.

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



[issue36817] Add = to f-strings for easier debugging.

2019-05-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

> In you example the format spec is applied to both the value and the literal 
> representation of the expression. Is it an error? I do not think this is an 
> expected behavior.

No, you're misreading it. I admit that my example wasn't great. Try this one:

>>> for n in nums:
...   print(f'*{n=:+<30}*')
... 
*n=0.*
*n=1.0+++*
*n=10.0++*
*n=3.141592653589793+*

> If you want to apply it to both the literal expression and its value you can 
> use the nested f-string: f"*{f'{n=}':30}*".

Correct. There's a similar discussion in issue36774.

--

___
Python tracker 

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



[issue36825] Make TestCase aware of the command line arguments given to TestProgram

2019-05-07 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

Hi, to make unittest more extensible and for issue 18765 (having a way to run 
pdb when tests fail), I would like to make TestCase aware of the command line 
arguments given to the TestProgram so they can adapt their behavior based on 
them.

I suggested this change on python-ideas 
(https://mail.python.org/pipermail/python-ideas/2019-March/055842.html) but it 
did not get much attention.

I'm opening a PR in the hope to get more feedback and will start writing 
documentation.

Please comment if this is not appropriate or regarding anything I might have 
not thought of.

--
components: Tests
messages: 341697
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: Make TestCase aware of the command line arguments given to TestProgram
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



[issue36792] [Windows] time: crash on formatting time with de_DE locale

2019-05-07 Thread Charlie Clark


Change by Charlie Clark :


Added file: 
https://bugs.python.org/file48307/WER9DB9.tmp.WERInternalMetadata.xml

___
Python tracker 

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



[issue36792] [Windows] time: crash on formatting time with de_DE locale

2019-05-07 Thread Charlie Clark


Charlie Clark  added the comment:

The code crashes on this line:
print('count:', crt_time.strftime(buf, 1024, b'%Z', tm))

--
Added file: https://bugs.python.org/file48306/Report.wer

___
Python tracker 

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



[issue36826] ast_unparser.c doesn't handle := expressions

2019-05-07 Thread Eric V. Smith


New submission from Eric V. Smith :

If either of these lines are added to test_annotations() in 
Lib/test/test_future.py, a SystemError will be raised:

eq("(x:=10)")
eq("f'{(x:=10):=10}'")

Traceback (most recent call last):
  File "/Users/eric/local/python/cpython/Lib/test/test_future.py", line 258, in 
test_annotations
eq("(x:=10)")
  File "/Users/eric/local/python/cpython/Lib/test/test_future.py", line 134, in 
assertAnnotationEqual
actual = self.getActual(annotation)
  File "/Users/eric/local/python/cpython/Lib/test/test_future.py", line 121, in 
getActual
exec(self.template.format(ann=annotation), {}, scope)
SystemError: unknown expression kind

--
components: Interpreter Core
messages: 341699
nosy: emilyemorehouse, eric.smith, lukasz.langa
priority: release blocker
severity: normal
stage: needs patch
status: open
title: ast_unparser.c doesn't handle := expressions
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



[issue36825] Make TestCase aware of the command line arguments given to TestProgram

2019-05-07 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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

___
Python tracker 

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



[issue11107] Cache constant "slice" instances

2019-05-07 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi josh.r, this may be dump but is there a reason not to make slices hashable? 
Couldn't they hash like a tuple (start, stop, step)?

I looked around in the code, bpo and the mailing lists but could not find a 
reason why not, maybe it was just not useful at the time but could be 
implemented now?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue36823] shutil.copytree copies directories and files but fails with that same directory with '[Errno 1] Operation not permitted')

2019-05-07 Thread Windson Yang


Windson Yang  added the comment:

Just to make sure, the expected behavior would be the items should not be 
copied because of the permission and the error messages above, right?

--
nosy: +Windson Yang

___
Python tracker 

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



[issue11107] Cache constant "slice" instances

2019-05-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

To support slice constants we need to change the marshal format and introduce 
new version (current version is 4 and it was stable for several releases). If 
my memory do not betray me we already discussed this on other issue and the 
conclusion was that the benefit of this is too small for such large change.

But if we will need to add new marshal version for other reasons, supporting 
slices will be a nice addition. We just do not have enough reasons for this now.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2019-05-07 Thread Dmitry Kazakov


Change by Dmitry Kazakov :


--
pull_requests: +13067

___
Python tracker 

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



[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2019-05-07 Thread Dmitry Kazakov


Change by Dmitry Kazakov :


--
pull_requests:  -13067

___
Python tracker 

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



[issue24263] unittest cannot load module whose name starts with Unicode

2019-05-07 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

I've opened a new PR at https://github.com/python/cpython/pull/13149 with the 
commit from https://github.com/python/cpython/pull/1338 and some additional 
changes to address the review comments given by serhiy.storchaka and rbcollins

--
nosy: +a.badger

___
Python tracker 

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



[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2019-05-07 Thread Chris Withers

Chris Withers  added the comment:


New changeset 11a8832c98b3db78727312154dd1d3ba76d639ec by Chris Withers (Rémi 
Lapeyre) in branch 'master':
bpo-31855: unittest.mock.mock_open() results now respects the argument of 
read([size]) (GH-11521)
https://github.com/python/cpython/commit/11a8832c98b3db78727312154dd1d3ba76d639ec


--

___
Python tracker 

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



[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2019-05-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13068

___
Python tracker 

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



[issue36827] Overriding __new__ method with itself changes behaviour of the class

2019-05-07 Thread Alexey Muranov


New submission from Alexey Muranov :

I expect that overriding methods with themselves like in the following example 
should not change the behaviour of the class:

class C:
a = 1

def __init__(self, b):
self.b = b

def f(self, x):
return x*self.a + self.b + 1

@classmethod
def g(cls, y):
return y*cls.a + 2

@staticmethod
def h(z):
return z + 3

class D(C):
def f(self, *args, **kwargs):
return super(__class__, self).f(*args, **kwargs)

@classmethod
def g(cls, *args, **kwargs):
return super(__class__, cls).g(*args, **kwargs)

@staticmethod
def h(*args, **kwargs):
return super(__class__, __class__).h(*args, **kwargs)

c = C(7)
d = D(7)
assert c.f(42) == d.f(42)
assert c.g(42) == d.g(42)
assert c.h(42) == d.h(42)

(Moreover, I expect to be able to extend superclass method this way.)

However, this does not work with `__new__`:

class C:
def __init__(self, x):
self.x = x
print(x)

class D(C):
@staticmethod
def __new__(*args, **kwargs):
return super(__class__, __class__).__new__(*args, **kwargs)

C(7) # fine
D(7) # TypeError: object.__new__() takes exactly one argument

I think this is not a desirable feature.  I would call it a bug.

By the way, I understand why `object`'s `__init__` can complain about a wrong 
number of arguments, but I do not see a point in making `object`'s `__new__` 
complain about it.

Here is my current workaround:

class T:
@staticmethod
def __new__(cls, *_args, **_kwargs):
return object.__new__(cls)

class E(C, T):
@staticmethod
def __new__(*args, **kwargs):
return super(__class__, __class__).__new__(*args, **kwargs)

C(42) # fine
E(42) # fine

A possibly related issue: #32768 (https://bugs.python.org/issue32768)

--
components: Interpreter Core
messages: 341705
nosy: alexey-muranov
priority: normal
severity: normal
status: open
title: Overriding __new__ method with itself changes behaviour of the class
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue36545] Python 3.5 OOM during test_socket on make

2019-05-07 Thread Philip Deegan


Philip Deegan  added the comment:

This seems to be resolved on kernel 5.0.12

not it says "resource denied" and the test skips

--

___
Python tracker 

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



[issue36545] Python 3.5 OOM during test_socket on make

2019-05-07 Thread Philip Deegan


Change by Philip Deegan :


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



[issue36828] Cannot install et_xmlfile

2019-05-07 Thread Hans Ginzel

New submission from Hans Ginzel :

See attached log file, please.

How to reproduce:
rem Download 
https://www.python.org/ftp/python/3.7.3/python-3.7.3-embed-amd64.zip
mkdir C:\Tools\Python
unzip python-3.7.3-embed-amd64.zip -d C:\Tools\Python\3.7.3
path C:\Tools\Python\3.7.3;C:\Tools\Python\3.7.3\Scripts;%PATH%
echo Remove comment in "#import site" on the last line, please.
notepad C:\Tools\Python\3.7.3\python37._pth
rem Download https://bootstrap.pypa.io/get-pip.py
python get-pip.py
Collecting pip
  Downloading 
https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl
 (1.4MB)
 || 1.4MB 656kB/s
Collecting setuptools
  Downloading 
https://files.pythonhosted.org/packages/ec/51/f45cea425fd5cb0b0380f5b0f048ebc1da5b417e48d304838c02d6288a1e/setuptools-41.0.1-py2.py3-none-any.whl
 (575kB)
 || 583kB 3.2MB/s
Collecting wheel
  Downloading 
https://files.pythonhosted.org/packages/96/ba/a4702cbb6a3a485239fbe9525443446203f00771af9ac000fa3ef2788201/wheel-0.33.1-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-19.1.1 setuptools-41.0.1 wheel-0.33.1

C:\Users\Hans\Downloads>pip install --log et-xmlfile.log et-xmlfile
Collecting et-xmlfile
  Downloading 
https://files.pythonhosted.org/packages/22/28/a99c42aea746e18382ad9fb36f64c1c1f04216f41797f2f0fa567da11388/et_xmlfile-1.0.1.tar.gz
ERROR: Command "python setup.py egg_info" failed with error code 1 in 
C:\Users\Hans\AppData\Local\Temp\pip-install-qws9gvg0\et-xmlfile\

--
components: Installation
files: et-xmlfile.log
messages: 341707
nosy: hginzel
priority: normal
severity: normal
status: open
title: Cannot install et_xmlfile
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48308/et-xmlfile.log

___
Python tracker 

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



[issue36829] CLI option to make PyErr_WriteUnraisable abortthe current process

2019-05-07 Thread Thomas Grainger


New submission from Thomas Grainger :

Currently it's quite easy for these errors to go unnoticed.

I'd like a way to easily detect these in CI.

nedbat suggested piping the process output to another tool, and looking for 
'Exception ignored in:' but this seems a little diff

--
components: Interpreter Core
messages: 341708
nosy: graingert
priority: normal
severity: normal
status: open
title: CLI option to make PyErr_WriteUnraisable abortthe current process
type: enhancement

___
Python tracker 

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



[issue36828] Cannot install et-xmlfile

2019-05-07 Thread Hans Ginzel


Change by Hans Ginzel :


--
title: Cannot install et_xmlfile -> Cannot install et-xmlfile

___
Python tracker 

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



[issue36827] Overriding __new__ method with itself changes behaviour of the class

2019-05-07 Thread SilentGhost


SilentGhost  added the comment:

It seems you're misunderstanding the point of __new__ and your usage of it is a 
bit strange. You're getting an error because you're ultimately calling 
object.__new__ which doesn't accept any other arguments but the class for 
instantiation. I'd suggest the documentation for object.__new__ 
(https://docs.python.org/3/reference/datamodel.html#object.__new__) and the 
Data model page in general.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue36827] Overriding __new__ method with itself changes behaviour of the class

2019-05-07 Thread Alexey Muranov


Alexey Muranov  added the comment:

The issue is the following: i expect overriding a method with itself to not 
change behaviour of the class.  I do not see how my understanding of `__new__` 
or its point could be relevant.

Do we agree that overriding a method with itself should not change behaviour?  
Is there a more correct way to do it than

def foo(self, *args, **kwarg):
# possible extensions
# ...
super(__class__, self).foo(*args, **kwarg)

(modified accordingly for class and static methods)?

When I do not override `__new__`, I expect Python to use `object`'s `__new__` 
(or at least pretend that it does). Therefore there should be no difference in 
behaviour.

--

___
Python tracker 

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



[issue36827] Overriding __new__ method with itself changes behaviour of the class

2019-05-07 Thread Alexey Muranov


Alexey Muranov  added the comment:

Incidentally, the documentation gives the following signature of __new__:

object.__new__(cls[, ...])

which suggests a variable number of arguments.

--

___
Python tracker 

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



[issue36812] posix_spawnp returns error when used with file_actions

2019-05-07 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

The error message is reporting the path.  However, it is only the path 
component that is specified in the call to the function.  

This behaviour is not limited to the posix_spawnp() function but happens with 
any interface that can look up a command in the path.  For instance, here's 
what subprocess.Popen() gives me when I look use it against a 0644 file that is 
present in my PATH:

>>> subprocess.Popen(['fever.py'])
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
  File "/usr/lib64/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: 'fever.py'

--
nosy: +a.badger

___
Python tracker 

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



[issue36828] Cannot install et-xmlfile

2019-05-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

et-xmlfile is not a part of CPython and this tracker is for bugs in CPython. I 
would suggest following up with the project repo on this and close this as 
third party issue.

--
nosy: +xtreak

___
Python tracker 

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



[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2019-05-07 Thread Chris Withers


Chris Withers  added the comment:


New changeset a6516f89aa0f416c7514ac364bb48ac7d1455487 by Chris Withers (Miss 
Islington (bot)) in branch '3.7':
bpo-31855: unittest.mock.mock_open() results now respects the argument of 
read([size]) (GH-11521) (#13152)
https://github.com/python/cpython/commit/a6516f89aa0f416c7514ac364bb48ac7d1455487


--

___
Python tracker 

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



[issue36830] Typo in collections.deque

2019-05-07 Thread keroru


New submission from keroru :

https://docs.python.org/ja/3/library/collections.html#collections.deque

has a typo in description of "rotate(n=1)" in Japanese.
I suppose that "d.appendleft(d.popleft())" should be "d.append(d.popleft())".

Thank you!

--
assignee: docs@python
components: Documentation
messages: 341715
nosy: docs@python, keroru
priority: normal
severity: normal
status: open
title: Typo in collections.deque
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



[issue36830] Typo in collections.deque

2019-05-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thank you for the report. English translation has the following text and I 
guess you are right at [0] . The tracker deals with English translation. Please 
consider reporting this to https://github.com/python/python-docs-ja which also 
accepts PR.

[0] https://docs.python.org/3/library/collections.html#collections.deque.rotate

Rotate the deque n steps to the right. If n is negative, rotate to the left.

When the deque is not empty, rotating one step to the right is equivalent 
to d.appendleft(d.pop()), and rotating one step to the left is equivalent to 
d.append(d.popleft()).

--
nosy: +xtreak

___
Python tracker 

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



[issue36830] Typo in collections.deque

2019-05-07 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi @keroru,

This is issue is related to the Japanese translation, not to the official 
documentation.

Please, try to contact the translators. 

I am adding Julien, maybe he has the contact of the translators.

--
nosy: +matrixise, mdk
resolution:  -> wont fix
status: open -> pending

___
Python tracker 

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



[issue36829] CLI option to make PyErr_WriteUnraisable abortthe current process

2019-05-07 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Serhiy,

What do you think about this idea?

Normally, we could use -W error when there is an exception.

--
nosy: +matrixise, serhiy.storchaka

___
Python tracker 

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



[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2019-05-07 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

PR was merged and backported to 3.7. So I am closing this as fixed. Thanks Rémi 
for the patch.

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



[issue36831] ElementTree.find attribute matching with empty namespace

2019-05-07 Thread Steve Dower


New submission from Steve Dower :

I suspect this is related to the fix for issue30485, but haven't fully debugged 
it.

In PC/layout/support/appxmanifest.py, I have code that looks up an existing 
element and adds it if missing:

def find_or_add(xml, element, attr=None, always_add=False):
if always_add:
e = None
else:
q = element
if attr:
q += "[@{}='{}']".format(*attr)
e = xml.find(q, APPXMANIFEST_NS)
if e is None:
...
return e

For my 3.8.0a4 build, this started failing to match elements with attributes 
included. As a result, I ended up with N elements in a space where the schema 
only allows 1, and part of the 3.8.0a4 release is now blocked (okay, it's 
unblocked because I manually fixed a file and built the rest by hand, but it 
still held things up by a day).

I found that by removing the empty string entry in my namespaces dictionary the 
issue is fixed:

APPXMANIFEST_NS = {
#"": "http://schemas.microsoft.com/appx/manifest/foundation/windows10";,
"m": "http://schemas.microsoft.com/appx/manifest/foundation/windows10";,
...
}

So I'm not exactly sure what's going on, but as code that worked fine in 
3.8.0a3 and earlier now no longer works, I think we should see whether it was a 
deliberate break or accidental. If there's no reason to regress users, I'd 
prefer to avoid it.

--
components: XML
keywords: 3.7regression
messages: 341721
nosy: eli.bendersky, lukasz.langa, scoder, steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: ElementTree.find attribute matching with empty namespace
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



[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

2019-05-07 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi hniksic,

Could you add your Github Account to your BPO account, without that, we can't 
work on your PR, and you need to sign the CLA.

Thank you

--
nosy: +matrixise

___
Python tracker 

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



[issue36817] Add = to f-strings for easier debugging.

2019-05-07 Thread Larry Hastings


Larry Hastings  added the comment:

> I think that !f is not needed. You can use repr by default only when
> no format spec is specified, and add explicit !r if you want to use
> repr with the format spec.

Actually that's how !d worked.  We changed the behavior because it was too 
"magical".  We need to keep the f-strings format spec simple so it was easier 
to remember.  I for one already have difficulty remembering how f-string 
formatting works, I don't want to make add even more complications.

In the current proposal, the special syntax must be specified in a particular 
order, and the order is easy to remember because information always flows from 
left-to-right. The "=" must come before the "!" and/or the ":", and the "!" 
must come before the ":".  Like so:

   f'{foo
 =
  !s
:20}'

Modification information strictly flows from left to right:

* The = changes the "conversion function" to repr, but then you can override 
the conversion function with !.

* The : format spec runs __format__ on the stuff to its left; if you're using 
the "format" conversion function, it applies the spec directly, otherwise it 
calls format with that spec to the output (the string) you got from the 
conversion function.


If we made the default conversion function when using = dependent on the 
presence or absence of the format spec, now we have information flowing to the 
left, all the way from the end to the beginning.  Eric and I agree: this is too 
magical and too hard to remember.  We want to keep it simple.

(True story: Eric had the !d implementation already done and ready for checkin. 
 When he changed it to this = syntax he actually mostly *threw out* code, 
because this way is simpler and more regular.  Hopefully you're thinking "well 
THAT sounds nice!"--we agree.)

--

___
Python tracker 

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



[issue36831] ElementTree.find attribute matching with empty namespace

2019-05-07 Thread Steve Dower


Steve Dower  added the comment:

Here is a test case that fails on 3.8.0a4 and succeeds on 3.7.3:

def test_find_attribute_with_empty_ns(self):
NS = "http://effbot.org/ns";
element = ET.fromstring(f"")
self.assertIsNotNone(element.find("t:section[@id='1']", {"":NS, 
"t":NS}))

--

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-07 Thread Miro Hrončok

Miro Hrončok  added the comment:

I'll work on 3.7 backport.

--
nosy: +hroncok

___
Python tracker 

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



[issue27639] UserList.__getitem__ doesn't account for slices

2019-05-07 Thread Michael Blahay


Michael Blahay  added the comment:

Thank you for bringing up that PR. My team will review and try to find out why 
it was closed without a merge.

--

___
Python tracker 

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



[issue27639] UserList.__getitem__ doesn't account for slices

2019-05-07 Thread Michael Blahay


Michael Blahay  added the comment:

Please note that I am working with Erick Cervantes at PyCon2019 on this issue.

--

___
Python tracker 

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



[issue36832] Port zipp to zipfile

2019-05-07 Thread Jason R. Coombs


New submission from Jason R. Coombs :

The [zipp package](https://pypi.org/project/zipp) implements a 
pathlib-compatable wrapper for zipfiles and is used by the importlib_metadata 
project. The port of importlib_metadata to importlib.metadata (issue34632) 
currently embeds that functionality, but this functionality is probably better 
exposed as part of the zipfile or pathlib modules.

Yesterday, at PyCon sprints, we considered which stdlib module would be better 
to host this functionality, and a quick analysis revealed that there's no 
pathlib dependency but there is a zipfile dependency, suggesting that zipfile 
should be preferred.

--
assignee: jaraco
messages: 341727
nosy: barry, jaraco
priority: normal
severity: normal
status: open
title: Port zipp to zipfile

___
Python tracker 

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



[issue36832] Port zipp to zipfile

2019-05-07 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
components: +Library (Lib)
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



[issue27639] UserList.__getitem__ doesn't account for slices

2019-05-07 Thread Dmitry Kazakov


Change by Dmitry Kazakov :


--
pull_requests: +13069

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-07 Thread Kubilay Kocak


Change by Kubilay Kocak :


--
nosy: +koobs

___
Python tracker 

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



[issue36827] Overriding __new__ method with itself changes behaviour of the class

2019-05-07 Thread SilentGhost


Change by SilentGhost :


--
nosy: +rhettinger

___
Python tracker 

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



[issue36827] Overriding __new__ method with itself changes behaviour of the class

2019-05-07 Thread Alexey Muranov


Alexey Muranov  added the comment:

I've noticed some faults in my code examples: `super(__class__, __class__)` 
instead of a more appropriate `super(__class__, cls)`, forgotten `return` 
before `super(__class__, self).foo(*args, **kwarg)`, maybe there are more.  I 
cannot edit previous comments, but this does not affect the main point.

I've stumbled on this behaviour in a situation where it actually poses me a 
problem.  However, here is some analogy: if a calculator returns 0 as the 
result of a multiplication of any number by 1, this cannot be justified by 
saying that no one needs to multiply numbers by 1 anyway.

--

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2019-05-07 Thread Julien Palard


Julien Palard  added the comment:

I rebased the conglomerate patch onto current master, and there's only  three 
methods left, in floatobject.c, it's three methods inside a #if 0, it does not 
looks interesting to merge it (30 insertions, 12 deletions), so I'm closing 
this issue.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

After discussing this with Guido, we're going to go with a tweaked version of 
the '=' version of this in issue36817. So, I'm going to close this and continue 
the discussion there.

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

___
Python tracker 

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



[issue36832] Port zipp to zipfile

2019-05-07 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue36833] Add tests for Datetime C API Macros

2019-05-07 Thread Paul Ganssle


New submission from Paul Ganssle :

This is a child issue for bpo 36782, specifically for testing the macro-only 
datetime C API functions

Untested macros with no corresponding API module:

- PyDateTime_GET_YEAR
- PyDateTime_GET_MONTH
- PyDateTime_GET_DAY
- PyDateTime_DATE_GET_HOUR
- PyDateTime_DATE_GET_MINUTE
- PyDateTime_DATE_GET_SECOND
- PyDateTime_DATE_GET_MICROSECOND

- PyDateTime_TIME_GET_HOUR
- PyDateTime_TIME_GET_MINUTE
- PyDateTime_TIME_GET_SECOND
- PyDateTime_TIME_GET_MICROSECOND

- PyDateTime_DELTA_GET_DAYS
- PyDateTime_DELTA_GET_SECONDS
- PyDateTime_DELTA_GET_MICROSECONDS

For all of these, I think you can write one "wrapper function" that just 
extracts all fields as a tuple (4 C API wrapper functions - date, datetime, 
time, timedelta).

For each function, test with both the standard class and a subclass.

--
assignee: p-ganssle
components: Tests
messages: 341731
nosy: edison.abahurire, p-ganssle
priority: normal
severity: normal
status: open
title: Add tests for Datetime C API Macros
type: enhancement

___
Python tracker 

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



[issue11107] Cache constant "slice" instances

2019-05-07 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Remi: The reason they're not hashable is presumably because it would make them 
valid dictionary keys, further confusing the difference between sequences and 
mappings. x[::-1] would, for a sequence, return a reversed sequence, but for a 
mapping, would end up using the slice as a key (not actually slicing) to obtain 
a single value. Confusing at best.

Serhiy: It was discussed on the other issue, but the rationale there was, to 
quote Raymond:

* too many other things need to be changed to support it
* the measured win is somewhat small
* we have a negative bias towards expanding the peephole optimizer
* the AST may be a better place to do these kind of optimizations

Of those, only the first bullet is (essentially) unchanged. Addressing the 
following points in order:

* The win will likely be higher given that the __getslice__ protocol no longer 
exists; where slice objects need not be constructed in many cases in Python 2 
(which had the SLICE+N bytecodes to perform subscripting directly, without a 
separate code to build a slice), leaving only slices with a step dependent on 
actually building slices. Nowadays, x[:-1] requires building a slice object, as 
does x[1:] and the like, where previously they did not
* The approach I'm taking does not use the peephole optimizer in any way
* I'm making the changes in the AST optimizer

Perhaps the issues with "too many other things need to be changed" remain, but 
I'd like to at least have a PR in place so that, should the marshalling format 
change be accepted, we'd be able to take advantage of it.

Side-note: The marshal code for marshalling slices that I chose was ':'; seemed 
rather appropriate for slices, and conveniently, it was not already in use. :-)

--

___
Python tracker 

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



[issue36817] Add = to f-strings for easier debugging.

2019-05-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

After discussing this with Guido and Larry, we're going to go with the 
"implicit format mode", as outlined by Serhiy, and drop the !f feature.

So the rules are:
{x=} -> "x="+repr(x)
{x=:.2f} -> "x="+format(x, ".2f")
{x=:} -> "x="+format(x, "")
{x=:!s:20} -> "x="+format(str(x), "20")
{x=:!r:20} -> "x="+format(repr(x), "20")

I think the 95% case will be {x=}, the 99%+ case will be {x=:2f} case. So I'm 
happy with this outcome. All functionality you had available with !f is still 
available, but with slightly different spellings. The most common cases now 
have the shortest spellings.

--

___
Python tracker 

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



[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-07 Thread Brian Quinlan


Brian Quinlan  added the comment:

Hey Hrvoje,

I agree that #1 is the correct approach. `disown` might not be the best name - 
maybe `allow_shutdown` or something. But we can bike shed about that later.

Are you interested in writing a patch?

--

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-07 Thread Miro Hrončok

Change by Miro Hrončok :


--
pull_requests: +13071

___
Python tracker 

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



[issue36829] CLI option to make PyErr_WriteUnraisable abortthe current process

2019-05-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It looks like a good idea to me. But it should not be -W error. It should be an 
-X option, and this option should be used exclusively for debugging user 
extension modules.

--
nosy: +vstinner

___
Python tracker 

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



[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

2019-05-07 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

How do I connect the accounts?

Please note that I've previously submitted PRs which have been accepted, e.g. 
https://bugs.python.org/issue34476 and https://bugs.python.org/issue35465

--

___
Python tracker 

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



[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-07 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

> Are you interested in writing a patch?

Yes - I wanted to check if there is interest in the feature before I commit 
time to write the patch, documentation, tests, etc. (And also I wanted to check 
if there's a better way to do it.)

In any case, thanks for picking up on this.

> `disown` might not be the best name - maybe `allow_shutdown` or something.

Disown is an admittedly obscure reference to the shell built-in of the same 
name (https://tinyurl.com/qfn8ao7). The idea is to get the point across that 
the pool is truly abandoned, and its running futures are left to their own 
devices. Maybe wait_at_exit would be a clearer name:

pool.shutdown(wait=False, wait_at_exit=True)

--

___
Python tracker 

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



[issue36834] mock.patch.object does not persist __module__ name for functions

2019-05-07 Thread Sam Park


New submission from Sam Park :

The expectation is that the __module__ attribute for a patched function should 
persist after patching.

Minimal test case is attached. Simply run pytest in a venv with the files.

Output:
def test_zxc():
with mock.patch.object(mymodule, 'asd', side_effect=mymodule.asd, 
autospec=True) as spy_asd:
>   assert spy_asd.__module__ == 'mymodule'
E   AssertionError: assert None == 'mymodule'
E+  where None = .__module__

test_mymodule.py:8: AssertionError

Originally reported at https://github.com/pytest-dev/pytest-mock/issues/146 
before it was determined this was a unittest.mock issue.

Happens on both Python 2.7 and 3.7. Probably not really tied to a specific 
Python version and more of mock library issue.

My local venv:
Python 3.7.2
pytest 4.4.1

--
components: Library (Lib), Tests
files: minimal-test-case.zip
messages: 341738
nosy: spark
priority: normal
severity: normal
status: open
title: mock.patch.object does not persist __module__ name for functions
versions: Python 2.7, Python 3.7
Added file: https://bugs.python.org/file48309/minimal-test-case.zip

___
Python tracker 

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



[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

2019-05-07 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

Ok, found it, and I've now updated the github name on my bpo account. I'll 
gladly sign the CLA if needed, I thought it wasn't necessary for small changes 
based on previous experience. Please advise whether it's necessary here.

--

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-07 Thread Miro Hrončok

Change by Miro Hrončok :


--
pull_requests: +13072

___
Python tracker 

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



[issue35354] Generator functions stack overflow

2019-05-07 Thread Mark Shannon


Mark Shannon  added the comment:

I'm closing this as a duplicate of https://bugs.python.org/issue6028

Making a recursive call in an except block cannot be handled sensibly by the 
interpreter. 

On exceeding the stack depth, the interpreter will raise a RecursionError.
Catching a RecursionError and then making a call will blow the stack, leaving 
the interpreter with no choice; it has to abort.

--
nosy: +Mark.Shannon
resolution:  -> duplicate
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



[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-05-07 Thread Brian Quinlan


Brian Quinlan  added the comment:

Hey Brian,

I understand the non-determinism. I was wondering if you had a non-theoretical 
example i.e. some case where the non-determinism had impacted a real test that 
you wrote?

--

___
Python tracker 

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



[issue36783] No documentation for _FromXandFold C API functions

2019-05-07 Thread Cheryl Sabella


Cheryl Sabella  added the comment:


New changeset 5765ecf79fcee987f2f97c246c64b494324dfd33 by Cheryl Sabella 
(Edison A) in branch 'master':
bpo-36783: Added C API Documentation for Time_FromTimeAndFold and 
PyDateTime_FromDateAndTimeAndFold (GH-13147)
https://github.com/python/cpython/commit/5765ecf79fcee987f2f97c246c64b494324dfd33


--

___
Python tracker 

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



[issue18387] Add 'symbols' link to pydoc's html menu bar.

2019-05-07 Thread Sanyam Khurana


Sanyam Khurana  added the comment:

Hey Ron,

Friendly ping :)

Can you please convert this into a pull request?

--
nosy: +CuriousLearner
versions: +Python 3.9

___
Python tracker 

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



[issue36783] No documentation for _FromXandFold C API functions

2019-05-07 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@edison.abahurire, thanks for the PR!

--

___
Python tracker 

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



[issue28866] Type cache is not correctly invalidated on a class defining mro()

2019-05-07 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +13074

___
Python tracker 

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



[issue36783] No documentation for _FromXandFold C API functions

2019-05-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13073

___
Python tracker 

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



[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

2019-05-07 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

If I read the Licensing section into the devguide, a contributor (me, your, 
etc..) has to sign the CLA. 

https://devguide.python.org/pullrequest/#cla

"To accept your change we must have your formal approval for distributing your 
work under the PSF license."

the verb is must -> required!

Thank you

--

___
Python tracker 

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



[issue36783] No documentation for _FromXandFold C API functions

2019-05-07 Thread Cheryl Sabella


Change by Cheryl Sabella :


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

___
Python tracker 

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



[issue33153] interpreter crash when multiplying large tuples

2019-05-07 Thread Mark Shannon


Mark Shannon  added the comment:

I can't reproduce on 2.7.15rc1 on an x64 machine.
Can you confirm that this is still an issue?

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue27639] UserList.__getitem__ doesn't account for slices

2019-05-07 Thread Michael Blahay


Michael Blahay  added the comment:

Let it be known that the author of PR 4981 is known as vaultah. He/she 
personally closed the pull request this morning stating a lack of need to be 
recognized for the work. Per his/her instructions I am reviewing the changes 
and incorporating in our solution as needed. Thank you vaultah!

--

___
Python tracker 

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



[issue36783] No documentation for _FromXandFold C API functions

2019-05-07 Thread miss-islington


miss-islington  added the comment:


New changeset 146010ea42fb949a48a1b79a13503995a5176833 by Miss Islington (bot) 
in branch '3.7':
bpo-36783: Added C API Documentation for Time_FromTimeAndFold and 
PyDateTime_FromDateAndTimeAndFold (GH-13147)
https://github.com/python/cpython/commit/146010ea42fb949a48a1b79a13503995a5176833


--
nosy: +miss-islington

___
Python tracker 

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



[issue28795] Misleading stating, that SIGINT handler is installed by default

2019-05-07 Thread Julien Palard


Change by Julien Palard :


--
stage: patch review -> backport needed

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-07 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 7e200e0763f5b71c199aaf98bd5588f291585619 by Gregory P. Smith 
(Miro Hrončok) in branch '3.7':
bpo-30458: Disallow control chars in http URLs. (GH-12755) (GH-13154)
https://github.com/python/cpython/commit/7e200e0763f5b71c199aaf98bd5588f291585619


--

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-07 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue28795] Misleading stating, that SIGINT handler is installed by default

2019-05-07 Thread Julien Palard


Julien Palard  added the comment:

Thanks for reporting Jan! It's finally merged \o/

--
resolution:  -> fixed
stage: backport needed -> 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



[issue36829] CLI option to make PyErr_WriteUnraisable abortthe current process

2019-05-07 Thread Thomas Grainger


Thomas Grainger  added the comment:

> this option should be used exclusively for debugging user extension modules.

I have a very large codebase that fires the odd ResourceWarning, and after 
fixing them all I'd like to ensure that they do not reoccur. When using `-W 
error` it still won't fail CI. So I would use this -X option for more than 
debugging user extension modules

--

___
Python tracker 

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



[issue28795] Misleading stating, that SIGINT handler is installed by default

2019-05-07 Thread Julien Palard


Julien Palard  added the comment:


New changeset e85ef7a7eacdef2f43e6bf2e67f335100e7ef2da by Julien Palard in 
branch 'master':
bpo-28795: Signal documentation: Fix misleading statement. (GH-13121)
https://github.com/python/cpython/commit/e85ef7a7eacdef2f43e6bf2e67f335100e7ef2da


--

___
Python tracker 

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



[issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions

2019-05-07 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

Additionally, the os module is supposed to closely follow the behaviour of the 
underlying operating system functions: 
https://docs.python.org/3/library/os.html  

> The design of all built-in operating system dependent modules of Python is 
> such that as long as the same functionality is available, it uses the same 
> interface; [..]

The POSIX symlimk function on which this is based has made the decision not to 
overwrite an existing symlink (See the EEXIST error in 
https://pubs.opengroup.org/onlinepubs/009695399/functions/symlink.html or man 
pages on symlink from one of the Linux distros: 
http://man7.org/linux/man-pages/man2/symlink.2.html )   As with many other 
POSIX-derived filesystem functions, the technique you propose, relying on 
atomic filesystem renames) would seem to be the standard method of writing 
race-resistant code.  Due to the mandate for the os module, it feels like that 
belongs in a utility function in custom code or another module rather than 
something for the os module.

A couple of thoughts on what you could do instead:

* A collection of utility functions that fixed race-conditions in filesystem 
handling could make a nice third party module on pypi.

* The stdlib shutil module provides an API that's supposed to be easier to 
implement common use cases than the os.* functions.  Perhaps you could propose 
your idea to the python-ideas mailing list as a new function in that module and 
see what people think of that?

--
nosy: +a.badger

___
Python tracker 

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



[issue28795] Misleading stating, that SIGINT handler is installed by default

2019-05-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13075

___
Python tracker 

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



[issue36792] [Windows] time: crash on formatting time with de_DE locale

2019-05-07 Thread Charlie Clark


Charlie Clark  added the comment:

If the process crashes at the first print statement, I'm not sure how I can run 
the tests. Or should I try them separately?

--

___
Python tracker 

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



[issue36792] [Windows] time: crash on formatting time with de_DE locale

2019-05-07 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Thanks for your patience with this Charlie, but please try another run this 
time without the strftime() and mbstowcs() calls.  Honest, we are getting 
closer!

--

___
Python tracker 

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



[issue36812] posix_spawnp returns error when used with file_actions

2019-05-07 Thread Matthew Tanous


Matthew Tanous  added the comment:

Your example is an attempt to use Popen to run a file you don't have execute 
permissions for.

In my example, it is not `whoami` that it is failing to create/open, but 
'.tmp/temp_file'.  I would expect a `PermissionError: [Errno 13] Permission 
denied: '.tmp/temp_file'` returned.

--

___
Python tracker 

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



[issue36834] mock.patch.object does not persist __module__ name for functions

2019-05-07 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

I guess the problem is that to patch 'bar' in foo.bar the signature of bar is 
taken and then it's evaluated using exec [1] where the function body has 
_check_sig that checks for the signature during function call. _check_sig has 
attributes of func copied. Since it's evaluated using exec the returned funcopy 
variable might not have __module__ set as per the execution context. One 
possible approach would be to _copy_func_details(func, funcopy) so that the 
__module__ and other attributes are copied. 

This produces a test failure where in case of lambdas the __name__ is  
which is not a valid identifier and hence funcopy is used. Then __name__ is set 
as '' by my patch. Hence, 'funcopy' is replaced by '' causing 
below test failure. This could be resolved by setting __name__ again to the 
expected value. This was newly added for test coverage with 
adbf178e49113b2de0042e86a1228560475a65c5.

My main worry is that it's used in create_autospec hence do we really want to 
copy __module__ and others to the patched function for places with 
create_autospec also with functions supplying autospec=True. This is a user 
expectation but I would like to know maintainers opinion as well of this change.


Reproducer 

# cat /tmp/foo.py

def bar(a: int):
pass

# /tmp/bar.py
from unittest import mock

import foo

with mock.patch.object(foo, 'bar', autospec=True) as mocked_attribute:
assert mocked_attribute.__module__ == 'foo'


# Python 3.7 __module__ is None
➜  cpython git:(master) ✗ python3.7 /tmp/bar.py
Traceback (most recent call last):
  File "/tmp/bar.py", line 6, in 
assert mocked_attribute.__module__ == 'foo', f'__module__ is 
{mocked_attribute.__module__}'
AssertionError: __module__ is None

# With patch

➜  cpython git:(master) ✗ ./python.exe /tmp/bar.py # No failure

# Patch

diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 1e8057d5f5..a7006fcf7d 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -165,6 +165,8 @@ def _set_signature(mock, original, instance=False):
 exec (src, context)
 funcopy = context[name]
 _setup_func(funcopy, mock, sig)
+_copy_func_details(func, funcopy)
+funcopy.__name__ = name
 return funcopy


# Test failure without funcopy.__name__ = name in my patch where I don't 
restore the 'funcopy' for lambdas. But this can be fixed.

==
FAIL: test_spec_function_no_name 
(unittest.test.testmock.testhelpers.SpecSignatureTest)
--
Traceback (most recent call last):
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/test/testmock/testhelpers.py",
 line 946, in test_spec_function_no_name
self.assertEqual(mock.__name__, 'funcopy')
AssertionError: '' != 'funcopy'
- 
+ funcopy


--
Ran 386 tests in 2.911s

[1] 
https://github.com/python/cpython/blob/e85ef7a7eacdef2f43e6bf2e67f335100e7ef2da/Lib/unittest/mock.py#L165

--
nosy: +cjw296, mariocj89, michael.foord, xtreak
type:  -> behavior
versions: +Python 3.8 -Python 2.7

___
Python tracker 

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



[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

2019-05-07 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I would say that unblock order is an implementation detail (which is unlikely 
be changed though).

I'm biased how should we document it.
Yuri, your opinion is very welcome.

--

___
Python tracker 

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



[issue28795] Misleading stating, that SIGINT handler is installed by default

2019-05-07 Thread miss-islington


miss-islington  added the comment:


New changeset 721729fca4fab9fd11861844880b3f3780015ae0 by Miss Islington (bot) 
in branch '3.7':
bpo-28795: Signal documentation: Fix misleading statement. (GH-13121)
https://github.com/python/cpython/commit/721729fca4fab9fd11861844880b3f3780015ae0


--
nosy: +miss-islington

___
Python tracker 

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



[issue36792] [Windows] time: crash on formatting time with de_DE locale

2019-05-07 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

You can safely execute each line individually (omitting the aforementioned 
count/value pairs) or depending on how the copy/paste is being done, just paste 
the script into a text editor (notepad) and comment out those lines.  Then 
copy-paste that modified script.

This time I'm really attempting to see if the internal encoding/decoding done 
in the CRT strftime() is failing somehow (it calls wcsftime).

--

___
Python tracker 

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



[issue13824] argparse.FileType opens a file and never closes it

2019-05-07 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Mitar: argparse.FileType's __call__ (which is what "parses" the argument) 
returns whatever open (aka io.open) returns. Basically, post-parsing, there is 
nothing about the result of FileType that distinguishes it from a manually 
opened file (or when '-' is passed, from stdin/stdout). So it's already 
possible to do what you describe, simply by doing:

parser = argparse.ArgumentParser()
parser.add_argument('input', type=argparse.FileType())
arguments = parser.parse_args()

with arguments.input as f:
   assert arguments.input is f

That already "open[s] eagerly as now, but it would be closed at exit from 
context manager."

The original report did not like that you couldn't prevent clobbering of an 
existing file in write mode (no longer true, since you can pass a mode of 'x' 
just like you can with open), and did not like that the result of parsing was 
implicitly opened immediately without being controllable *immediately* via a 
context manager.

The only real solutions to that problem are either:

1. Making FileType (or a replacement) that is lazier in some way.
2. Making the argument namespace itself support context management

The proposal to check validity and return a curried call to open is problematic 
given the TOCTOU issues, but a curried version that performs little or no 
checks up front, but performs argparse style clean exits if the deferred open 
fails would be reasonable.

The alternative would be to integrate more heavily with the argument namespace, 
such that you could write code like:

with parser.parse_args() as arguments:

and in that scenario, the files would be opened immediately and stored on the 
namespace, but either only FileType, or any type result supporting context 
management, would be bulk __enter__-ed and bulk __exit__-ed upon exiting the 
with block.

As is, a user could do most of this with contextlib.ExitStack, but it's more to 
reimplement (and tricky to get right, and would still rely on argparse to clean 
up files 1 through n-1 if opening file n fails for whatever reason before 
parsing completes).

--
nosy: +josh.r

___
Python tracker 

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



[issue36792] [Windows] time: crash on formatting time with de_DE locale

2019-05-07 Thread Charlie Clark


Charlie Clark  added the comment:

print('count:', crt_time.wcsftime(wbuf, 1024, '%Z', tm)) also fails
but
crt_convert = ctypes.CDLL('api-ms-win-crt-convert-l1-1-0', use_errno=True)
print('count:', crt_convert.mbstowcs(wbuf, buf, 1024))
seems to work okay.

--

___
Python tracker 

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



[issue36835] Move the warnings runtime state into per-interpreter state.

2019-05-07 Thread Eric Snow


New submission from Eric Snow :

Currently the warnings module uses runtime-global state 
(PyRuntimeState.warnings).  That should be moved down to per-interpreter state. 
 There are three possible places:

1. the module's "module state"
2. the module's __dict__
3. PyInterpreterState.warnings (new)

I have a patch for the first option.

--
assignee: eric.snow
components: Interpreter Core
messages: 341763
nosy: eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: Move the warnings runtime state into per-interpreter state.
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



[issue36835] Move the warnings runtime state into per-interpreter state.

2019-05-07 Thread Eric Snow


Change by Eric Snow :


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



[issue35224] PEP 572: Assignment Expressions

2019-05-07 Thread Chris Angelico


Change by Chris Angelico :


--
pull_requests: +13077

___
Python tracker 

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



[issue13824] argparse.FileType opens a file and never closes it

2019-05-07 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

For information, issue 33927 is related. I removed one of the FileType from 
json.tool argument parser to work around this behavior 
(https://github.com/python/cpython/pull/7865/files#diff-e94945dd18482591faf1e294b029a6afR44).

If paul.j3 does not have his patch anymore I volunteer to implement option 1 to 
have a better alternative in the stdlib.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue36835] Move the warnings runtime state into per-interpreter state.

2019-05-07 Thread Eric Snow


Eric Snow  added the comment:

dupe of #36737

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



[issue36737] Warnings operate out of global runtime state.

2019-05-07 Thread Eric Snow


Change by Eric Snow :


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



  1   2   3   >