[issue44320] License for W3C C14N test suite is rendered as blockquote

2021-06-05 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue44320] License for W3C C14N test suite is rendered as blockquote

2021-06-05 Thread miss-islington


miss-islington  added the comment:


New changeset 8e2c0fd7ada79107f7e0d9c465e77fb36a9486e5 by Miss Islington (bot) 
in branch '3.9':
bpo-44320: Fix markup for W3C C14N test suite (GH-26556)
https://github.com/python/cpython/commit/8e2c0fd7ada79107f7e0d9c465e77fb36a9486e5


--

___
Python tracker 

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



[issue44320] License for W3C C14N test suite is rendered as blockquote

2021-06-05 Thread miss-islington


miss-islington  added the comment:


New changeset 3b87137176f790e93493fcb5543001f1cab8daf7 by Miss Islington (bot) 
in branch '3.10':
bpo-44320: Fix markup for W3C C14N test suite (GH-26556)
https://github.com/python/cpython/commit/3b87137176f790e93493fcb5543001f1cab8daf7


--

___
Python tracker 

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



[issue44320] License for W3C C14N test suite is rendered as blockquote

2021-06-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25145
pull_request: https://github.com/python/cpython/pull/26558

___
Python tracker 

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



[issue44320] License for W3C C14N test suite is rendered as blockquote

2021-06-05 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue44320] License for W3C C14N test suite is rendered as blockquote

2021-06-05 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 71be46170490d08743c714b9fa4484038aa7a23e by NAKAMURA Osamu in 
branch 'main':
bpo-44320: Fix markup for W3C C14N test suite (GH-26556)
https://github.com/python/cpython/commit/71be46170490d08743c714b9fa4484038aa7a23e


--
nosy: +corona10

___
Python tracker 

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



[issue44320] License for W3C C14N test suite is rendered as blockquote

2021-06-05 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +25144
pull_request: https://github.com/python/cpython/pull/26557

___
Python tracker 

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



[issue44320] License for W3C C14N test suite is rendered as blockquote

2021-06-05 Thread OSAMU NAKAMURA


Change by OSAMU NAKAMURA :


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

___
Python tracker 

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



[issue44320] License for W3C C14N test suite is rendered as blockquote

2021-06-05 Thread OSAMU NAKAMURA


New submission from OSAMU NAKAMURA :

The License text for W3C C14N test suite is rendered as quoted text, but it 
should be rendered same as others.

- change`:` to `::`

--
assignee: docs@python
components: Documentation
messages: 395197
nosy: OSAMU.NAKAMURA, docs@python
priority: normal
severity: normal
status: open
title: License for W3C C14N test suite is rendered as blockquote
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



[issue39247] dataclass defaults and property don't work together

2021-06-05 Thread Benjamin Lee


Benjamin Lee  added the comment:

> I'm not sure "alias" feels quite right, as it only applies to __init__ (if 
> I'm understanding it correctly).

Maybe `init_alias` might be a better name. In any case, this would support 
private variables in dataclasses.

--

___
Python tracker 

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



[issue39247] dataclass defaults and property don't work together

2021-06-05 Thread Michael Robellard


Michael Robellard  added the comment:

The sample I uploaded doesn't do any processing, but the use case originally 
had some logic inside the property getter/setter, would the alias idea allow 
for that? The purpose of the property is to add some logic to compute the value 
if it has not already been computed, however if it is computed don't recompute 
it because it is expensive to recompute.

--

___
Python tracker 

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



[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

> Of course, but the main thing is that you spotted this before the PR was 
> merged :)

I know, better late then never but also better sooner than late :-)

--

___
Python tracker 

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



[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Andrei Kulakov

Andrei Kulakov  added the comment:

> I imagine that the discussion focussed on this since this is precisely what 
> happens when sep=None. For example, 'a b   c ​'.split() == ['a', 'b', 
> 'c']. I guess that the point was to provide users with explicit, manual 
> control over whether the behaviour of split should drop all empty strings or 
> retain all empty strings instead of this decision just being made on whether 
> sep is None or not.

That's true on some level but it seems to me that it's somewhat more nuanced 
than that.

The intent of sep=None is not to remove empties but to collapse invisible 
whitespace of mixed types into a single separator. ' \t  ' probably means a 
single separator because it looks like one visually. Yes, the effect is the 
same as removing empties but it's a relevant distinction when designing (and 
naming) a flag to make split() consistent with this behaviour when sep is ',', 
';', etc.

