[issue41552] uuid.uuid1() on certain Macs does not generate unique IDs

2020-08-14 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

> The question then is: is there any way for the uuid module to recognize and 
> ignore such interfaces other than by the hardcoded MAC address?

Could uuid1 xor all mac addresses on MacOS? The result would be deterministic 
and unique as long as there is at least one mac address that is unique.

--
nosy: +remi.lapeyre

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



[issue41511] Pathlib parents doesn't support slicing with negative indexes

2020-08-09 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

*This is a duplicate of issue 21041

--

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



[issue41511] Pathlib parents doesn't support slicing with negative indexes

2020-08-09 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is a duplicate of 21041, it would be better to change the title of your PR 
so that it points to this bug report and to continue the discussion there.

--
nosy: +remi.lapeyre
versions:  -Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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



[issue41478] Empty representation of AssertionError

2020-08-06 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

> That's a solution, except you must know ahead of time this issue exists.

If we changed str(e) to make it the same as repr(e), there would be no way to 
get only the message. str(e) returns the message so if the message given was 
empty (or no message was given) you get an empty string. This cannot be changed 
without breaking a lot of code.

--
versions: +Python 3.10, Python 3.9

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



[issue41485] Repr of complex number with signed zero does not roundtrip

2020-08-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is a known issue and I have a PR that does this that I could post but it 
was rejected when it was previously discussed: 
https://bugs.python.org/issue23229#msg233963

--

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



[issue41485] Repr of complex number with signed zero does not roundtrip

2020-08-05 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre
versions: +Python 3.10, Python 3.9

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



[issue41478] Empty representation of AssertionError

2020-08-04 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi, can you not use its repr:


>>> try: raise ValueError
... except Exception as e: print(f"Following happened: {e!r}")
...
Following happened: ValueError()

?

--
nosy: +remi.lapeyre

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



[issue41394] Behiavior of '_' strange in shell

2020-07-25 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This behaviour is documented at 
https://docs.python.org/3/library/sys.html#sys.displayhook.

--

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



[issue41394] Behiavior of '_' strange in shell

2020-07-25 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi wyz23x2, did you do that from a clean interpreter?

_ is set to the last non-None result: 
https://github.com/python/cpython/blob/dd8a93e23b5c4f9290e1cea6183d97eb9b5e61c0/Python/sysmodule.c#L690-L696

So what you are seeing is that (None and True) is None, but _ is set to some 
value that you got from a previous input.

I think the component for this report is "Interpreter core".

--
components: +Interpreter Core
nosy: +remi.lapeyre

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



[issue41383] Provide a limit arguments for __repr__

2020-07-24 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Bernat, have you looked into reprlib.repr()? It's an alternative 
implementation of repr() made for cases like this.

You may be interested in this PR too: 
https://github.com/python/cpython/pull/20925

Alternatively, I think pprint.pformat() may be useful for your purpose too.

--
nosy: +remi.lapeyre

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



[issue41382] print() unpredictable behaviour

2020-07-24 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

On MacOS with Python 3.8.2 I get the correct results. Can you give more details 
about the platform and send the result of:


>>> "\t".join(['arith_int_512-cuda.sfeat', 
'__hipsyclkernel$wrapped_kernelname$MicroBenchArithmeticKernel_512_1', '578', 
'65', '5', '64', '4', '1025', '128', '1', '1', '512', '1'])

?


Could you also try `echo 
'arith_int_512-cuda.sfeat\t__hipsyclkernel$wrapped_kernelname$MicroBenchArithmeticKernel_512_1\t578\t65\t5\t64\t4\t1025\t128\t1\t1\t512\t1'`
 in shell? Maybe your terminal emulator behaves weirdly.

--
nosy: +remi.lapeyre

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



[issue41381] Google chat handler in Logging module

2020-07-24 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Anand, this is very specific to one product and I don't think the core team 
will take the burden to maintain to as it may be too specific. You could create 
a package and publish it on Pypi so others can use it thought.

--
components: +Library (Lib)
nosy: +remi.lapeyre
versions: +Python 3.10

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



[issue41241] Unnecessary Type casting in 'if condition'

2020-07-17 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Wansoo, welcome to Python!


Changes that are purely cosmetic but do not change the underlying meaning of 
the code are usually refused as they create unwanted code churn. You will find 
some info about this and all the other aspects of contributing to Python in the 
Python Dev Guide: https://devguide.python.org/.


If you want to find an issue on which you could work, please have a look at the 
`easy` `easy (C)` and `newcomer_friendly` issues in the bug tracker. You can 
find them using the search function of https://bugs.python.org/

--
nosy: +remi.lapeyre

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



[issue41284] High Level API for json file parsing

2020-07-12 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi, using a file object is very common as it makes it possible to use something 
that is not a file, like an HTTP request or something already in memory. It 
makes the module serializing / de-serializing the data completely agnostic with 
regard to the actual physical storage which has some advantages, for example it 
will not raise FileNotFound.

If you want a oneliner to load data you already can use:



with open(filepath) as f: data = json.load(f)

--
nosy: +remi.lapeyre

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



[issue41280] lru_cache on 0-arity functions should default to maxsize=None

2020-07-11 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Tom Forbes, I don't think there is a way to be sure that's the function does 
not take any argument. Are you worried about the lost memory when maxsize is 
not set?

--
nosy: +remi.lapeyre

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



