[issue44184] crash on windows invoking flake8

2021-05-20 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

It's reproducible. I reproduced it on my Windows 10 with Python 3.10.0b1

--

___
Python tracker 

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



[issue44185] mock_open file handle __exit__ does not call close

2021-05-20 Thread William Sjoblom


New submission from William Sjoblom :

A common testing scenario is assuring that opened files are closed. Since 
unittest.mock.mock_open() can be used as a context manager, it would be 
reasonable to expect its __exit__ to invoke close so that one can easily assert 
that the file was closed, regardless of if the file was opened with a plain 
call to open or with a context manager.

--
components: Library (Lib)
messages: 394005
nosy: williamsjoblom
priority: normal
severity: normal
status: open
title: mock_open file handle __exit__ does not call close
type: enhancement
versions: Python 3.10, Python 3.11, 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



[issue44163] IDLE ValueError in HyperParser

2021-05-20 Thread Tal Einat


Tal Einat  added the comment:

I took a look but can't see any obvious bugs there. ISTM that's a rather 
harmless edge case. I can't think of anything to do with this except to close 
for now, and reopen if this pops up again.


Thinking a few steps forward, to make sense of such issues, it would be greatly 
beneficial to get a full stack dump rather than just a traceback. Perhaps we 
should add something of the sort to IDLE, ideally something which works even 
when not running from the command line?

--

___
Python tracker 

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



[issue44185] mock_open file handle __exit__ does not call close

2021-05-20 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue43295] datetime.strptime emits IndexError on parsing 'z' as %z

2021-05-20 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like the issue is fixed, I close it.

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



[issue44166] Make IndexError messages for list more informative

2021-05-20 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre

___
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-05-20 Thread Eiji Ito


New submission from Eiji Ito :

If you use TimedRotatingFileHandler and specify when='midnight',atTime, the log 
will always rollover if you start it at the same time as atTime.

For example, if atTime='00:00:00', and you run a script that outputs logs using 
the logger library twice at 00:00:00, the log that was rolled over the first 
time will be overwritten by the second rollover, and the 1st rollovered log 
will be lost.

--
components: Library (Lib)
messages: 394009
nosy: aeg
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler overwrite log
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue44169] Add HTTPS support to http.server

2021-05-20 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is already proposed in issue 40990 for which I am working on a PR.

--
nosy: +remi.lapeyre
versions: +Python 3.11 -Python 3.9

___
Python tracker 

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



[issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own

2021-05-20 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own

2021-05-20 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +24866
pull_request: https://github.com/python/cpython/pull/26262

___
Python tracker 

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



[issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own

2021-05-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24867
pull_request: https://github.com/python/cpython/pull/26263

___
Python tracker 

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



[issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own

2021-05-20 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset b9258b03b864520525176f927156b85a532a9d7c by Miss Islington (bot) 
in branch '3.9':
bpo-36160: Fix test_site so that it can run independently of other tests 
(GH-12131) (GH-26263)
https://github.com/python/cpython/commit/b9258b03b864520525176f927156b85a532a9d7c


--
nosy: +iritkatriel

___
Python tracker 

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



[issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own

2021-05-20 Thread Irit Katriel


Change by Irit Katriel :


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



[issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own

2021-05-20 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 4389711ce935bef3844dd24d7fe8460a5fef62e6 by Miss Islington (bot) 
in branch '3.10':
bpo-36160: Fix test_site so that it can run independently of other tests 
(GH-12131) (GH-26262)
https://github.com/python/cpython/commit/4389711ce935bef3844dd24d7fe8460a5fef62e6


--

___
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-05-20 Thread Eiji Ito


Change by Eiji Ito :


Added file: https://bugs.python.org/file50053/log.py

___
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-05-20 Thread Mark Bell


Mark Bell  added the comment:

Thank you very much for confirming these test cases. Using these I believe that 
I have now been able to complete a patch that would implement this feature. The 
PR is available at https://github.com/python/cpython/pull/26222. As I am a 
first-time contributor, please could a maintainer approve running the CI 
workflows so that I can confirm that all the (new) tests pass.

--

___
Python tracker 

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



[issue44187] Implement infrastructure for quickening and specializing

2021-05-20 Thread Mark Shannon


New submission from Mark Shannon :

As described in PEP 659 (Specializing Adaptive Interpreter) the first part of 
implementing specialization is to implement the machinery to do the quickening.

Conceptually, this is fairly simple: add a new field to the code object, which 
points to the first instruction in the bytecode.

When quickening, we create a new array, copy the old bytecode into it, and make 
the new field point to it.

Without any specialization or superinstructions, this will just waste memory.
However, it will pay off soon enough as we implement superinstructions, remove 
the old "opcache" and add new specializations.

We expect to see worthwhile speed ups with just superinstructions, and large 
speedups when all the above features have been implemented.

--
assignee: Mark.Shannon
messages: 394013
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Implement infrastructure for quickening and specializing
type: performance

___
Python tracker 

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



[issue44187] Implement infrastructure for quickening and specializing

2021-05-20 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes

2021-05-20 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

See also bpo-42376

--
nosy: +erlendaasland

___
Python tracker 

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



[issue43905] dataclasses.astuple does deepcopy on all fields

2021-05-20 Thread Erik Carstensen


Erik Carstensen  added the comment:

Would it make sense to make dataclasses iterable, like so?

def __iter__(self):
return (getattr(self, field.name) for field in fields(self))

With that in place, deprecating astuple would maybe be less disruptive?

--

___
Python tracker 

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



[issue44177] Unable to get the else while parsing through AST module

2021-05-20 Thread Bikram Singh Mehra


Bikram Singh Mehra  added the comment:

Hi Eric,

I have tried the action plan suggested by you in your last comment, but below 
are my logs and still I am unable to get lineno for else statement.


The respective line no for each line are below 


1 
2 if num > 0:
3 print("Positive number")
4 elif num == 0:
5 print("Zero")
6 else:
7 print("Negative number")



>The re-formatted dump is as below and doesn't have lineno for else statement

Module(body=[If(test=Compare(left=Name(id='num', ctx=Load(), lineno=2, 
col_offset=3, end_lineno=2, end_col_offset=6), 
 ops=[Gt()], 
comparators=[Constant(value=0, kind=None, lineno=2, col_offset=9, end_lineno=2, 
end_col_offset=10)], lineno=2, col_offset=3, end_lineno=2, end_col_offset=10), 
 body=[Expr(value=Call(func=Name(id='print', 
ctx=Load(), lineno=3, col_offset=4, end_lineno=3, end_col_offset=9),
   args=[Constant(value='Positive 
number', kind=None, lineno=3, col_offset=10, end_lineno=3, 

end_col_offset=27)], 

keywords=[], lineno=3, col_offset=4, end_lineno=3, end_col_offset=28), 
lineno=3, col_offset=4, 
end_lineno=3, end_col_offset=28)], 
orelse=[If(test=Compare(left=Name(id='num', 
ctx=Load(), lineno=4, col_offset=5, end_lineno=4, end_col_offset=8),

 ops=[Eq()], 

 comparators=[Constant(value=0, kind=None, lineno=4, col_offset=12, 
end_lineno=4, 

 end_col_offset=13)], lineno=4, col_offset=5, end_lineno=4, end_col_offset=13), 

body=[Expr(value=Call(func=Name(id='print', ctx=Load(), lineno=5, col_offset=4, 
end_lineno=5, end_col_offset=9), 

args=[Constant(value='Zero', kind=None, lineno=5, 
col_offset=10, end_lineno=5, 

end_col_offset=16)], 

keywords=[], lineno=5, col_offset=4, end_lineno=5, 
end_col_offset=17), lineno=5, col_offset=4, end_lineno=5, end_col_offset=17)], 

orelse=[Expr(value=Call(func=Name(id='print', ctx=Load(), lineno=7, 
col_offset=4, end_lineno=7, end_col_offset=9), 

args=[Constant(value='Negative number', kind=None, lineno=7, 
col_offset=10, end_lineno=7, end_col_offset=27)], 

keywords=[], lineno=7, col_offset=4, end_lineno=7, 
end_col_offset=28), 

lineno=7, col_offset=4, end_lineno=7, end_col_offset=28)], 
lineno=4, col_offset=0, end_lineno=7,

end_col_offset=28)], 
lineno=2, col_offset=0, 
end_lineno=7, end_col_offset=28)], type_ignores=[])




> If we use tree to get the lineno then its giving as below 
tree.body[0].orelse[0].orelse[0].lineno
7



Here the lineno 7 denotes to the body of else statement not the else lineno.


Could you please help me out where you can show the respective line no of else 
statement i.e. 6 in above example.

Thanks and Best Regards,
Bikram

--
resolution: works for me -> 
status: closed -> open

___
Python tracker 

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



[issue44188] ThreadPoolExecutor unbalanced semaphore count

2021-05-20 Thread Bennie Swart


New submission from Bennie Swart :

The concurrent.futures.ThreadPoolExecutor class, which is the default asyncio 
executor, introduced the _idle_semaphore field in version 3.8 in order to track 
idle threads so they can be reused before increasing the pool size 
unnecessarily.
This semaphore counter becomes unbalanced when the thread pool is 
over-saturated, as can be seen in the file provided. This is due to workers 
always incrementing the count after finishing a job, whereas the executor only 
decrements the count if it is already greater than 0.
This seems to be a logic bug unrelated to the running environment and 
introduced since python 3.8.

--
components: asyncio
files: bug.py
messages: 394017
nosy: asvetlov, bennieswart, yselivanov
priority: normal
severity: normal
status: open
title: ThreadPoolExecutor unbalanced semaphore count
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50054/bug.py

___
Python tracker 

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



[issue44177] Unable to get the else while parsing through AST module

2021-05-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy:  -pablogsal

___
Python tracker 

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



[issue44188] ThreadPoolExecutor unbalanced semaphore count

2021-05-20 Thread Bennie Swart


Change by Bennie Swart :


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

___
Python tracker 

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



[issue44177] Unable to get the else while parsing through AST module

2021-05-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

There's no actual code associated with the "else" line, so there's no way to 
get the line number. dis.dis(sample_data) might give you some insight.

Since this all works as designed, I'm going to close this issue. You might get 
more help on StackOverflow or similar.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue43905] dataclasses.astuple does deepcopy on all fields

2021-05-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

No, iteration is explicitly a non-goal of PEP 557. See the section on 
namedtuple for why: 
https://www.python.org/dev/peps/pep-0557/#why-not-just-use-namedtuple

--

___
Python tracker 

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



[issue44189] multiprocessing AF_PIPE name format is slightly confusing in the docs

2021-05-20 Thread Antony Lee


New submission from Antony Lee :

https://docs.python.org/3/library/multiprocessing.html#address-formats 
currently states

> An 'AF_PIPE' address is a string of the form r'\.\pipe{PipeName}'. To use 
> Client() to connect to a named pipe on a remote computer called ServerName 
> one should use an address of the form r'\ServerName\pipe{PipeName}' instead.

which suggests that if the pipe is named "foo", the string should be 
r'\.\pipe{foo}' (especially given that the other substituted string, 
ServerName, is given in italics... but actually the correct format is 
r'\.\pipe\foo'.

Hence I would suggest fixing the markup to give name formats as 
r'\.pipe\PipeName' where PipeName, is in italics, like ServerName.

--
assignee: docs@python
components: Documentation
messages: 394020
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: multiprocessing AF_PIPE name format is slightly confusing in the docs

___
Python tracker 

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

2021-05-20 Thread Fred


Fred  added the comment:

It could look for a existing certificate in a well-known location, and could 
fallback to an self-signed certificate that could be shipped with Python.

--
nosy: +Fred

___
Python tracker 

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



[issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes

2021-05-20 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I'm not sure if bpo-42376 is same as this one. Yes the basic idea to provide 
abstraction and make it easy for the users to add type is same but the 
approaches suggested are completely different. I propose a new structure member 
in PyModuleDef be added where we can just specify the address of the types and 
then in PyModule_Create add those automatically and set the member back to 
NULL. This will not be a performance improvement just an enhancement to allow 
adding types more easily. The only thing I'm concerned about is that will it 
break the Stable ABI? It'll not break C extensions though.

--

___
Python tracker 

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



[issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes

2021-05-20 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

How will you differentiate which types should be added to the module dict and 
which not to add. How will you map the instantiated type objects to the 
respective module state members?

--

___
Python tracker 

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



[issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes

2021-05-20 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

In PyModule_Create -> PyModule_Create2 -> SomeFunc... it would loop through the 
array of object addresses and call PyModule_AddType on each and every one of 
them. This will not change behavior or control flow only implement a handy way. 
This I've found very distrubing,

PyModule_AddType(&Example1);
PyModule_AddType(&Example2);
PyModule_AddType(&Example3);


The proposed way will be

PyModuleDef examplemodule = {
...
.types = {Example1, Example2, Example3};
...
}

Now just calling PyModule_Create (not PyModule_Init or any other initialization 
function) would add those types automatically.

--

___
Python tracker 

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



[issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes

2021-05-20 Thread Christian Heimes


Christian Heimes  added the comment:

I suggest you try to implement your proposal first before you post it. 
(spoilers: you will notice that it doesn't work for non-trivial heap types.)

--
nosy: +christian.heimes

___
Python tracker 

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



[issue38820] Make Python compatible with OpenSSL 3.0.0

2021-05-20 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +24870
pull_request: https://github.com/python/cpython/pull/26266

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-20 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
pull_requests: +24871
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/26267

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Anthony Sottile


Anthony Sottile  added the comment:

everything in this virtualenv is pure python so I don't think it's a faulty 
third party extension module

--

___
Python tracker 

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



[issue44185] mock_open file handle __exit__ does not call close

2021-05-20 Thread Pierre Ossman


Change by Pierre Ossman :


--
nosy: +CendioOssman

___
Python tracker 

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



[issue44190] Dictionary assignment shorthand

2021-05-20 Thread David Hariri


New submission from David Hariri :

In some languages, one may declare a dictionary's key and its value like so:

```
foo = "bar"

my_dict = { foo }
>> { "foo" : "bar" }
```

In Python, one must instead write:

```
foo = "bar"

my_dict = {
"foo": foo
}
>> { "foo" : "bar" }
```

I humbly suggest this change as a QoL improvement for those who work with 
dictionaries all day.

--
messages: 394027
nosy: davidhariri
priority: normal
severity: normal
status: open
title: Dictionary assignment shorthand
type: enhancement

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Christian Heimes


Christian Heimes  added the comment:

Pablo, Steve, please take a look.

--
assignee:  -> steve.dower
keywords: +3.10regression
nosy: +pablogsal
priority: normal -> deferred blocker
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



[issue38820] Make Python compatible with OpenSSL 3.0.0

2021-05-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24873
pull_request: https://github.com/python/cpython/pull/26269

___
Python tracker 

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



[issue44190] Dictionary assignment shorthand

2021-05-20 Thread Christian Heimes


Christian Heimes  added the comment:

Your proposal is not possible in Python. The object does not know under which 
variable names it is accessible. The closest you can get is this:

>>> dict(
... foo="bar"
... )
{'foo': 'bar'}

--
nosy: +christian.heimes

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-20 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
pull_requests: +24872
pull_request: https://github.com/python/cpython/pull/26268

___
Python tracker 

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



[issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes

2021-05-20 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Yes. It's becoming hard to implement both static and heap types using one 
struct member. Since this is all about implementing a helping hand when it 
comes to types I think two different members one for static and another one for 
heap would be fine. And if someone then comes up with even a better idea, then 
I'll implement that. I'm now working on implementing them.

--

___
Python tracker 

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



[issue38820] Make Python compatible with OpenSSL 3.0.0

2021-05-20 Thread miss-islington


miss-islington  added the comment:


New changeset 36843f716df7cfa67ea7cd858acb0df1fc5e980e by Miss Islington (bot) 
in branch '3.10':
bpo-38820: Test with OpenSSL 3.0.0-alpha17 (GH-26266)
https://github.com/python/cpython/commit/36843f716df7cfa67ea7cd858acb0df1fc5e980e


--

___
Python tracker 

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



[issue44187] Implement infrastructure for quickening and specializing

2021-05-20 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes

2021-05-20 Thread STINNER Victor


STINNER Victor  added the comment:

See also 
https://discuss.python.org/t/define-module-constants-in-pymoduledef/5749

--
nosy: +vstinner

___
Python tracker 

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



[issue44191] Getting an ImportError DLL load failed while importing _ssl

2021-05-20 Thread Luis González

New submission from Luis González :

Good morning everyone. First of all, I would like apologize for my poor 
english. I'm a very newby programming in python.  I'm getting an ImportError 
DLL load failed while importing _ssl. Can't find _ssl.pyd, from my EXE file 
created by de sentence "Python setup.py py2exe". The file _ssl.pyd, is at the 
same folder than the .exe file. Thanks in advance.

--
assignee: christian.heimes
components: SSL
messages: 394033
nosy: christian.heimes, lnegger
priority: normal
severity: normal
status: open
title: Getting an ImportError DLL load failed while importing _ssl
type: crash
versions: Python 3.9

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: deferred blocker -> release blocker

___
Python tracker 

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



[issue44191] Getting an ImportError DLL load failed while importing _ssl

2021-05-20 Thread Christian Heimes


Christian Heimes  added the comment:

py2exe is a third party tool and not maintained by Python core development. 
Please use resources at http://www.py2exe.org/ to get help, e.g. issue tracker 
https://github.com/py2exe/py2exe

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Is b02ba019e16f7c156ec63c2ea05c627a0fe86c48 the correct commit? I cannot 
checkout this:

❯ git clone https://github.com/pycqa/pyflakes

Cloning into 'pyflakes'...
remote: Enumerating objects: 2651, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 2651 (delta 27), reused 28 (delta 15), pack-reused 2598
Receiving objects: 100% (2651/2651), 905.17 KiB | 10.40 MiB/s, done.
Resolving deltas: 100% (1774/1774), done.

/tmp
❯ cd pyflakes

pyflakes on  master  pyenv 3.9.1
❯ git checkout b02ba019e16f7c156ec63c2ea05c627a0fe86c48

fatal: reference is not a tree: b02ba019e16f7c156ec63c2ea05c627a0fe86c48

--

___
Python tracker 

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



[issue41318] Better error message of "Cannot recover from stack overflow."

2021-05-20 Thread Irit Katriel


Irit Katriel  added the comment:

I am unable to reproduce the error with your code on 3.11.  It could be that 
recent changes in recursion handling fixed this case.

As I mentioned on the PR, adding this to the error message can make it even 
more confusing because this is not the only scenario in which this error can 
show up.

I'm closing this issue for the two reasons mentioned above.

--
nosy: +iritkatriel
resolution:  -> out of date
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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Anthony Sottile


Anthony Sottile  added the comment:

ah sorry, the branch got squash-merged

this is the equivalent revision after the merge: 
f3b1b44bf3d2d5927004fa1c2fcf1ab2def816b9

--

___
Python tracker 

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



[issue44192] Annotations, Inheritance and Circular Reference

2021-05-20 Thread ReOb


New submission from ReOb :

Basically, I have:

```
class Base:
_sub: list[Sub]

class Sub:
_parent: Base
```

What creates a circular reference.

It could be solved doing:

```
class Sub:
pass

class Base:
_sub: list[Sub]

class Sub:
_parent: Base
```

But in the annotation, I will get the class Sub without his annotations, 
methods and properties (the first definition is not updated in annotation after 
the redefinition).

Then, I suggest one of three possible solutions:

1. Update the reference to class in annotations if the class was redefined
2. Add a way to forward declaration (it could be implemented by a new reserved 
word "forward")
3. Or, like Ruby, make that the redefinition of a class, open the class to 
change the definition of class, including new methods, properties and 
annotations.

It is very important to have the correct type in annotation, because we use 
this type to create new objects dinamically, but actually is impossible to 
solve this problem because we can not have the correct definition at both 
classes: Base and Sub class.

When we use the type annotated to create a new object, as it is, we loose the 
annotations, methods and properties defined at the redefinition of the class.

This problem occurs only if we use annotations.

Like Python added the possibility to define annotations, needs to provide one 
of these solutions pointed (or another) to solve problems like this.

If the decision was to implement a forward reserved word, it could be solved 
doing:

```
class Sub:
forward

class Base:
_sub: list[Sub]

class Sub:
_parent: Base
```

If the first or third solution was preferred this code will work:

```
class Sub:
pass

class Base:
_sub: list[Sub]

class Sub:
_parent: Base
```

I hope Python could implement one of these solutions to provide a better 
support for annotations, because actually what we have are two classes, with 
the same name, that walks like a duck, swim like a duck, sound like a duck but 
they are not the same duck, and they should be.

The framework that we are developping depends strongly that we could get the 
correct type from annotation to create the correct object based on this.

I hope it could be handled as soon as possible, because change the definition 
to another class that was a super class of both classes (Base and Sub, in this 
example) will not permit us to know the correct class to create another object 
dinamically and probabily we will need to create a hack to handle this, making 
the code less Pythonic.

Thanks.

--
components: Parser
messages: 394038
nosy: lys.nikolaou, pablogsal, reob-info
priority: normal
severity: normal
status: open
title: Annotations, Inheritance and Circular Reference
type: resource usage
versions: Python 3.9

___
Python tracker 

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



[issue44192] Annotations, Inheritance and Circular Reference

2021-05-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy:  -pablogsal

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Ammar Askar


Ammar Askar  added the comment:

Can recreate on the latest 3.10 checkout, taking a look.

--
nosy: +ammar2

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread STINNER Victor


STINNER Victor  added the comment:

Where does flake8.exe come from? Is it created by pip? Or by Python? Is it part 
of the flake8 project?

--
nosy: +vstinner

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Anthony Sottile


Anthony Sottile  added the comment:

vstinner I showed the directions above, but here they are again:


venv\Scripts\pip install flake8==3.6.0
venv\Scripts\pip install -e . --no-deps  # ignore the conflict, but fix pyflakes

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

This is a flake8 error not tox error. Though if it was a complete flake8 error 
then it would fail in all Python. But it only fails in 3.10 (don't know about 
3.11 because haven't tested it yet.)

--

___
Python tracker 

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



[issue44193] socket line 46 import _socket Import Error

2021-05-20 Thread Joshex


New submission from Joshex :

I assume someone has already fixed this problem, as I am using a very old 
version of python compatible with my version of blender. Though after 
searching, I found results for the same error message only a month or 2 ago.

anyways, my version of python 2.6.2 is out of support. but I assume if this has 
recently been fixed for more recent python modules, the same sort of fix could 
be applied to my install.

The problem is, I am on 64 bit windows 7 with 64 bit python 2.6.2 installed to 
use blender 2.49b. I have a 32 bit computer and verified the error does not 
appear when importng the socket module there! only on my 32 bit computer., I 
tried uninstalling 64 bit python from C:\Python26 and reinstalling to 
C:\Program Files (x86)\Python26. I have updated the system environment 
variables, to include this in the python path.

and I still get 
"C:\Program Files (x86)\Python26\LIB\socket.py", line 46, in  
import _socket 
ImportError: DLL load failed: %1 is not a valid Win32 application

I would be happy if someone remembered the fix for this so I could apply it 
myself.

--
messages: 394043
nosy: Joshex
priority: normal
severity: normal
status: open
title: socket line 46 import _socket Import Error

___
Python tracker 

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



[issue44193] socket line 46 import _socket Import Error

2021-05-20 Thread Joshex


Joshex  added the comment:

sorry: edit, it only appears on my 64 bit computer

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Steve Stagg


Change by Steve Stagg :


--
nosy: +stestagg

___
Python tracker 

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



[issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist

2021-05-20 Thread Barney Gale


Change by Barney Gale :


--
pull_requests: +24874
pull_request: https://github.com/python/cpython/pull/26270

___
Python tracker 

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



[issue43757] pathlib: move 'resolve()' logic out of path flavour

2021-05-20 Thread Barney Gale


Change by Barney Gale :


--
pull_requests: +24875
pull_request: https://github.com/python/cpython/pull/26270

___
Python tracker 

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



[issue36203] PyWeakref_NewRef docs are misleading

2021-05-20 Thread Irit Katriel


Irit Katriel  added the comment:

Please add unit tests to the patch.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 
3.8

___
Python tracker 

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



[issue44193] socket line 46 import _socket Import Error

2021-05-20 Thread Joshex


Joshex  added the comment:

Same error when importing Tkinter

it looks like any python module that tries to import a DLL fails because it 
forgets it should be looking for a 64 bit dll and instead goes looking for a 32 
bit DLL and when it finds out it's 64 it throws a tantrum.

--

___
Python tracker 

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



[issue44193] socket line 46 import _socket Import Error

2021-05-20 Thread Joshex


Joshex  added the comment:

LOL! the issue does not happen if I uninstall the 64 bit python install the 32 
bit python and change the environment variables for the python path to the 32 
bit folders. 

so it's a problem with 64 bit python. good thing I have the 32 bit as a backup.

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Ammar Askar


Ammar Askar  added the comment:

The segfault seems to be occuring on typeobject.c:1456 during interpreter 
finalization:

if (type->tp_flags & Py_TPFLAGS_HEAPTYPE && !(base->tp_flags & 
Py_TPFLAGS_HEAPTYPE))

where `type` seems to have already been deallocated.

Here's the stack trace:

python310.dll!subtype_dealloc(_object * self) Line 1456 C
[Inline Frame] python310.dll!_Py_Dealloc(_object *) Line 2288   C
[Inline Frame] python310.dll!_Py_DECREF(_object *) Line 500 C
[Inline Frame] python310.dll!_Py_XDECREF(_object * op) Line 567 C
>   python310.dll!dict_dealloc(PyDictObject * mp) Line 2067 C
[Inline Frame] python310.dll!_Py_Dealloc(_object *) Line 2288   C
[Inline Frame] python310.dll!_Py_DECREF(_object *) Line 500 C
python310.dll!ast_clear(AST_object * self) Line 784 C
python310.dll!delete_garbage(_ts * tstate, _gc_runtime_state * gcstate, 
PyGC_Head * collectable, PyGC_Head * old) Line 1018 C
python310.dll!gc_collect_main(_ts * tstate, int generation, __int64 * 
n_collected, __int64 * n_uncollectable, int nofail) Line 1304 C
[Inline Frame] python310.dll!_PyGC_CollectNoFail(_ts *) Line 2123   
C
python310.dll!interpreter_clear(_is * interp, _ts * tstate) Line 326
C
[Inline Frame] python310.dll!_PyInterpreterState_Clear(_ts *) Line 358  
C
python310.dll!finalize_interp_clear(_ts * tstate) Line 1639 C
python310.dll!Py_FinalizeEx() Line 1813 C
[Inline Frame] python310.dll!Py_RunMain() Line 668  C
[Inline Frame] python310.dll!pymain_main(_PyArgv *) Line 696C
python310.dll!Py_Main(int argc, wchar_t * * argv) Line 708  C

--

___
Python tracker 

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



[issue44194] Folding ''.join() into f-strings

2021-05-20 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

Since strings are immutable types, we could fold some operation on top of them. 
Serhiy has done some work on issue 28307 regarding folding `str % args` 
combination, which I think we can extend even further. One simple example that 
I daily encounter is that, there is this pattern

'/'.join([something, something_else, user_arg])

where people would join N number of elements together with a separator, where 
the N is something that we know. Just a search over some locally cloned PyPI 
projects (a couple thousand, showed 5000+ occurrences where this optimization 
applies).

The preliminary benchmarks indicate that the speedup is about %40. Though there 
are multiple issues that might concern others:
   - type checking, f-strings cast automatically but .join() requires each 
element to be a string subclass. The current implementation introduces a new 
conversion called 'c' which actually does the type checking instead of 
converting the value.
   - preventing a call to a runtime function, I belive that this work is not 
that different than issue 28307 which prevents str.__mod__ though I understand 
the concern

Here is the implementation if anybody wants to take a look at it: 
https://github.com/isidentical/cpython/commit/d7ea8f6e38578ba06d28deb4b4a8df676887ec26

I believe that the implementation can be optimized further (etc if a continuous 
block of elements are a string, then we can load all of them in one go!). And 
some cases proved that the f-strings might be faster than the join by 1.7-1.8x.

--
messages: 394049
nosy: BTaskaya, eric.smith, pablogsal, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Folding ''.join() into f-strings

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Steve Stagg


Steve Stagg  added the comment:

I've found that it's reproducible if you run flake8 on a file that just 
contains:
`a.b`
whereas:
`a`
and
`a(b)`
don't seem to trigger the error.

The object being cleaned up when the segfault appears, seems to be a subclass 
of ast.AST

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Given how hairy finding these GC errors is, I would recommend to bisect this so 
we can trim down the search to some commit, although my bet is some of the heap 
type conversions.

--

___
Python tracker 

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



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-20 Thread Filipe Laíns

New submission from Filipe Laíns :

7f7e706d78ab968a1221c6179dfdba714860bd12 introduced the files() api and 
documented a importlib.abc.TraversableReader protocol, but it did not implement 
it.

This class is documented and marked as introduced in 3.9, but it's actually 
missing.

--
messages: 394052
nosy: FFY00, brett.cannon, jaraco
priority: normal
severity: normal
status: open
title: importlib.abc.TraversableReader is not implemented
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Also, why this doesn't happen on Linux?

--

___
Python tracker 

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



[issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child

2021-05-20 Thread David Edelsohn


Change by David Edelsohn :


--
nosy: +David.Edelsohn

___
Python tracker 

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



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-20 Thread Filipe Laíns

Change by Filipe Laíns :


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

___
Python tracker 

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



[issue42022] Allow ensurepip to work without bundled wheels

2021-05-20 Thread Filipe Laíns

Filipe Laíns  added the comment:

Closing as the new --with-wheel-pkg-dir option provides an alternative 
mechanism.

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

___
Python tracker 

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



[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-20 Thread Filipe Laíns

New submission from Filipe Laíns :

ResourceReader used to have this requirement, Traversable does not. We cannot 
add a requirement as there might be users not doing this, but we can ask new 
users to do so.

We should document that FileNotFoundError should be raised if a file is not 
found, but that it is not guaranteed that it will for all Traversable 
implementations for compatibility reasons.

--
assignee: docs@python
components: Documentation
messages: 394055
nosy: FFY00, brett.cannon, docs@python, jaraco
priority: normal
severity: normal
status: open
title: Document that importlib.abc.Traversable's methods should raise 
FileNotFoundError
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



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-20 Thread Filipe Laíns

Change by Filipe Laíns :


--
pull_requests: +24877
pull_request: https://github.com/python/cpython/pull/26272

___
Python tracker 

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



[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-20 Thread Filipe Laíns

Change by Filipe Laíns :


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

___
Python tracker 

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



[issue36203] PyWeakref_NewRef docs are misleading

2021-05-20 Thread Maxwell Bernstein


Change by Maxwell Bernstein :


--
pull_requests: +24879
pull_request: https://github.com/python/cpython/pull/26273

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-20 Thread Ned Deily


Ned Deily  added the comment:


New changeset c723d5191110f99849f7b0944820f6c3cd5f7747 by Senthil Kumaran in 
branch '3.7':
[3.7] bpo-43882 - Mention urllib.parse changes in Whats New section for 3.7.11 
(GH-26267)
https://github.com/python/cpython/commit/c723d5191110f99849f7b0944820f6c3cd5f7747


--

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-20 Thread Ned Deily


Ned Deily  added the comment:


New changeset 6f743e7a4da904f61dfa84cc7d7385e4dcc79ac5 by Senthil Kumaran in 
branch '3.6':
[3.6] bpo-43882 - Mention urllib.parse changes in Whats New section for 3.6.14 
(GH-26268)
https://github.com/python/cpython/commit/6f743e7a4da904f61dfa84cc7d7385e4dcc79ac5


--

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-20 Thread Ned Deily


Ned Deily  added the comment:

Thanks, Senthil and Greg! The updates for 3.7 and 3.6 are now merged. Is there 
anything else that needs to be done for this issue or can it now be closed?

--
priority: release blocker -> high
resolution: fixed -> 
stage: patch review -> commit review

___
Python tracker 

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



[issue44169] Add HTTPS support to http.server

2021-05-20 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Make http.server support SSL

___
Python tracker 

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



[issue44126] Support cross-compiling of cpython modules using setuptools

2021-05-20 Thread Jeff Moguillansky


Jeff Moguillansky  added the comment:

Is it possible to add support for cross-compiling of cpython modules to 
setuptools?
It seems that currently there's some 3rd party solutions like "crossenv" but 
they don't seem to work with clang / ndk-toolchain for example.

--
status: closed -> open
title: Cross Compile CPython Modules -> Support cross-compiling of cpython 
modules using setuptools

___
Python tracker 

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



[issue40222] "Zero cost" exception handling

2021-05-20 Thread STINNER Victor


STINNER Victor  added the comment:

Mark: Can you please document your change on types.CodeType? In:

* https://docs.python.org/dev/library/types.html#types.CodeType
* https://docs.python.org/dev/whatsnew/3.11.html

The change broke the Genshi project:
https://github.com/edgewall/genshi/issues/43

in this Genshi function:

def build_code_chunk(code, filename, name, lineno):
params =  [0, code.co_nlocals, code.co_kwonlyargcount,
  code.co_stacksize, code.co_flags | 0x0040,
  code.co_code, code.co_consts, code.co_names,
  code.co_varnames, filename, name, lineno,
  code.co_lnotab, (), ()]
if hasattr(code, "co_posonlyargcount"):
# PEP 570 added "positional only arguments"
params.insert(2, code.co_posonlyargcount)
return CodeType(*params)

--
nosy: +vstinner

___
Python tracker 

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



[issue44197] [request feature] Itertools extended combinations to limited number of repetition

2021-05-20 Thread latot


New submission from latot :

Hi, some time ago I was looking for a function in itertools, actually, the 
combination functions allow us to have or not repetitions of element, have in 
consideration that if we allow repetitions there can be any amount of them, no 
way to limit the number of repetitions.

Here I asked in stackoverflow about this if there is a lib or option, in the 
end we wasn't able to found any about this and there was an answer with the 
solution.

I think this solution worth to be added to itertools, conceptually, the actual 
2 functions of combinations are particular cases of this function.

https://stackoverflow.com/questions/67559105/combinatory-with-n-picked-elements-and-limited-repetitions-in-python/67559625

Well, there can be a extension of this too, where we can say, "how many times 
every particular element can be repeated".

Both of this things world be useful.

Thx.

--
components: Library (Lib)
messages: 394061
nosy: latot
priority: normal
severity: normal
status: open
title: [request feature] Itertools extended combinations to limited number of 
repetition

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Lets get equivalent whatsnew text into the 3.8 and 3.9 and 3.10 branches before 
closing it.

--

___
Python tracker 

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



[issue44126] Support cross-compiling of cpython modules using setuptools

2021-05-20 Thread Jeff Moguillansky


Change by Jeff Moguillansky :


--
status: open -> closed

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Ammar Askar


Ammar Askar  added the comment:

The bisect was bizarre to say the least...

It points to commit 11159d2c9d6616497ef4cc62953a5c3cc8454afb

bpo-43080: pprint for dataclass instances (GH-24389)
* Added pprint support for dataclass instances which don't have a custom 
__repr__.

which doesn't touch any C code by itself and isn't the heap type conversions.

If I check out to latest 3.10 and revert that commit, this issue seems to go 
away. Can someone else confirm just to make sure the bisect was done correctly?

--

___
Python tracker 

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



[issue44198] Add flags or function in pathlib.Path

2021-05-20 Thread Mikhail


New submission from Mikhail :

Hello! This is a very useful feature when a Path-object gets a list (or 
generator, as it is now) of files/dirs in self.dir, I think. Right now this is 
the .iterdir() function, but sometimes you only need `dirs` of that path (for 
example, I really needed the function when I was working with images for 
classification), and at the moment this is only solved by (path for path in 
root.iterdir() if path.is_dir()). You could make separate functions for this, 
but I suggest just adding the only_dirs/only_files(/only_links) flags to 
.iterdir().

--
components: Library (Lib)
messages: 394064
nosy: tetelevm
priority: normal
severity: normal
status: open
title: Add flags or function in pathlib.Path
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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Steve Stagg


Steve Stagg  added the comment:

I got the same result from a bisect:

11159d2c9d6616497ef4cc62953a5c3cc8454afb

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Steve Stagg


Steve Stagg  added the comment:

So, for me, the single line from 11159d that causes the problem is this:

pprint.py:
import dataclasses as _dataclasses

Obviously importing dataclasses here is having some side-effect

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Ammar Askar


Ammar Askar  added the comment:

Just to thicken the mystery a bit further, if you comment out

import inspect

in dataclasses.py, the error also goes away.

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

My bet is because this is caused by the AST module using heap typed here. There 
is probably a missing strong reference somewhere.

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I'm trying to reproduce on Linux but I am unable to make it fail even with the 
address sanitizer activated :(

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FWIW, I'm also unable to reproduce on macOS (so far).

--

___
Python tracker 

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



[issue14965] super() and property inheritance behavior

2021-05-20 Thread Will Razen


Will Razen  added the comment:

@simonzack Your superprop.py doesn't work for multiple inheritance, because 
you're using __thisclass__.__mro__ in each step instead of the initial object 
mro

--
nosy: +willrazen

___
Python tracker 

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



[issue44163] IDLE ValueError in HyperParser

2021-05-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

For now, I want to just improve the error message and then close.

--

___
Python tracker 

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



[issue25625] "chdir" Contex manager for pathlib

2021-05-20 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-05-20 Thread STINNER Victor


STINNER Victor  added the comment:

This bug is really hard to reproduce on Windows. It depends on flake8 is run. 
It's a random crash in the last GC collection at Python exit.

Crash related to AST in interpreter_clear() remains me bpo-41796.

Extract of the code:

static void
interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
{
...
_PyAST_Fini(interp);
...
/* Last garbage collection on this interpreter */
_PyGC_CollectNoFail(tstate);
_PyGC_Fini(interp);
...
}

The crash occurs in _PyGC_CollectNoFail().

_PyAST_Fini() clears references to AST types in the interpreter AST state. AST 
type instances hold a reference to the their heap type:

static int
ast_traverse(AST_object *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
Py_VISIT(self->dict);
return 0;
}

But the crash happens when self->dict is deallocated.

--

___
Python tracker 

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



  1   2   >