Because when you have 'a,,,' - the most likely intent is to have 3 empty 
values, NOT to collapse 3 commas into a single sep; - and then you might 
potentially have additional processing that gets rid of empties, as part of 
split() operation. So it's quite a different operation, even though the end 
effect is the same. So is this change really making the behaviour consistent? 
To me, consistency implies that intent is roughly the same, and outcome is also 
roughly the same. 

You might say, but: practicality beats purity?

However, there are some real issues here:

- harder to explain, remember, document.
- naming issue
- not completely solving the initial issue (and it would most likely leave no 
practical way to patch up that corner case if this PR is accepted)

Re: naming, for example, using keep_empty=False for sep=None is confusing, - it 
would seem that most (or even all) users would think of the operation as 
collapsing contiguous mixed whitespace into a single separator rather than 
splitting everything up and then purging empties. So this name could cause a 
fair bit of confusion for this case.

What if we call it `collapse_contiguous_separators`? I can live with an awkward 
name, but even then it doesn't work for the case like 'a' -- it doesn't 
make sense (mostly) to collapse 4 commas into one separator. Here you are 
actually purging empty values.

So the consistency seems labored in that any name you pick would be confusing 
for some cases.

And is the consistency for this case really needed? Is it common to have 
something like 'a' and say "I wish to get rid of those empty values but I 
don't want to use filter(None, values)"?

In regard to the workaround you suggested, that seems fine. If this PR is 
accepted, any of the workarounds that people now use for ''.split(',') or 
similar would still work just as before..

--

___
Python tracker 

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



[issue39247] dataclass defaults and property don't work together

2021-06-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

> _uploaded_by: str = dataclasses.field(alias="uploaded_by", default=None, 
> init=False)

That's an interesting idea. I'll play around with it. I'm not sure "alias" 
feels quite right, as it only applies to __init__ (if I'm understanding it 
correctly).

--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread ppperry


Change by ppperry :


--
nosy:  -ppperry

___
Python tracker 

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



[issue39247] dataclass defaults and property don't work together

2021-06-05 Thread Benjamin Lee


Benjamin Lee  added the comment:

Would this issue not be trivially resolved if there was a way to specify alias 
in the dataclasses field? I.e.:

_uploaded_by: str = dataclasses.field(alias="uploaded_by", default=None, 
init=False)

Ultimately, the main goal is to make it so that the generated __init__ 
constructor does

self._uploaded_by = uploaded_by

but with current implementation, there is no aliasing so the default __init__ 
constructor is always:

self._uploaded_by = _uploaded_by

--
nosy: +UnHumbleBen

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>b) always skip the test on windows => we can do that but it might be 
> counterintuitive for the future

Well, is not that the test is flaky technically, this means that the feature 
doesn't work on Windows (non release builds). So the reasoning has to be why we 
want/need to not support this on Windows. Otherwise we need to customize the 
limit on debug builds.

--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

After playing with it for a couple hours and without much success of creating a 
test environment (only using buildbots), I decided not to introduce hard 
limits. Even though they make the original tests to pass, they don't solve the 
problem overall and also more important part is that the 'hard limits' might 
cause regressions for people who do compile() calls. 

For normal windows builds (as @kj noted) something might work in the current 
revision and we might just break it with introducing hard limits. Since the 
trees are tend to get really branchy, I don't think it is a good idea.

I'm open to any proposals/plans 

Extra: In the worst case that we can't come up with something (the AST 
converter functions are really long 2000+ LoC C functions so it is possible 
that there might be stuff that eats a lot of space on the stack), we can either
   a) revert => not a good option, this is not a regression on the python 
itself. It is a fix for other os's and windows release builds
   b) always skip the test on windows => we can do that but it might be 
counterintuitive for the future
   c) use a really low recursion limit for the test_recursion_* for windows => 
I'm open to fallback to this if nothing comes up. 