[issue41274] Better way to random.seed()?

2020-07-10 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi, this is very specific and I don't think a way to seed the random generator 
using a third uncontrolled party will get merged in Python. You should probably 
try to package this as a third party library.

--
nosy: +remi.lapeyre

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



[issue41242] When concating strings, I think it is better to use += than join the list

2020-07-08 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Wansoo, using += instead of str.join() is less performant. Concatenating n 
strings with + will create and allocate n new strings will str.join() will 
carefully look ahead and allocate the correct amount of memory and do all 
concatenation at one:


➜  ~ python3 -m timeit -s 's = ""' 'for i in range(1_000_000): s += "foo\n"'
5 loops, best of 5: 107 msec per loop
➜  ~ python3 -m timeit -s 'l = ["foo"]*1_000_000' '"\n".join(l)'
20 loops, best of 5: 9.96 msec per loop


It's a common idiom that you will meet a lot in Python.

--
nosy: +remi.lapeyre

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



[issue41201] Long integer arithmetic

2020-07-03 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is because you used the floating point division operator `/` instead of 
the integer division `//`:


def digitsum(num):
digsum = 0
tnum = num
while tnum > 0:
print("tnum = %d, digsum = %d" % (tnum,digsum))
digsum += (tnum % 10)
tnum = int((tnum - (tnum % 10)) // 10)
return digsum

gives the result you expect.


Please ask for help on StackOverflow or the python-help mailing list first as 
this bug tracker is for reporting bugs in the Python interpreter itself and not 
for general help with Python programming.

The various numeric operator are documented at 
https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex

--
nosy: +remi.lapeyre

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



[issue41194] SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

2020-07-03 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
title: Digital India -> SIGSEGV in Python 3.9.0b3 in Python-ast.c:1412

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



[issue17805] No such class: multiprocessing.pool.AsyncResult

2020-07-02 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Volker Weißmann, this issue has been closed for 7 years, if you want to 
propose a change, please open a new issue.

--
nosy: +remi.lapeyre

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



[issue40967] asyncio.Task.all_tasks() and asyncio.Task.current_task() must be removed in 3.9

2020-06-27 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

With beta 4 coming in 2 days it would perhaps good to choose now whether this 
must be done for 3.9 or 3.10

--

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



[issue41126] Running test suite gives me - python.exe(14198, 0x114352dc0) malloc: can't allocate region

2020-06-26 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is probably related to issue 40928. Does the test succeed or fail when you 
do this?

--
nosy: +remi.lapeyre

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



[issue41107] Running a generator in a map-like manner

2020-06-24 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I don't think something so obvious can be added, if you want a one liner you 
can write:

for e in iterable: f(e)

I think it would go in itertools if it were accepted.

--
nosy: +rhettinger

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



[issue41107] Running a generator in a map-like manner

2020-06-24 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
components: +Library (Lib) -Interpreter Core

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



[issue41107] Running a generator in a map-like manner

2020-06-24 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

If I'm understanding correctly you want:

def xmap(f, iterable):
for e in iterable:
f(e)


Is that correct?

--
nosy: +remi.lapeyre

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



[issue41077] Make Cookiejar a bit more pythonic

2020-06-22 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Srinivas, as I said on the PR, cosmetic changes are usually not accepted. 
You can have a look at the other opened bug reports to find issues you can work 
on and at the Python Dev Guide (https://devguide.python.org/) for help to get 
started hacking Python!

--
nosy: +remi.lapeyre

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



[issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different

2020-06-21 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I fell like it's a bit weird to have a new function just for ignoring case, 
will a new function be required for every possible normalization like removing 
accents. One possible make the API handle those use cases would be to have a 
keyword-argument for this:


>>> difflib.get_close_matches('apple', ['APPLE'], normalization=str.lower)
['APPLE']

Then it could work with other normalization too without requiring a new 
function every time:

>>> difflib.get_close_matches('Remi', ['Rémi'], normalization=remove_a ccents)
['Rémi']

--
components: +Library (Lib)
nosy: +remi.lapeyre
versions: +Python 3.10 -Python 3.9

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



[issue39783] Optimize construction of Path from other Paths by just returning the same object?

2020-06-20 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.10 -Python 3.9

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



[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2020-06-20 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.7, Python 3.8, Python 3.9

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



[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2020-06-20 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.10 -Python 3.8

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



[issue33927] Allow json.tool to have identical infile and outfile

2020-06-20 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
components: +Library (Lib)
versions: +Python 3.10, Python 3.7, Python 3.8, Python 3.9

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



[issue41005] Permission denied: 'xdg-settings' when executing 'jupyter notebook' from command line

2020-06-20 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Can you give more information about your issue here. This part of the code was 
written like this on purpose as the comment says:


# OS X can use below Unix support (but we prefer using the OS X
# specific stuff)


We have to be sure that there is a bug here before changing the code, that 
changing the code will definitely fix the issue and that it won't create others.

--
nosy: +remi.lapeyre

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



[issue41030] Provide toList() method on iterators/generators (`list()` is a flow killer in REPL)

2020-06-19 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

It would not work, an iterator is just a thing that has __next__() and 
__iter__():


class MyIterator:
def __iter__(self): return self
def __next__(self): return 1


Plenty of iterators would not have this method even if we added it to some of 
them in the standard library and you would be event more frustated that 
sometimes toList(), and sometimes doesn't.



If you need to move in the current line in the REPL you can use Ctrl-a and 
Ctrl-e and you can use Ctrl + arrow in a Jupyter Notebook.

--
nosy: +remi.lapeyre

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



[issue41026] mailbox does not support new Path object

2020-06-18 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Laurence, Maildir predates pathlib so it's not surprising it hasn't been 
updated yet. Could you open a PR to add this?

BTW, you should use os.fspath() instead of str() here.

--
nosy: +remi.lapeyre
versions: +Python 3.10

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



[issue40995] reprlib.Repr.__init__ should accept arguments

2020-06-16 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +20104
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20925

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



[issue40995] reprlib.Repr.__init__ should accept arguments

2020-06-16 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

reprlib.Repr does not accept arguments for the moment so setting its attributes 
must be done in multiple steps:

import reprlib
r = reprlib.Repr()
r.maxstring = 10
r.maxset = 4
r.repr(...)


It would be more user-friendly to be able to do:

import reprlib
r = reprlib.Repr(maxstring=10, maxset=4)
r.repr(...)

--
components: Library (Lib)
messages: 371701
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: reprlib.Repr.__init__ should accept arguments
type: behavior
versions: Python 3.10

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



[issue40990] Make http.server support SSL

2020-06-16 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +20101
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20923

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



[issue40990] Make http.server support SSL

2020-06-16 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

It's a bit outside of its original scope but with more and more application 
requiring HTTPS it is sometime needed even when doing some simple tests or 
local development.

It's quite easy to have an SSL certificate, either auto-signed or using Let's 
Encrypt but configuring Nginx or HAProxy just to serve a local directory on 
localhost is tedious.

I think just wrapping the socket in SSLSocket and adding two flags on the 
command line would be enough?

--
components: Library (Lib)
messages: 371647
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: Make http.server support SSL
type: behavior
versions: Python 3.10

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



[issue40836] logging.fatal() and logging.Logger.fatal() should raise a DeprecationWarning

2020-06-15 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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

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



[issue40967] asyncio.Task.all_tasks() and asyncio.Task.current_task() must be removed in 3.9

2020-06-14 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +20062
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20874

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



[issue40967] asyncio.Task.all_tasks() and asyncio.Task.current_task() must be removed in 3.9

2020-06-13 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

The documentation says:


  .. deprecated-removed:: 3.7 3.9

 Do not call this as a task method. Use the :func:`asyncio.all_tasks`
 function instead.


I don't know if it's still possible to merge this in 3.9 and if so, if it 
should be a release blocker. Anyway I'm working on a PR for this.

--
components: asyncio
messages: 371449
nosy: asvetlov, remi.lapeyre, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.Task.all_tasks() and asyncio.Task.current_task() must be removed 
in 3.9
versions: Python 3.10, Python 3.9

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



[issue28557] error message for bad raw readinto

2020-06-11 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.10, Python 3.8, Python 3.9

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



[issue40937] Remove deprecated functions marked for removal in 3.10

2020-06-11 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +serhiy.storchaka

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



[issue29847] Path takes and ignores **kwargs

2020-06-10 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.10, Python 3.8, Python 3.9

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



[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-06-10 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.10 -Python 3.9

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



[issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH

2020-06-10 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

> But is it really an use case to log any memory allocation failure? Python is 
> very likely to raise a MemoryError exception in this case. It's well defined, 
> no?

Yes, we are not trying to log the allocation failure, we are just trying to 
suppress a dubious error message that occurs specifically on MacOS.

--

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



[issue40928] test_decimal.CWhitebox.test_maxcontext_exact_arith() shows "malloc: can't allocate region" on MacOS

2020-06-10 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Ok, I will try to do this in the coming days. Is adding this kind of super 
ugly, super specific code to pymain_init() ok?

--

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



[issue40928] test_decimal.CWhitebox.test_maxcontext_exact_arith() shows "malloc: can't allocate region" on MacOS

2020-06-10 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

> I have two observations:
> 
> First, I think that the default DEBUG_WRITE_ALWAYS, which is the cause
> of this issue, is not C standard conforming -- The standard does not
> permit implementation defined diagnostics (global side effects!) on a
> completely normal allocation failure.

That makes sense

> So I would feel justified to make DEBUG_WRITE_ON_CRASH the default
> on Python startup, even if that means that we force that on extension
> modules.
> 
> That would also address annoyances like in msg327446. Speaking of
> which, do you also get that diagnostic in cases like these?
> 
> 
> >>> [0] * 1
> Traceback (most recent call last):
>   File "", line 1, in 
> MemoryError
>

It gives:

>>> [0] * 1
python3(36633,0x110c08dc0) malloc: can't allocate region
:*** mach_vm_map(size=84096, flags: 100) failed (error code=3)
python3(36633,0x110c08dc0) malloc: *** set a breakpoint in malloc_error_break 
to debug
Traceback (most recent call last):
  File "", line 1, in 
MemoryError

Not very nice.

> 
> FreeBSD has a similar reporting mechanism, but the default is not
> DEBUG_WRITE_ALWAYS.  I suspect DEBUG_WRITE_ALWAYS is there for the
> convenience of Apple developers dealing with user reports.
> 
> 
> Second, we *could* write such a context manager and it would probably
> be okay *for the test suite*, but in general changing a static variable
> that is not thread safe at runtime in a library should be avoided.
> 

What about overriding the default to DEBUG_WRITE_ON_CRASH if MallocDebugReport
is not set? This would be more standard compliant and still let the user 
override it if he whishes so.

> 
> I don't have OS X at all though. Ronald, what do you think?

--

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



[issue40937] Remove deprecated functions marked for removal in 3.10

2020-06-10 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
pull_requests: +19973
pull_request: https://github.com/python/cpython/pull/20775

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



[issue40937] Remove deprecated functions marked for removal in 3.10

2020-06-10 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +19971
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20774

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



[issue40937] Remove deprecated functions marked for removal in 3.10

2020-06-10 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

The following modules have functions marked for deprecation in Python 3.10:
 - asyncio-queue
 - asyncio-subprocess
 - asyncio-sync
 - asyncio-task
 - collections
 - builtins
 - gettext
 - the old parser

I already opened a PR to remove those in gettext and Pablo Galindo removed the 
old parser. I will open PRs to fix the remainding modules.

Instead of creating a new issue to track those separately, I thought it would 
be easier to list them all here and open multiple PRs.

--
components: Library (Lib)
messages: 371178
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: Remove deprecated functions marked for removal in 3.10
versions: Python 3.10

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



[issue40936] Remove deprecated functions from gettext

2020-06-10 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +19970
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20773

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



[issue40936] Remove deprecated functions from gettext

2020-06-10 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

The codeset parameter and the following functions were marked for removal in 
Python 3.10:

- bind_textdomain_codeset()
- lgettext()
- ldgettext()
- lngettext()
- ldngettext()
- output_charset()
- set_output_charset()

--
components: Library (Lib)
messages: 371174
nosy: barry, remi.lapeyre
priority: normal
severity: normal
status: open
title: Remove deprecated functions from gettext
versions: Python 3.10

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



[issue40928] test_decimal.CWhitebox.test_maxcontext_exact_arith() shows "malloc: can't allocate region" on MacOS

2020-06-10 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Would it be possible to wrap malloc_print_configure() 
(https://github.com/PureDarwin/libmalloc/blob/e37056265821cd6e014ab911d9fe3b9d0da88e22/src/malloc_printf.c#L59)
 in a context manager that we put in test.support? or to override 
https://github.com/PureDarwin/libmalloc/blob/e37056265821cd6e014ab911d9fe3b9d0da88e22/src/malloc_printf.c#L36?


This would let us change this behaviour locally without masking all other 
errors.

--

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



[issue18319] gettext() cannot find translations with plural forms

2020-06-09 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +barry
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

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



[issue40928] test_decimal.CWhitebox.test_maxcontext_exact_arith() shows "malloc: can't allocate region" on MacOS

2020-06-09 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I forgot to say that MallocLogFile=/dev/null did not work, that's why I tried 
MallocDebugReport.

--

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



[issue40928] test_decimal.CWhitebox.test_maxcontext_exact_arith() shows "malloc: can't allocate region" on MacOS

2020-06-09 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Thanks, I found "MallocDebugReport" in `man malloc` (I could have thought to 
look into there...) that seem to do the trick:

$ MallocDebugReport=none ./python -m test test_decimal -m 
test_maxcontext_exact_arith

0:00:00 load avg: 1.27 Run tests sequentially
0:00:00 load avg: 1.27 [1/1] test_decimal

== Tests result: SUCCESS ==

1 test OK.

Total duration: 694 ms
Tests result: SUCCESS


There is also MallocDebugReport=crash that will "write messages to standard 
error only for a condition that is about to cause a crash." and effectively 
suppress this one.


Setting it in the test with os.putenv() does not seem to work.

--

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



[issue40928] test_decimal.CWhitebox.test_maxcontext_exact_arith() shows "malloc: can't allocate region" on MacOS

2020-06-09 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

> The annoying "error" looks the same as #5614, which was closed as "won't fix".

Yes, it's a similar message, test_io does not display it on Catalina anymore 
thought.

> Is this the only place in the test suite now? 

As far as I know yes.


> If it is, I'm okay with squashing the remark.

I'm not sure to what this means.

--

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



[issue40928] test_decimal.CWhitebox.test_maxcontext_exact_arith() shows "malloc: can't allocate region" on MacOS

2020-06-09 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

Here's the result of "./python -m test test_decimal -m 
test_maxcontext_exact_arith":

0:00:00 load avg: 1.33 Run tests sequentially
0:00:00 load avg: 1.33 [1/1] test_decimal
python(7835,0x11a218dc0) malloc: can't allocate region
:*** mach_vm_map(size=842105263157895168, flags: 100) failed (error code=3)
python(7835,0x11a218dc0) malloc: *** set a breakpoint in malloc_error_break to 
debug
python(7835,0x11a218dc0) malloc: can't allocate region
:*** mach_vm_map(size=842105263157895168, flags: 100) failed (error code=3)
python(7835,0x11a218dc0) malloc: *** set a breakpoint in malloc_error_break to 
debug
python(7835,0x11a218dc0) malloc: can't allocate region
:*** mach_vm_map(size=421052631578947584, flags: 100) failed (error code=3)
python(7835,0x11a218dc0) malloc: *** set a breakpoint in malloc_error_break to 
debug
python(7835,0x11a218dc0) malloc: can't allocate region
:*** mach_vm_map(size=421052631578947584, flags: 100) failed (error code=3)
python(7835,0x11a218dc0) malloc: *** set a breakpoint in malloc_error_break to 
debug

== Tests result: SUCCESS ==

1 test OK.

Total duration: 553 ms
Tests result: SUCCESS




I spent quite a time to find where this error was coming from and it's actually 
not an error but a dubious message from OSX. Others will surely lose time on 
this too, I think the best way to handle it is to use bigmemtest() with a small 
value on MacOS so that it's only run when '-M' is given on this platform, but 
always on the others.

--
components: Tests
messages: 371107
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: test_decimal.CWhitebox.test_maxcontext_exact_arith() shows "malloc: 
can't allocate region" on MacOS
versions: Python 3.10

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



[issue40888] Add close method to queue

2020-06-09 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

The python-ideas is hosted at 
https://mail.python.org/mailman3/lists/python-ideas.python.org/, you can create 
an account and once it's validated you will be able to post a new message 
either using the web UI or by sending a mail directly to the list.

--
nosy: +remi.lapeyre

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



[issue40927] ./python -m test test___all__ test_binhex fails

2020-06-09 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +19957
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20758

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



[issue40927] ./python -m test test___all__ test_binhex fails

2020-06-09 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

It looks like the warning registry does not get flushed properly:

./python -m test test___all__ test_binhex
0:00:00 load avg: 1.55 Run tests sequentially
0:00:00 load avg: 1.55 [1/2] test___all__
0:00:01 load avg: 1.55 [2/2] test_binhex
test test_binhex crashed -- Traceback (most recent call last):
  File "/Users/remi/src/cpython/Lib/test/libregrtest/runtest.py", line 270, in 
_runtest_inner
refleak = _runtest_inner2(ns, test_name)
  File "/Users/remi/src/cpython/Lib/test/libregrtest/runtest.py", line 221, in 
_runtest_inner2
the_module = importlib.import_module(abstest)
  File "/Users/remi/src/cpython/Lib/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1030, in _gcd_import
  File "", line 1007, in _find_and_load
  File "", line 986, in _find_and_load_unlocked
  File "", line 680, in _load_unlocked
  File "", line 790, in exec_module
  File "", line 228, in _call_with_frames_removed
  File "/Users/remi/src/cpython/Lib/test/test_binhex.py", line 10, in 
import binhex
  File "/Users/remi/src/cpython/Lib/contextlib.py", line 124, in __exit__
next(self.gen)
  File "/Users/remi/src/cpython/Lib/test/support/__init__.py", line 1166, in 
_filterwarnings
raise AssertionError("filter (%r, %s) did not catch any warning" %
AssertionError: filter ('', DeprecationWarning) did not catch any warning

test_binhex failed

== Tests result: FAILURE ==

1 test OK.

1 test failed:
test_binhex

Total duration: 2.0 sec
Tests result: FAILURE



It's not a very issue but does appear when running refleaks on the whole stdlib.

--
components: Tests
messages: 371090
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: ./python -m test test___all__ test_binhex fails
versions: Python 3.10

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



[issue40917] pickle exceptions with mandatory keyword args will traceback

2020-06-09 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is a duplicate of issue 27015.

--
nosy: +remi.lapeyre
versions: +Python 3.10, Python 3.9 -Python 3.6

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



[issue40911] Unexpected behaviour for += assignment to list inside tuple

2020-06-08 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Multiple steps happens at once here, first the list is extended, then the 
result is written back to the tuple, at which point it raises TypeError because 
you can't write to a tuple. When TypeError is raised, the list has already be 
extended. The code is equivalent to:


a = ([],)
try:
b = a[0]
b += [1]
a[0] = b
except TypeError:
assert a != ([1],)  # assertion fails
else:
assert a == ([1],)


This is explained in the documentation at 
https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements:


An augmented assignment expression like x += 1 can be rewritten as x = x + 1 to 
achieve a similar, but not exactly equal effect. In the augmented version, x is 
only evaluated once. Also, when possible, the actual operation is performed 
in-place, meaning that rather than creating a new object and assigning that to 
the target, the old object is modified instead.

Unlike normal assignments, augmented assignments evaluate the left-hand side 
before evaluating the right-hand side. For example, a[i] += f(x) first looks-up 
a[i], then it evaluates f(x) and performs the addition, and lastly, it writes 
the result back to a[i].

--
nosy: +remi.lapeyre -steven.daprano
versions: +Python 3.10, Python 3.9

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



[issue36750] test_socket leaks file descriptors on macOS

2020-06-07 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I think I stumbled on this too, I think the test that causes some issue is 
testCmsgTrunc2Int:


./python -m test -R: test_socket -m testCmsgTrunc2Int
0:00:00 load avg: 1.66 Run tests sequentially
0:00:00 load avg: 1.66 [1/1] test_socket
beginning 9 repetitions
123456789
.
test_socket leaked [2, 2, 2, 2] file descriptors, sum=8
test_socket failed

== Tests result: FAILURE ==

1 test failed:
test_socket

Total duration: 2.0 sec
Tests result: FAILURE



There is some file descriptors that are created by newFDs() but they are 
supposed to be cleaned up, maybe it is some race condition as I see that 
test_socket create a thread for each test?

--
nosy: +remi.lapeyre
versions: +Python 3.10, Python 3.9

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



[issue40890] Dict views should be introspectable

2020-06-07 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

property, partial, bound methods and ChinMap all do something complex with the 
underlying object. Dict-views are quite simple by comparison, is there an 
example where this would be helpful and better than just passing directly the 
mapping object?

--
nosy: +remi.lapeyre

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



[issue40896] Missing links to Source Code in Documentation pages

2020-06-07 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

In the case of time, it's a C module. Those usually don't have a link to their 
implementation at the top. Others like wsgiref should have a link as having a 
quick way to read the implementation is a nice way to check on the 
implementation details and get acquainted with Python's internal.

Could you open a PR to add those?

--
nosy: +remi.lapeyre
versions: +Python 3.10, Python 3.7, Python 3.8, Python 3.9

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



[issue40724] Support buffer protocol with type specs

2020-06-07 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre
nosy_count: 8.0 -> 9.0
pull_requests: +19904
pull_request: https://github.com/python/cpython/pull/20685

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



[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2020-06-06 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.10, Python 3.9 -Python 2.7

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



[issue35019] Allow ipaddres.IPv4/v6Address in asyncio.create_server

2020-06-06 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Issue 38952 is a duplicate of this.

--
message_count: 4.0 -> 5.0
nosy: +remi.lapeyre
nosy_count: 4.0 -> 5.0
pull_requests: +19896
versions: +Python 3.10, Python 3.9
pull_request: https://github.com/python/cpython/pull/17434

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



[issue40884] Added defaults parameter for logging.Formatter

2020-06-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

New features will go in Python 3.10 indeed.

--
nosy: +remi.lapeyre, vinay.sajip
versions:  -Python 3.9

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



[issue40862] argparse.BooleanOptionalAction accept and silently discard its the const argument

2020-06-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

argparse.BooleanOptionalAction was introduced in Python3.9 so there is no code 
there should be no code that already rely on it.

--

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



[issue40872] multiprocess.Lock is missing the locked() method

2020-06-05 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +19871
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20651

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



[issue40872] multiprocess.Lock is missing the locked() method

2020-06-05 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

multiprocessing is supposed to be a drop-in replacement for the threading 
module and multiprocessing.Lock() is advertised as a "a close analog of 
threading.Lock." but it is missing the locked() method that returns whether the 
current status of the lock.

--
components: Library (Lib)
messages: 370762
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: multiprocess.Lock is missing the locked() method
versions: Python 3.10

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



[issue40836] logging.fatal() and logging.Logger.fatal() should raise a DeprecationWarning

2020-06-04 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Thanks for the feedback, I updated the PR accordingly.

--

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



[issue40857] tempfile.TemporaryDirectory() context manager can fail to propagate exceptions generated within its context

2020-06-04 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This was fixed in e9b51c0ad81da1da11ae65840ac8b50a8521373c so it's fixed in 
Python 3.8 and 3.9. Maybe it should have been backported to 3.7.

Python 3.6 only receives security fixes now.

See also bpo-26660 and bpo-35144.

--
components: +Library (Lib) -Extension Modules
nosy: +remi.lapeyre, serhiy.storchaka
versions: +Python 3.7

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



[issue40862] argparse.BooleanOptionalAction accept and silently discard its the const argument

2020-06-04 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
title: argparse.BooleanOptionalAction accept and silently its the const 
argument -> argparse.BooleanOptionalAction accept and silently discard its the 
const argument

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



[issue40862] argparse.BooleanOptionalAction accept and silently its the const argument

2020-06-04 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +19848
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20623

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



[issue40862] argparse.BooleanOptionalAction accept and silently its the const argument

2020-06-04 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

The action is used to store None, True or False when an argument like --foo or 
--no-foo is given to the cli so it has no used for this action, but it is 
accepted without warning:

Python 3.10.0a0 (heads/bpo-wip:6e23a9c82b, Jun  4 2020, 13:41:35) 
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', const='this_is_not_used', 
>>> action=argparse.BooleanOptionalAction)
BooleanOptionalAction(option_strings=['--foo', '--no-foo'], dest='foo', 
nargs=0, const=None, default=None, type=None, choices=None, help=None, 
metavar=None)
>>> args = parser.parse_args()
>>> args
Namespace(foo=None)



We could either always refuse this argument, or accepted and raise ValueError 
if it is different than None. The attached PR does the first.

--
components: Library (Lib)
messages: 370703
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: argparse.BooleanOptionalAction accept and silently its the const argument
versions: Python 3.10, Python 3.9

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



[issue40853] "set() in set()" should raise TypeError: unhashable type: 'set'

2020-06-03 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is documented in 
https://docs.python.org/3.8/library/stdtypes.html#set-types-set-frozenset:


Instances of set are compared to instances of frozenset based on their members. 
For example, set('abc') == frozenset('abc') returns True and so does set('abc') 
in set([frozenset('abc')]).

--

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



[issue40853] "set() in set()" should raise TypeError: unhashable type: 'set'

2020-06-03 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
components: +Interpreter Core
nosy: +rhettinger
versions: +Python 3.10, Python 3.9

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



[issue40853] "set() in set()" should raise TypeError: unhashable type: 'set'

2020-06-03 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

The set is converted to a frozenset before the comparison so 

>>> {1,2} in {frozenset({1,2}), 3}

is equivalent to 

>>> frozenset({1,2}) in {frozenset({1,2}), 3}


This was introduced on purpose 17 years ago in 19c2d778 so it's unlikely to 
change.

--
nosy: +remi.lapeyre

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



[issue40846] Misleading line in documentation

2020-06-02 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi, thanks for pointing this out.

I think "type" here is not about the type of the object but whether it is:

 - positional-only
 - positional or keyword
 - variadic positional
 - keyword-only
 - variadic keyword


The wording could certainly be improved as it is currently unclear. Could you 
make a suggestion and open a PR?

--
nosy: +remi.lapeyre

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



[issue40842] _Pickler_CommitFrame() always returns 0 and its return code is checked needlessly

2020-06-02 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
title: _Pickler_CommitFrame() always returns 0 but it's return code is checked 
-> _Pickler_CommitFrame() always returns 0 and its return code is checked 
needlessly

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



[issue40842] _Pickler_CommitFrame() always returns 0 but it's return code is checked

2020-06-02 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

I'm currently investigating a SystemError one of our workers returned:

returned NULL without setting 
an error


While doing so I came across the _Pickler_CommitFrame() function:


static int
_Pickler_CommitFrame(PicklerObject *self)
{
size_t frame_len;
char *qdata;

if (!self->framing || self->frame_start == -1)
return 0;
frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
qdata = PyBytes_AS_STRING(self->output_buffer) + self->frame_start;
if (frame_len >= FRAME_SIZE_MIN) {
qdata[0] = FRAME;
_write_size64(qdata + 1, frame_len);
}
else {
memmove(qdata, qdata + FRAME_HEADER_SIZE, frame_len);
self->output_len -= FRAME_HEADER_SIZE;
}
self->frame_start = -1;
return 0;
}


Is there a reason for this function to return an int if it is always 0? I 
checked all call sites (_Pickler_GetString(), _Pickler_OpcodeBoundary(), 
_Pickler_write_bytes() and dump()) and they all check the return code but it 
seems useless.

--
components: Library (Lib)
messages: 370603
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: _Pickler_CommitFrame() always returns 0 but it's return code is checked
type: enhancement
versions: Python 3.10

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



[issue40403] pdb does not drop into debugger upon SyntaxError caused by ast.literal_eval

2020-06-02 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Yes, the patch by Terry Reedy fixes this issue while still breaking the loop 
from `def f: pass`.

It will start the debugger once for `def f: pass` which may be weird as in this 
case no user code has been executed and it will be in bdb which may confuse 
users:


Traceback (most recent call last):
  File "/Users/remi/src/cpython/Lib/pdb.py", line 1703, in main
pdb._runscript(mainpyfile)
  File "/Users/remi/src/cpython/Lib/pdb.py", line 1572, in _runscript
self.run(statement)
  File "/Users/remi/src/cpython/Lib/bdb.py", line 580, in run
exec(cmd, globals, locals)
  File "", line 1, in 
  File "/Users/remi/src/cpython/tests.py", line 1
def f: pass
 ^
SyntaxError: invalid syntax
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> (1)()
(Pdb) bt
  /Users/remi/src/cpython/Lib/pdb.py(1703)main()
-> pdb._runscript(mainpyfile)
  /Users/remi/src/cpython/Lib/pdb.py(1572)_runscript()
-> self.run(statement)
  /Users/remi/src/cpython/Lib/bdb.py(580)run()
-> exec(cmd, globals, locals)
> (1)()


Perhaps we should should test whether the exception happened there and not drop 
in the debugger in that case?

--

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



[issue40403] pdb does not drop into debugger upon SyntaxError caused by ast.literal_eval

2020-06-01 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is related to issue 16180, it may be possible to improve the situation by 
trying to determine whether the SyntaxError is in the file or came during its 
execution by looking at the filename but it's probably very brittle:



 # In most cases SystemExit does not warrant a post-mortem session.
 print("The program exited via sys.exit(). Exit status:", end=' ')
 print(sys.exc_info()[1])
-except SyntaxError:
-traceback.print_exc()
-sys.exit(1)
-except:
+except Exception as e:
+if (type(e) is SyntaxError and
+e.filename == os.path.abspath(mainpyfile)):
+traceback.print_exc()
+sys.exit(1)
 traceback.print_exc()
 print("Uncaught exception. Entering post mortem debugging")
 print("Running 'cont' or 'step' will restart the program")

--
nosy: +terry.reedy, xdegaye

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



[issue40403] pdb does not drop into debugger upon SyntaxError caused by ast.literal_eval

2020-06-01 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I've looked into this, in Bdb both the part where the code is compiled and the 
one where the code is run are in the run() method 
(https://github.com/python/cpython/blob/master/Lib/bdb.py#L565-L585):


def run(self, cmd, globals=None, locals=None):
"""Debug a statement executed via the exec() function.
globals defaults to __main__.dict; locals defaults to globals.
"""
if globals is None:
import __main__
globals = __main__.__dict__
if locals is None:
locals = globals
self.reset()
if isinstance(cmd, str):
cmd = compile(cmd, "", "exec")
sys.settrace(self.trace_dispatch)
try:
exec(cmd, globals, locals)
except BdbQuit:
pass
finally:
self.quitting = True
sys.settrace(None)


This is an issue as SyntaxError may come from two lines

 - the call to compile() which means the code being run is not valid Python, in 
this case the current behaviour of PDB to exit is correct as there is nothing 
to debug
 - the call to exec() in which case a SyntaxError can happen like in the 
report, and PDB should go in post mortem debug mode.


One way to fix the issue would be to catch the error in compile() and wrap it 
in a BdbSyntaxError so that PDB can differentiate between the two, another to 
keep BDB as it is and change PDB so that it compiles the code first, and call 
run() in a second step. I think the last one is better and will start writing a 
PR for this.

--
nosy: +remi.lapeyre
versions: +Python 3.10, Python 3.7, Python 3.9

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



[issue40836] logging.fatal() and logging.Logger.fatal() should raise a DeprecationWarning

2020-06-01 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Thanks, I was wondering about that. I didn't know what is the status of the 
function exactly and found https://bugs.python.org/msg344080.

While they are not documented, you can find them in dir() and in the help, 
maybe they should have a docstring?

--

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



[issue40836] logging.fatal() and logging.Logger.fatal() should raise a DeprecationWarning

2020-05-31 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +19804
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20563

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



[issue40836] logging.fatal() and logging.Logger.fatal() should raise a DeprecationWarning

2020-05-31 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

Both are not documented and synonymous for critical() but don't raise a 
DeprecationWarning.

--
components: Library (Lib)
messages: 370522
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: logging.fatal() and logging.Logger.fatal() should raise a 
DeprecationWarning
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

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



[issue39314] (readline) Autofill the closing parenthesis during auto-completion for functions which accept no arguments at all

2020-05-31 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
nosy: +remi.lapeyre
nosy_count: 1.0 -> 2.0
pull_requests: +19803
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20562

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



[issue17005] Add a topological sort algorithm

2020-05-31 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Could it make sense to have this in the often proposed imath module? 

It's integers per se but Both number theory and graph theory are part of 
discrete mathematics so it may feel more at home there?

--

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



[issue40826] Segfaults on io.FileIO(0).name in 3.9

2020-05-30 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre, vstinner

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



[issue27580] CSV Null Byte Error

2020-05-30 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Skip, I'm on a Mac so I tried Numbers, the spreadsheet tool that comes with 
MacOS:


Opening and exporting to CSV again works:


➜  ~ cat -v ~/Documents/nul.csv
abc;def;1234.5;^@^M
a-c;d^@f;1234.5;^@^M
ABC;DEF;1.5;^@


When exporting to TSV, it makes the correct changes:


➜  ~ cat -v ~/Documents/nul.tsv
abc def 1234.5  ^M
a-c d^@f1234.5  ^@^M
ABC DEF 1.5 ^@

--

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



[issue27580] CSV Null Byte Error

2020-05-30 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Writing to those files is obviously as easy, since like you said "because by 
it's very nature it's non-printable" and you will probably not find it in your 
data:


with open('file', 'w') as f:
f.write('\x00'.join(data))


It will break if there is a NULL byte in your data, and CSV would quote the 
element properly instead, but so would "find . -iname "*something*" -print0 | 
xargs -0 " if one of the file had a NULL byte in their name.


I don't think Python is being unreasonable here, especially considering it has 
the same drawbacks as the other Unix utilities.
If those solutions to read and write NULL separated files are not enough for 
your use-case, please give more information so that it can be supported.

--

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



[issue27580] CSV Null Byte Error

2020-05-30 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I feel like the CSV module could support using NULL as separator and could send 
a PR with some test to add this but Daniel could you give more information 
regarding why you need explicit CSV support for this?

The CSV parser is needed to read and write CSV files to can be produced by 
other programs and has been extended to support the various dialects, most of 
them produced by spreadsheet programs.



> The use of chr(0x00) or '\0' is used quite often in the *NIX world as a 
> convenient record separator that doesn't have escaping problems because by 
> it's very nature it's non-printable. e.g. "find . -iname "*something*" 
> -print0 | xargs -0 " ... 
>

> As to the difficulty in handling 0x00 characters, I dunno ... it appears that 
> GNU find, xargs, gawk...

> Is it possible to write a NUL (0x00) character to a file? Through a *NIX 
> pipe? You bet. 


Yes and all of those are supported natively by Python already:


find . -type f -depth 1 -print0 | python -c "from pprint import pp; 
pp(input().split('\x00'))"



Multilines input can be supported as easily doing:


data = [
line.split('\x00')
for line in input()
]


Is this not enough?

--
nosy: +remi.lapeyre

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



[issue40818] Run sys.__interactivehook__ for asyncio REPLs

2020-05-29 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +19761
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20517

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



[issue40818] Run sys.__interactivehook__ for asyncio REPLs

2020-05-29 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

As a nice side effect, it gives the same completion than the standard shell.

--
components: Library (Lib)
messages: 370321
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: Run sys.__interactivehook__ for asyncio REPLs
versions: Python 3.10

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



[issue40817] Document the asyncio shell

2020-05-29 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

Python 3.8 introduced `python -m asyncio` to run a Python shell with asyncio 
support. It had a note in What's New but was not documented, I think a note in 
https://docs.python.org/3/library/asyncio.html should be helpful.


This could be a good issue for a new contributor.

--
assignee: docs@python
components: Documentation
messages: 370319
nosy: docs@python, remi.lapeyre
priority: normal
severity: normal
status: open
title: Document the asyncio shell
versions: Python 3.10, Python 3.8, Python 3.9

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



  1   2   3   4   5   6   >