we might need to revert this though as is it is not a regression. It used to 
crash with the same exact error, just outside of the test suite, and now since 
it works for linux/macos/others + windows for release builds I wonder whether 
can just skip the test on windows and keep it as is in the worst scenario).

--

___
Python tracker 

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



[issue44317] Suggestion for better syntax errors in tokenizer errors

2021-06-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

PR 26555 does some improvements to your examples:

>>> 0777
  File "", line 1
0777
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use 
an 0o prefix for octal integers
>>> 0
  File "", line 1
0
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use 
an 0o prefix for octal integers
>>> 0b1112
  File "", line 1
0b1112
 ^
SyntaxError: invalid digit '2' in binary literal
>>> 0o91
  File "", line 1
0o91
  ^
SyntaxError: invalid digit '9' in octal literal
>>> 0b21
  File "", line 1
0b21
  ^
SyntaxError: invalid digit '2' in binary literal
>>>

--

___
Python tracker 

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



[issue44317] Suggestion for better syntax errors in tokenizer errors

2021-06-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25141
pull_request: https://github.com/python/cpython/pull/26554

___
Python tracker 

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



[issue44304] segmentation fault appeared in python 3.10.0b2

2021-06-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 317e9ed4363a86b1364573c5a5e30011a080ce6d by Miss Islington (bot) 
in branch '3.10':
bpo-44304: Ensure the sqlite3 destructor callback is always called with the GIL 
held (GH-26551) (GH_26552)
https://github.com/python/cpython/commit/317e9ed4363a86b1364573c5a5e30011a080ce6d


--

___
Python tracker 

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



[issue44186] TimedRotatingFileHandler overwrite log

2021-06-05 Thread Harry


Change by Harry :


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

___
Python tracker 

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



[issue44304] segmentation fault appeared in python 3.10.0b2

2021-06-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25139
pull_request: https://github.com/python/cpython/pull/26552

___
Python tracker 

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



[issue44304] segmentation fault appeared in python 3.10.0b2

2021-06-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6e3b7cf3af3ed7758b2c2193c1d393feb8ab8f72 by Pablo Galindo in 
branch 'main':
bpo-44304: Ensure the sqlite3 destructor callback is always called with the GIL 
held (GH-26551)
https://github.com/python/cpython/commit/6e3b7cf3af3ed7758b2c2193c1d393feb8ab8f72


--

___
Python tracker 

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



[issue44293] PEP 585 breaks inspect.isclass

2021-06-05 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Uploaded typing_inspect 0.7.0 to PyPI (it should work with Python 3.9 hopefully)

--

___
Python tracker 

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



[issue44319] setup openssl faild on linux (ubuntu 20.04)

2021-06-05 Thread Christian Heimes


Change by Christian Heimes :


--
assignee: christian.heimes -> 
nosy:  -christian.heimes

___
Python tracker 

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



[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Mark Bell

Mark Bell  added the comment:

> Instead, the discussion was focused on removing *all* empty strings from the 
> result.

I imagine that the discussion focussed on this since this is precisely what 
happens when sep=None. For example, 'a b   c ​'.split() == ['a', 'b', 
'c']. I guess that the point was to provide users with explicit, manual control 
over whether the behaviour of split should drop all empty strings or retain all 
empty strings instead of this decision just being made on whether sep is None 
or not.

So I wonder whether the "expected" solution for parsing CSV like strings is for 
you to actually filter out the empty strings yourself and never pass them to 
split at all. For example by doing something like:

[line.split(sep=',') for line in content.splitlines() if line]

but if this is the case then this is the kind of thing that would require 
careful thought about what is the right name for this parameter / right way to 
express this in the documentation to make sure that users don't fall into the 
trap that you mentioned.

> Sorry that I bring this up only now when the discussion was finished and the 
> work on PR completed; I wish I had seen the issue sooner.

Of course, but the main thing is that you spotted this before the PR was merged 
:)

--

___
Python tracker 

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



[issue44304] segmentation fault appeared in python 3.10.0b2

2021-06-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25138
pull_request: https://github.com/python/cpython/pull/26551

___
Python tracker 

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



[issue42194] Docs for argparse.BooleanOptionalAction missing "New in version 3.9"

2021-06-05 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Am inclined to merge the former PR because yours is just an exact replica.

Please note that we can merge such small fixes without the author signing the 
CLA but the author is advised to sign the CLA for future contributions.

Source: informed by other core devs on reviewing similar PRs recently and a 
similar discussion was on a ML some time back.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue44317] Suggestion for better syntax errors in tokenizer errors

2021-06-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
title: Problems of int literal SyntaxErrors -> Suggestion for better syntax 
errors in tokenizer errors

___
Python tracker 

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



[issue44317] Problems of int literal SyntaxErrors

2021-06-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Is this expected?

Yes, is an edge case of python identifiying two tokens together except that 
there is no space:

>>> 3 4
  File "", line 1
3 4
^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?


I honestly don't share your concerns that these things are "misleading". The 
caret is pointing to the token that is incorrect 0777. The tokenizer errors 
always point at the end of the token (we still have not implemented ranged 
errors for the tokenizer).

This is true in all the cases you present.

--

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-05 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue44304] segmentation fault appeared in python 3.10.0b2

2021-06-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> sqlit3.Cursor is prone to the same bug.

No, is not: it doesn't drop the GIL in tp_clear. There is technically no bug, 
but is true that tp_clear should only clean Python references. Although in this 
case there are some sematics with the cleanup that are not clear.

--

___
Python tracker 

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



[issue44319] setup openssl faild on linux (ubuntu 20.04)

2021-06-05 Thread Battant


New submission from Battant :

Hello,
Here is my configuration


command for ubuntu distributions

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:Ubuntu 20.04.2 LTS
Release:20.04
Codename:   focal

linux kernel version
uname -r
5.4.0-74-generic


Step to reproduce

1. compile openssl 1.1.1

https://stackoverflow.com/questions/53543477/building-python-3-7-1-ssl-module-failed


clone cpython on main branch
https://github.com/python/cpython



comple python
go to module directory

run python3.11 setup.py install

Actuel result : 

I get this error : 

Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer

running build_scripts
error: file 
'/usr/local/lib/python3.11/config-3.11-x86_64-linux-gnu/Tools/scripts/pydoc3' 
does not exist

Expend result :

python3.11 modules could be installed

Could you help me to fix this issus

Best regards

Battant

--
assignee: christian.heimes
components: SSL
messages: 395180
nosy: Battant, christian.heimes
priority: normal
severity: normal
status: open
title: setup openssl faild on linux (ubuntu 20.04)
versions: Python 3.11

___
Python tracker 

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



[issue44317] Problems of int literal SyntaxErrors

2021-06-05 Thread wyz23x2


wyz23x2  added the comment:

Another 2 problems:
1.
>>> 0b1112
  File "", line 1
0b1112
 ^
SyntaxError: invalid digit '2' in binary literal
>>> 0o5780
  File "", line 1
0o5780
^
SyntaxError: invalid digit '8' in octal literal
But:
>>> 0x2fag
  File "", line 1
0x2fag
^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
>>> 
Is this expected?

2.
>>> 0o91
  File "", line 1
0o91
 ^
SyntaxError: invalid digit '9' in octal literal
>>> 0b21
  File "", line 1
0b21
 ^
SyntaxError: invalid digit '2' in binary literal

The ^ is misplaced again, even though, say the 0b1112 example above works.

--
title: Misleading mark of octal SyntaxErrors -> Problems of int literal 
SyntaxErrors

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25137
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26550

___
Python tracker 

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



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-06-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

PR 26351 adds the Py_TPFLAGS_IMMUTABLETYPE type flag to all types converted to 
heap type during 3.10 development.

--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> The stack size for a window build is currently set to 2MB, which is usually 
> lesser than *nix 8MB. So I think an easy solution is to increase the stack 
> size for windows builds.

> I'm guessing release builds aren't affected because some of the 
> Py_EnterRecursiveCall helper functions are probably inlined and thus use less 
> of the stack.

> Opinions are greatly appreciated.

I don't think that we should make a global change for this case, AFAIK some of 
the core parts of the interpreter maintain their own recursion checks with 
different handling of windows limits. E.g;

https://github.com/python/cpython/blob/fa106a685c1f199aca5be5c2d0277a14cc9057bd/Python/marshal.c#L25-L40

We might need to end up with the same motion and do the handling by ourselves. 
Wdyt @pablogsal @kj?

--

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-05 Thread Bluenix


Bluenix  added the comment:

>>> (1).__dict__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'int' object has no attribute '__dict__'
>>> 4.5.__dict__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'float' object has no attribute '__dict__'
>>> 'Hello'.__dict__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'str' object has no attribute '__dict__'
>>> b'50'.__dict__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'bytes' object has no attribute '__dict__'
>>> [2.72, 3.14].__dict__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'list' object has no attribute '__dict__'


> __slots__ allow us to explicitly declare data members (like properties) and 
> deny the creation of __dict__ and __weakref__ (unless explicitly declared in 
> __slots__ or available in a parent.)

>From https://docs.python.org/3/reference/datamodel.html

They don't have __slots__, nor a __dict__ or __weakref__:

>>> (1).__weakref__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'int' object has no attribute '__weakref__'
>>> 4.5.__weakref__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'float' object has no attribute '__weakref__'
>>> 'Hello'.__weakref__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'str' object has no attribute '__weakref__'
>>> b'50'.__weakref__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'bytes' object has no attribute '__weakref__'
>>> [2.72, 3.14].__weakref__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'list' object has no attribute '__weakref__'

They're essentially C extension classes: 
https://docs.python.org/3/extending/newtypes_tutorial.html

I am not sure what this argument was meant to prove.


What would be the downside to adding __slots__ to asyncio's classes? Other than 
that someone can no longer arbitrarily add attributes?

--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +lukasz.langa
priority: normal -> release blocker
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue44304] segmentation fault appeared in python 3.10.0b2

2021-06-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

sqlit3.Cursor is prone to the same bug. Do you want me to create a new issue 
for it, or can I reuse this issue number, Pablo? I'll see if I can create a 
reproducer for that as well.

--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> Batuhan, can you take a look?

Yes.

--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Batuhan, can you take a look?

--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-05 Thread Ken Jin


Ken Jin  added the comment:

The newly added test ``test_recursion_direct`` seems to trigger a stack 
overflow on windows in debug mode instead of a RecursionError. Release mode 
isn't affected and the test passes there.

One of the buildbots reflects this too: 
https://buildbot.python.org/all/#/builders/146/builds/337/steps/4/logs/stdio

I can avoid the crash by lowering the recursion limit in Python from 1000 to 
500. The stack size for a window build is currently set to 2MB, which is 
usually lesser than *nix 8MB. So I think an easy solution is to increase the 
stack size for windows builds.

I'm guessing release builds aren't affected because some of the 
Py_EnterRecursiveCall helper functions are probably inlined and thus use less 
of the stack.

Opinions are greatly appreciated.

--
nosy: +kj

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-05 Thread wyz23x2


Change by wyz23x2 :


--
nosy:  -wyz23x2

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-05 Thread wyz23x2


wyz23x2  added the comment:

OK, so:
>>> (1).__slots__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'int' object has no attribute '__slots__'
>>> 4.5.__slots__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'float' object has no attribute '__slots__'
>>> complex(5, 2).__slots__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'complex' object has no attribute '__slots__'
>>> 'Hello'.__slots__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'str' object has no attribute '__slots__'
>>> b'50'.__slots__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'bytes' object has no attribute '__slots__'
>>> [2.72, 3.14].__slots__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'list' object has no attribute '__slots__'
>>> 

Many many more.
So these *all* need __slots__???
That a major change into Python 5000.

--
nosy: +wyz23x2

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-05 Thread Bluenix


Bluenix  added the comment:

> What is the problem with this?

The problem is that asyncio *is not* defining __slots__.

> Setting __slots__ in base class is required if you want to get a benefit of 
> setting __slots__ in any of subclasses.

That is my use-case for this.

--

___
Python tracker 

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



[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

To clarify with pseudocode, this is how it could work:

'' => []   # sep=None, keep_single_empty=False
'' => [''] # sep=None, keep_single_empty=True
'' => []   # sep=',', keep_single_empty=False
'a,,' => ['a','','']# sep=',', keep_single_empty=False

I guess `keepempty=False` could be too easily confused for filtering out all 
empties.

--

___
Python tracker 

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



[issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers

2021-06-05 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Oh, sorry bad wording.

OK, I see. Will take a look soon.

> it looks like we can refactor SysLogHandler to inherit from SocketHandler. 
> Not sure if it should be done in this PR

Better a separate PR for that, I feel.

Removing the older Pythons from the issue, as this is an enhancement request.

--
versions:  -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Mark:

With sep=None, I don't think there is an issue. My only concern is when sep is 
set to some other value.

The original issue was that the single empty str result is removed when using 
sep=None and that it's kept when sep is some other value. So the most direct 
solution would seem to be to have a flag that controls the removal/retention of 
a single empty str in results.

Instead, the discussion was focused on removing *all* empty strings from the 
result.

My concern is that this doesn't solve the original issue in some cases, i.e. if 
I want to use a sep other than None, and I want an empty line to mean there are 
no values (result=[]), but I do want to keep empty values (a,, => [a,'','']) -- 
all of these seem like fairly normal, not unusual requirements.

The second concern, as I noted in previous message, is a potential for bugs if 
this flag being interpreted narrowly as a solution for the original issue only.

[Note I don't think it would be a very widespread bug but I can see it 
happening occasionally.]

I think to avoid both of these issues we could change the flag to narrowly 
target the original issue, i.e. one empty str only. The name of the flag can 
remain the same or possibly something like `keep_single_empty` would be more 
explicit (though a bit awkward).

The downside is that we'd lose the convenience of splitting and filtering out 
all empties in one operation.

Sorry that I bring this up only now when the discussion was finished and the 
work on PR completed; I wish I had seen the issue sooner.

--

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What is the problem with this?

Setting __slots__ is needed if we want to save memory for creating a lot of 
instances. It can also be used for preventing adding arbitrary attributes 
and/or making weak references. Setting __slots__ in base class is required if 
you want to get a benefit of setting __slots__ in any of subclasses.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-05 Thread Bluenix


New submission from Bluenix :

Most of asyncio's classes are missing a __slots__ attribute - for example Lock, 
Event, Condition, Semaphore, BoundedSemaphore all from locks.py; or Future, 
FlowControlMixin, Queue, BaseSubprocessTransport from various other parts of 
asyncio.

--
components: asyncio
messages: 395165
nosy: Bluenix2, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Asyncio classes missing __slots__
versions: Python 3.10

___
Python tracker 

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



[issue16970] argparse: bad nargs value raises misleading message

2021-06-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay, I trust that this can be closed.

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



[issue16970] argparse: bad nargs value raises misleading message

2021-06-05 Thread Bonifacio


Bonifacio  added the comment:

Every PR related to this issue (even the ones only referenced during the 
discussion) was already merged.

Latest message is from more than one year and a half ago. The only thing left 
to do here would be the backport to 3.7, but according to Guido it could just 
be skipped (since it's just an improved error message). I don't think Sushma is 
still interested in this, so I guess this could be closed?

--
nosy: +Bonifacio2

___
Python tracker 

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



[issue44304] segmentation fault appeared in python 3.10.0b2

2021-06-05 Thread mike bayer


mike bayer  added the comment:

great news!   

Based on how many random factors were needed to reproduce as well as that it 
seemed to be gc related and appeared very suddenly, I had an intuition this was 
on the cpython side, thanks so much for doing this Pablo!

--

___
Python tracker 

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



[issue44317] Misleading mark of octal SyntaxErrors

2021-06-05 Thread wyz23x2


New submission from wyz23x2 :

Python 3.10.0b2 (tags/v3.10.0b2:3173141, Jun  1 2021, 09:05:29) [MSC v.1928 64 
bit (AMD64)] on win32 
Type "help", "copyright", "credits" or "license" for more information.
>>> 0777
  File "", line 1
0777
   ^
SyntaxError: leading zeros in decimal integer literals are not permitted; use 
an 0o prefix for octal integers
>>> 000123
  File "", line 1
000123
 ^
SyntaxError: leading zeros in decimal integer literals are not permitted; use 
an 0o prefix for octal integers

The ^ is placed below the last digit.
However, this is misleading. The error is "leading zeros" and "prefix". So I 
would expect this:

>>> 0777
  File "", line 1
0777
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use 
an 0o prefix for octal integers
>>> 000123
  File "", line 1
000123
^^^
SyntaxError: leading zeros in decimal integer literals are not permitted; use 
an 0o prefix for octal integers

Opinions?

--
components: Parser
messages: 395161
nosy: lys.nikolaou, pablogsal, wyz23x2
priority: normal
severity: normal
status: open
title: Misleading mark of octal SyntaxErrors
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue44309] Add support for yescrypt in crypt.

2021-06-05 Thread Christian Heimes


Christian Heimes  added the comment:

I'm against adding additional methods to the crypt module.

- libcrypt / libxcrypt are unreliable providers. The library is only available 
on Unix-like platforms, not on Windows. Available algorithms are not 
consistent, e.g. some platforms only provide old, bad implementations. Others 
only support a limited subset or disable some algorithms in their crypto 
policies.
- We still plan to deprecate and remove the crypt module because it's not 
reliable.

I suggest that you rather create a PyPI package with yescrypt implementation 
that does not rely on libcrypt.

--

___
Python tracker 

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



[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Mark Bell


Mark Bell  added the comment:

Andrei: That is a very interesting observation, thank you for pointing it out. 
I guess your example / argument also currently applies to whitespace separation 
too. For example, if we have a whitespace separated string with contents:

col1 col2 col3
a b c

x y z

then using [row.split() for row in contents.splitlines()] results in
[['col1', 'col2', 'col3'], ['a', 'b', 'c'], [], ['x', 'y', 'z']]

However if later a user appends the row:

p  q

aiming to have p, and empty cell and then q then they will actually get

[['col1', 'col2', 'col3'], ['a', 'b', 'c'], [], ['x', 'y', 'z'], ['p', 'q']]

So at least this patch results in behaviour that is consistent with how split 
currently works. 

Are you suggesting that this is something that could be addressed by clearer 
documentation or using a different flag name?

--

___
Python tracker 

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



[issue44309] Add support for yescrypt in crypt.

2021-06-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +christian.heimes
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue44310] Document that lru_cache uses hard references

2021-06-05 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I saw the thread but the idea was rejected by @rhettinger who seems to suggest 
the changes in the documentation this time himself.

Maybe he has changed his mind, in which case he can explain the circumstances 
of his decisions if he wants.

--

___
Python tracker 

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



[issue44310] Document that lru_cache uses hard references

2021-06-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a full duplicate of issue19859. Both ideas of using weak references and 
changing documentation were rejected.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
superseder:  -> functools.lru_cache keeps objects alive forever

___
Python tracker 

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



[issue44013] tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization

2021-06-05 Thread Thomas Jollans


Thomas Jollans  added the comment:

Hello Xiang Zhong,

You're almost correct, but not quite.

File descriptors/file numbers are just integers assigned by the operating 
system, and Python has little to no control over them. The OS keeps a numbered 
list of open files for each process, and Python can make system calls like 
"read 10 bytes from file 5" or "write these 20 bytes to file 1".

Also good to know: 0 is stdin, 1 is stdout, 2 is stderr, 3+ are other files.

Now, what happens:

# Python asks the OS to open a new file. The OS puts the new file on
# the list and gives it the lowest number that is not in use: 3.
fd = tempfile.TemporaryFile()
# fd is an file object for file no 3
with open(fd.fileno()) as f:
# f is another object for file no 3
pass # I know fd is closed after with is done
# the with statement closes file no 3
# fd does not know that file no 3 is closed. (and has no way of knowing!)

# Python asks the OS to open a new file. The OS puts the new file on
# the list and gives it the lowest number that is not in use: 3.
_tmp = tempfile.TemporaryFile()
# A new temporary file object is created for file no 3
fd = _tmp
# The old fd is finalized. It still thinks it has control of file
# no 3, so it closes that. The new temporary file object is given
# the name fd.


Aside: f.fileno() is not more "advanced" than f.name. It's just that, in the 
case of tempfile.TemporaryFile, the file is immediately deleted and ends up 
having no name, so f.name falls back on returning the file number. I just 
preferred it here to be explicit about what's going on. Normally f.name would 
be a string (and it is for a TemporaryFile on Windows!); here, it's an int.

--

___
Python tracker 

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