[issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined

2021-05-06 Thread Inada Naoki


Inada Naoki  added the comment:

There is a still warning, not error.

https://github.com/python/cpython/blob/985ac016373403e8ad41f8d563c4355ffa8d49ff/Python/getargs.c#L2535-L2542

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

___
Python tracker 

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



[issue44053] Can't connect to a server also not showing any type of output

2021-05-06 Thread Muqaddas Rasheed


Change by Muqaddas Rasheed :


--
nosy: muqadasrasheed652
priority: normal
severity: normal
status: open
title: Can't connect to a server also not showing any type of output

___
Python tracker 

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



[issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase"

2021-05-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think we'd want to look at the 33 uses with hyphens to make sure removing the 
hyphen is correct (as opposed to just blindly make a change). But I'm generally 
supportive.

--
nosy: +eric.smith

___
Python tracker 

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



[issue44053] Can't connect to a server also not showing any type of output

2021-05-06 Thread Eric V. Smith


New submission from Eric V. Smith :

If you think this is a bug, please attach the text of a stand-alone example 
demonstrating the problem. Please do not attach an image or a screen capture, 
use text so we can run and reproduce the problem.

That said, it's unlikely this is a bug in Python. You might want to ask for 
help on the python-list mailing list or another help forum.

--
nosy: +eric.smith
status: open -> pending

___
Python tracker 

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



[issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined

2021-05-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Why PR 20784 has been merged? Was not the plan to emit a deprecation warning 
first?

--

___
Python tracker 

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



[issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined

2021-05-06 Thread Inada Naoki


Inada Naoki  added the comment:

>Why PR 20784 has been merged? Was not the plan to emit a deprecation warning 
>first?

We had been emitted DeprecationWarning since Python 3.8. See GH-12473.
GH-20784 changed the DeprecationWarning to SystemError.

--

___
Python tracker 

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



[issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined

2021-05-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry, I was confused by Victor's long msg371219.

--

___
Python tracker 

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



[issue17681] Work with an extra field of gzip and zip files

2021-05-06 Thread Nikolaus Rath


Change by Nikolaus Rath :


--
nosy:  -nikratio

___
Python tracker 

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



[issue44051] Virtualalloc wrong return type

2021-05-06 Thread baptistecrepin


baptistecrepin  added the comment:

Thank you, I didn't know that ctypes wasn't prototyped.

I only use VirtualAlloc in combination with RtlMoveMemory and CreateThread in 
order to execute shellcodes for research purposes.

--

___
Python tracker 

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



[issue44052] patch object as argument should be explicit

2021-05-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

In my test cases I have ended up just ignoring the mock object with a 
placeholder if it's not needed. For the given use case you can do this using 
patch objects at setUp and tearDown like in 
https://docs.python.org/dev/library/unittest.mock-examples.html#applying-the-same-patch-to-every-test-method
 . I feel introducing another argument increases the complexity on the existing 
patch api which already has a lot of options.

I have added others for their thoughts on this API change.


from unittest.mock import Mock, patch
from unittest import TestCase, main


class Foo:
properties = []


class FooTest(TestCase):
def setUp(self):
patcher = patch(f"{__name__}.Foo.properties", new_callable=list)
self.addCleanup(patcher.stop)
patcher.start()

def test_foo(self):
Foo.properties.append(1)
self.assertEqual(Foo.properties, [1])

def test_bar(self):
Foo.properties.append(2)
self.assertEqual(Foo.properties, [2])


if __name__ == "__main__":
main()

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread guangli dong


guangli dong  added the comment:

can you assign "cve" for this security bug?

i will review the patch later.

--

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread Christian Heimes


Christian Heimes  added the comment:

http.server is out of scope for CVEs. The module is not designed for 
security-sensitive usage and explicitly documented as insecure and not suitable 
for production use:

https://docs.python.org/3/library/http.server.html#module-http.server

> Warning: http.server is not recommended for production. It only implements 
> basic security checks.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue37903] IDLE Shell sidebar.

2021-05-06 Thread Tal Einat


Tal Einat  added the comment:

> Is it possible to add a Settings option under the General tab to switch 
> between the sidebar mode and traditional mode?

Raymond, that should be possible, and possibly rather easily. I'll take a look 
at adding this option.

--

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f396864ddfe914531b5856d7bf852808ebfc01ae by Miss Islington (bot) 
in branch '3.8':
bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 
Continue (GH-25916) (#25933)
https://github.com/python/cpython/commit/f396864ddfe914531b5856d7bf852808ebfc01ae


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined

2021-05-06 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Stefan Behnel


New submission from Stefan Behnel :

I'm not sure if I should consider this a bug, but I'd at least frown at the 
behaviour, so I thought I'd bring this up here.

Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
>>> 2**53 == float(2**53)
True
>>> float(2**53+1) == float(2**53+1)
True
>>> 2**53+1 == float(2**53+1)
False

This probably has something to do with the 52bit exponent of double precision 
floats. But the way I would have expected this to work is that a comparison of 
an integer to a float would first convert the integer to a float, and then 
compare the two floating point values. That's also what the code says. However, 
comparing the actual two floating point values gives the expected result, 
whereas letting the comparison do the conversion internally leads to a 
different outcome. The code in float_richcompare() uses a vastly more complex 
implementation than PyLong_AsDouble(), which is likely the reason for this 
difference in behaviour.

I found this on the system Python on 64bit Ubuntu 20.04, but also tried with a 
self-built 3.10a7+, giving the same result. I'm only setting the target to 
3.10/11 since a potential behavioural change would likely not find its way back 
to 3.9 and earlier any more.

--
messages: 393077
nosy: mark.dickinson, rhettinger, scoder
priority: normal
severity: normal
status: open
title: 2**53+1  != float(2**53+1)
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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Stefan Behnel


Change by Stefan Behnel :


--
nosy: +tim.peters

___
Python tracker 

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



[issue23903] Generate PC/python3.def by scraping headers

2021-05-06 Thread Petr Viktorin


Petr Viktorin  added the comment:

The symbols exported by python3.dll are now generated from Misc/stable_abi.txt 
as per PEP 652.
See the devguide for more details: https://devguide.python.org/c-api/

This is slightly more work than generating the list fully automatically, but 
the extra work is negligible compared to all the things you should think about 
when adding API that'll be be supported until Python 4.0.


Headers are now checked on Unix (GCC) only. If anyone wants to work on a 
cross-platform C parser/checker, please let me know.

--

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread guangli dong


guangli dong  added the comment:

@Christian Heimes 

this bug is about "urllib" client library, the key point is not "http.server" 
module.

--

___
Python tracker 

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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This is not a bug. It is *literally correct* that the int 9007199254740993 is 
not equal to the float 9007199254740992.0 so I really don't know why you would 
desire a different result. If you want to compare two floats, compare two 
floats, not an int and a float.

And it's not a *potential behaviour change", it would be an actual behaviour 
change, and a serious regression.

Stefan states:

> But the way I would have expected this to work is that a comparison of an 
> integer to a float would first convert the integer to a float, and then 
> compare the two floating point values. That's also what the code says.


No it doesn't. What the code says:

2**53 + 1 == float(2**53 + 1)

not:

float(2**53 + 1) == float(2**53 + 1)

There's no conversion on the left hand side. The code literally says to compare 
an int to a float.


In general, Python is pretty good at giving as close to mathematically correct 
results as possible. If you want to compare values approximately as floats, you 
should explicitly convert them to floats.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Christian Heimes


Christian Heimes  added the comment:

2**53-1 is also the largest safe rational number in JavaScript and JSON where 
double precision floats and ints behave the same, see 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER

--
nosy: +christian.heimes

___
Python tracker 

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



[issue44055] NamedTemporaryFile opened twice on Windows

2021-05-06 Thread Lumír Balhar

New submission from Lumír Balhar :

Hello.

The documentation about tempfile.NamedTemporaryFile[0] contains:

That name can be retrieved from the name attribute of the returned file-like 
object. Whether the name can be used to open the file a second time, while the 
named temporary file is still open, varies across platforms (it can be so used 
on Unix; it cannot on Windows NT or later).

But after some testing on Windows, it seems that there is no problem in opening 
a temporary file for the second time. A simple reproducer:

from tempfile import NamedTemporaryFile
​
# Open the file for the first time
tmp_file = NamedTemporaryFile(mode="w+", delete=False)
tmp_file.write("foo")
tmp_file.seek(0)
content_original = tmp_file.read()
print("Original content:", content_original)
​
# Open the file for the second time
with open(tmp_file.name, mode="w+") as file:
file.write("bar")
file.seek(0)
content = file.read()
print("Updated content:", content)

The output is:

Original content: foo
Updated content: bar

So the question is: do I misunderstand the documentation? Or is there any 
automatic magic handling this on Windows?

I'm not a windows user and I've found this accidentally when preparing a 
Windows CI job for a project.

[0] 
https://docs.python.org/3/library/tempfile.html?highlight=namedtemporaryfile#tempfile.NamedTemporaryFile

--
assignee: docs@python
components: Documentation, Windows
messages: 393082
nosy: docs@python, frenzy, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: NamedTemporaryFile opened twice on Windows
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



[issue44056] Incorrect line number for syntax error.

2021-05-06 Thread Mark Shannon


New submission from Mark Shannon :

Consider this function, which has a syntax error on line 4.

>>> def f():
... try: 
... 1/0
... except:
... pass
... except Exception: 
... pass

3.9 reports an incorrect line number of 3.
3.10b reports an even more incorrect line number of -1.

Although I've marked this as a "Parser" bug, the offending code is in the 
compiler.

For 3.11, this is fixed by https://github.com/python/cpython/pull/25729

--
assignee: Mark.Shannon
components: Parser
messages: 393083
nosy: Mark.Shannon, lys.nikolaou, pablogsal
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Incorrect line number for syntax error.
type: behavior
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



[issue44056] Incorrect line number for syntax error.

2021-05-06 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +24606
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25939

___
Python tracker 

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



[issue44052] patch object as argument should be explicit

2021-05-06 Thread Pierre Ossman


Pierre Ossman  added the comment:

I've always been cautious about running patch() manually since it was easy to 
miss the cleanup. But those fears might be irrelevant these days when we have 
addCleanup().

Still, decorators are a more robust in more complex setups since you don't have 
to worry about setUp() being properly called in every base class. So I still 
think this would be interesting.

A different function might be an option to avoid adding arguments. Just like 
there are a few special patch.*() already.

--

___
Python tracker 

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



[issue44057] Inconsitencies in `__init_subclass__` in a generic class

2021-05-06 Thread Erez Zinman


New submission from Erez Zinman :

The following behavior was witnessed in v3.6 & v3.8.

When deriving from a Generic base class, there's an inconsistency in the order 
of operation within the `__new__()` function between the case of deriving WITH 
generic-argument specification and WITHOUT.

It might be best explained in the following example:

```
import typing

T = typing.TypeVar('T')
class Base(typing.Generic[T]):
some_attribute: typing.Any

def __init_subclass__(cls, **kwargs):
assert hasattr(cls, 'some_attribute')

class Class1(Base):   # OK
some_attribute = 123  

class Class2(Base[int]):  # AssertionError
some_attribute = 123  
```

In this examples, the base class implements `__init_subclass__` to ensure that 
sublclasses define an attribute. In the case of `Class1`, the class derives 
without specifying the type-arguments for the class. In that case, the 
`__init_subclass__` is called after the `some_attribute` is defined. In the 
second case, however, because I pass the `int` type-argument to the base-class, 
for some reason `__init_subclass__` is called BEFORE the class' definition.

--
components: Interpreter Core, Library (Lib)
messages: 393085
nosy: erezinman
priority: normal
severity: normal
status: open
title: Inconsitencies in `__init_subclass__` in a generic class
versions: Python 3.6, Python 3.8

___
Python tracker 

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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Boštjan Mejak

Boštjan Mejak  added the comment:

I would compare it like this:

>>> from decimal import Decimal
>>> 2**53 + 1 == Decimal(2**53 + 1)
True

--
nosy: +PedanticHacker

___
Python tracker 

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



[issue44057] Inconsitencies in `__init_subclass__` in a generic class

2021-05-06 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Mark Dickinson


Mark Dickinson  added the comment:

> But the way I would have expected this to work is that a comparison of an 
> integer to a float would first convert the integer to a float

I have a vague memory that that's the way it *did* work once upon a time, many 
many decades ago. But an equality comparison between int and float that simply 
converted the int to a float would break transitivity of equality, leading to 
issues with containment in sets, dicts and lists. Given

n = 2**53
x = 2.**53

if equality comparison worked as you describe you'd have n == x and x == n + 1, 
so to keep transitivity you'd have to make n == n + 1.

In short, the behaviour is very much deliberate.

> That's also what the code says.

Do you have a pointer? This may be a comment bug.

--

___
Python tracker 

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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Mark Dickinson


Mark Dickinson  added the comment:

> I have a vague memory that that's the way it *did* work once upon a time

Here we go: https://bugs.python.org/issue513866
And the corresponding commit, from September 2004: 
https://github.com/python/cpython/commit/307fa78107c39ffda1eb4ad18201d25650354c4e

--

___
Python tracker 

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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Mark Dickinson


Mark Dickinson  added the comment:

Closing here, since this isn't a bug. But I'd still like to understand better 
what Stefan meant by "That's also what the code says."

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

___
Python tracker 

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



[issue37903] IDLE Shell sidebar.

2021-05-06 Thread Tal Einat


Tal Einat  added the comment:

Upon reading Terry's previous comments here more carefully, it's clear that he 
will be adding an option to switch between this mode and an alternate mode with 
prompts on separate lines in the main text widget. The latter will be much more 
similar to the traditional mode.

--

___
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-06 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +24607
pull_request: https://github.com/python/cpython/pull/25942

___
Python tracker 

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



[issue44057] Inconsitencies in `__init_subclass__` in a generic class

2021-05-06 Thread Ken Jin


Ken Jin  added the comment:

Hi Erez, thank you for the bug report. What minor version of 3.8 are you using 
exactly? I'm able to reproduce this on 3.6.8, but not on 3.8.5.

BTW, Python 3.8 is no longer receiving bugfixes - only security fixes. The only 
versions still getting bugfixes right now are 3.9.0, 3.10b1, 3.11a1. I'm unable 
to reproduce this on those 3 versions. So I'm inclined to close this issue as 
there's not much we can do about it (we can't backport a fix to 3.8). Sorry :(.

--
nosy: +kj

___
Python tracker 

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



[issue44058] 'master' refs in 3.10 version of .azure-pipelines

2021-05-06 Thread Skip Montanaro


New submission from Skip Montanaro :

Should these references to "master" be changed to "main"?

% git co 3.10
Switched to branch '3.10'
Your branch is up to date with 'origin/3.10'.
% egrep master .azure-pipelines/*
.azure-pipelines/ci.yml:trigger: ['master', '3.10', '3.9', '3.8', '3.7']
.azure-pipelines/pr.yml:pr: ['master', '3.10', '3.9', '3.8', '3.7']

--
messages: 393092
nosy: skip.montanaro
priority: normal
severity: normal
status: open
title: 'master' refs in 3.10 version of .azure-pipelines
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



[issue44017] Deprecation warning in tests over no current event loop

2021-05-06 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue44017] Deprecation warning in tests over no current event loop

2021-05-06 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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Stefan Behnel


Stefan Behnel  added the comment:

> I really don't know why you would desire a different result.

I found it surprising that a comparison uses a different method of conversion 
than the (obvious) user-side conversion, with a different outcome. This seems 
to be implementation details leaking into the user side.


> "That's also what the code says."

I wasn't referring to a specific comment. What I meant was that the code in 
float_richcompare() goes to great length trying to convert the integer to a 
float in a safe way so that it can compare the two values.

https://github.com/python/cpython/blob/985ac016373403e8ad41f8d563c4355ffa8d49ff/Objects/floatobject.c#L403

I now see that it goes the other way at the end, though. If both values have 
the same order of magnitude, then it actually converts the float to a PyLong 
instead, thus choosing one of the integer values out of the value range that 
the float spans and comparing that. That's where the difference originates.


> If you want to compare values approximately as floats, you should explicitly 
> convert them to floats.

As I wrote, "I'm not sure if I should consider this a bug", because it's an 
area that we could just define as "out of bounds behaviour" and "user, you're 
on your own".

The net effect is that some integers will never equal a floating point value, 
even though the floating point value does its very best to represent that 
integer.

I can live with considering the current behaviour "as good as it gets, because 
there is no right way to do it".

Thank you for your comments.

--

___
Python tracker 

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



[issue35663] webbrowser.py firefox bug [python3, windows 10]

2021-05-06 Thread pavan kumar punna


pavan kumar punna  added the comment:

Your code is working fine on windows 10 64-bit and returning True as it opens 
firefox. python-3.9.2. The issue should be closed.

--
nosy: +punnapavankumar9

___
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-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24608
pull_request: https://github.com/python/cpython/pull/25943

___
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-06 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +24609
pull_request: https://github.com/python/cpython/pull/25944

___
Python tracker 

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



[issue44059] Support SerenityOS Browser in webbrowser module

2021-05-06 Thread Linus Groh


New submission from Linus Groh :

SerenityOS [1] maintains its own port of Python (currently 3.9.5) [2], with 
increasingly fewer custom patches. It has its own webbrowser (called "Browser") 
[3][4], which is the only browser installed by default - as a result, 
webbrowser.open() currently does not work out of the box. However, 
register()'ing the browser was straightforward [5]. The goal of this issue is 
to get that patch into upstream Python.


[1] github.com/SerenityOS/serenity
[2] https://github.com/SerenityOS/serenity/blob/master/Ports/python3
[3] 
https://github.com/SerenityOS/serenity/tree/master/Userland/Applications/Browser
[4] 
https://github.com/SerenityOS/serenity/blob/master/Documentation/Browser/ProcessArchitecture.md
[5] 
https://github.com/SerenityOS/serenity/commit/9f970c3459be761c6d1ac192eb494d630b4ca1ed

--
components: Library (Lib)
messages: 393095
nosy: linusg
priority: normal
severity: normal
status: open
title: Support SerenityOS Browser in webbrowser module
type: enhancement

___
Python tracker 

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



[issue44057] Inconsitencies in `__init_subclass__` in a generic class

2021-05-06 Thread Erez Zinman


Erez Zinman  added the comment:

You're right. I accidentally used 3.6.9 both times. Thank you anyway. 

Regardless, that's unfortunate that you don't support the version 3.8 anymore, 
since many frameworks do not officially support 3.9 as of yet (pytorch, for 
example).

--

___
Python tracker 

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



[issue44057] Inconsitencies in `__init_subclass__` in a generic class

2021-05-06 Thread Erez Zinman


Erez Zinman  added the comment:

Also Tensorflow.

--

___
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-06 Thread miss-islington


miss-islington  added the comment:


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


--

___
Python tracker 

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



[issue23937] IDLE: revise window size, placement startup options

2021-05-06 Thread E. Paine


Change by E. Paine :


--
pull_requests: +24610
pull_request: https://github.com/python/cpython/pull/25946

___
Python tracker 

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



[issue44059] Support SerenityOS Browser in webbrowser module

2021-05-06 Thread Linus Groh


Change by Linus Groh :


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

___
Python tracker 

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



[issue44060] Define TARGET macro the same even when computed goto support is not enabled

2021-05-06 Thread Skip Montanaro

New submission from Skip Montanaro :

When the interpreter is compiled with computed goto support, the TARGET macro 
is defined like this:

#define TARGET(op) op: TARGET_##op

If computed gotos are disabled, the implementation is simpler:

#define TARGET(op) op

I'm finding it useful to use those labels as gdb breakpoint targets. Is there 
some reason not to always define the TARGET_##op label?

--
components: Interpreter Core
messages: 393099
nosy: skip.montanaro
priority: normal
severity: normal
status: open
title: Define TARGET macro the same even when computed goto support is not 
enabled
type: enhancement
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



[issue41730] Show deprecation warnings for tkinter.tix

2021-05-06 Thread wyz23x2


wyz23x2  added the comment:

When this issue was submitted on September 5, 2020, Python 3.9 was still in 
beta/rc stages. Now 242 days have passed and the developing of 3.11 has 
started.  :)

--

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2021-05-06 Thread wyz23x2


Change by wyz23x2 :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-05-06 Thread Ulrich Petri


Ulrich Petri  added the comment:

Wether the original behaviour was intentional or not this change introduces 
backwards incompatibility (and in our case, breakage) between 3.8.10 and 
previous releases (I expect the same to be true for the equivalent 3.9 
releases).

--
nosy: +ulope

___
Python tracker 

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



[issue43878] ./configure fails on Apple Silicon with coreutils uname

2021-05-06 Thread Keith Smiley


Keith Smiley  added the comment:

Someone nonchalantly updated these in 
https://github.com/python/cpython/commit/2fc857a5721a5b42bcb696c9cae1bbcc82a91b17
 so this bug is now 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



[issue44060] Define TARGET macro the same even when computed goto support is not enabled

2021-05-06 Thread Skip Montanaro


Change by Skip Montanaro :


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

___
Python tracker 

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



[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-05-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

Can you provide a small snippet of code showing the kind of thing that broke?

--

___
Python tracker 

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



[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Tim Peters


Tim Peters  added the comment:

[Stefan]
> I found it surprising that a comparison uses a different
> method of conversion than the (obvious) user-side
> conversion, with a different outcome. This seems to be
> implementation details leaking into the user side.

It's "spirit of 754", though, so any "principled" implementation would do the 
same. That is, part of the spirit of 754 is to deliver the infinitely price 
result _when_ the infinitely precise result is representable.

So, in particular,

> The net effect is that some integers will never equal
> a floating point value, even though the floating point
> value does its very best to represent that integer.

in fact for "almost no" Python ints `i` do i == float(i), because "almost all" 
unbounded ints `i` lose information when converted to finite-precision float 
(so with infinite precision they're not equal).

--

___
Python tracker 

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



[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2021-05-06 Thread Douwe Hoekstra


Douwe Hoekstra  added the comment:

Hi David! There is a button marked '>>>' in the top right corner of code blocks 
with Interactive code examples. This toggles between the interaction as it 
would appear in a terminal and a mode where only the input is listed without 
the '>>>'.

See for example the second block on 
https://docs.python.org/3/tutorial/introduction.html

--
nosy: +dhoekstra

___
Python tracker 

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



[issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s

2021-05-06 Thread Stephen Rosen

Stephen Rosen  added the comment:

Thanks for working with me to reproduce and understand the issue. I'm a little 
surprised that with the sample which sets the protocol version you're still not 
seeing the issue.

If I create a directory tree, e.g.

repro
├── foo/
└── server.py

where `server.py` is the sample I gave, and run `server.py`, I find that `curl 
localhost:8000/foo` hangs. `curl -v` includes a message as part of its output 
which states that it's waiting for the connection to close.

Full verbose output:
```
$ curl localhost:8000/foo -v
*   Trying 127.0.0.1:8000...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET /foo HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Server: SimpleHTTP/0.6 Python/3.8.5
< Date: Thu, 06 May 2021 15:53:13 GMT
< Location: /foo/
* no chunk, no close, no size. Assume close to signal end
<
^C
```


This holds over a few python versions: 3.6.12, 3.8.5, and 3.9.1 . That's 
probably a good enough sample since the relevant code hasn't changed in the 
stdlib.

It's doubtful that the exact version of curl matters for this. I can also see 
the issue with Firefox opening `localhost:8000/foo`. It hangs without 
processing the redirect.


Running the sample I gave, you're seeing curl exit cleanly? I wonder, with 
verbose output, maybe there's some useful message that will tell us why it's 
exiting. Does it not print the message, "no chunk, no close, no size. Assume 
close to signal end" ?


> Note: the existing behavior is 10+ year old and don't want to introduce 
> changes if it is not a bug.

I completely understand this stance. I believe it is a bug, but that it's rare 
enough that hasn't been filed or resolved, in spite of its age.

Some browsers (e.g. Chrome) process redirects without waiting for a payload, so 
they would mask the issue. Plus, it only shows up when the protocol_version is 
set.

I had a script at work with this issue for over a year without anyone running 
into the hangs. A coworker who prefers Firefox noticed the issue only recently, 
and I traced that back to this behavior.
So even in my case, I didn't stumble across this issue until we'd been using 
the same test script with the bug in it for a long time.

--

___
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-06 Thread Ned Deily


Ned Deily  added the comment:


New changeset f4dac7ec55477a6c5d965e594e74bd6bda786903 by Miss Islington (bot) 
in branch '3.7':
[3.7] bpo-43882 - urllib.parse should sanitize urls containing ASCII newline 
and tabs. (GH-25923)
https://github.com/python/cpython/commit/f4dac7ec55477a6c5d965e594e74bd6bda786903


--
nosy: +ned.deily

___
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-06 Thread Ned Deily


Ned Deily  added the comment:


New changeset 6c472d3a1d334d4eeb4a25eba7bf3b01611bf667 by Miss Islington (bot) 
in branch '3.6':
[3.6] bpo-43882 - urllib.parse should sanitize urls containing ASCII newline 
and tabs (GH-25924)
https://github.com/python/cpython/commit/6c472d3a1d334d4eeb4a25eba7bf3b01611bf667


--

___
Python tracker 

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



[issue43075] ReDoS in urllib.request

2021-05-06 Thread Ned Deily


Ned Deily  added the comment:


New changeset 3fbe96123aeb4fa547a8f6022efa2dc8788f by Miss Islington (bot) 
in branch '3.6':
bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) (GH-25250)
https://github.com/python/cpython/commit/3fbe96123aeb4fa547a8f6022efa2dc8788f


--
nosy: +ned.deily

___
Python tracker 

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



[issue43075] ReDoS in urllib.request

2021-05-06 Thread Ned Deily


Change by Ned Deily :


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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread Ned Deily


Ned Deily  added the comment:


New changeset f68d2d69f1da56c2aea1293ecf93ab69a6010ad7 by Miss Islington (bot) 
in branch '3.6':
bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 
Continue (GH-25916) (GH-25935)
https://github.com/python/cpython/commit/f68d2d69f1da56c2aea1293ecf93ab69a6010ad7


--
nosy: +ned.deily

___
Python tracker 

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



[issue44055] NamedTemporaryFile opened twice on Windows

2021-05-06 Thread Eryk Sun


Eryk Sun  added the comment:

Your example uses delete=False. In Windows, the provision about reopening the 
file while it's open applies to delete=True. With the latter, the file is 
opened with the O_TEMPORARY flag. At the OS level, this flag modifies the 
CreateFileW() call as follows:

 dwDesiredAccess |= DELETE; 
 dwShareMode |= FILE_SHARE_DELETE; 
 dwFlagsAndAttributes |= FILE_FLAG_DELETE_ON_CLOSE;

Because the open has delete access, which it shares, it can be opened again 
only if the open shares delete access. An open that doesn't share delete access 
will fail with a sharing violation. It can be reopened with os.open() with the 
O_TEMPORARY flag, since this shares delete access. But Python's builtin open() 
does not share delete access, and neither do most other programs with which one 
might want to reopen the file. 

This behavior is limiting to the point of making NamedTemporaryFile() 
practically useless in Windows with delete=True. There is an ongoing discussion 
about redesigning NamedTemporaryFile() to never use O_TEMPORARY in Windows.

--
nosy: +eryksun
type:  -> enhancement

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread Ned Deily


Ned Deily  added the comment:


New changeset 078b146f062d212919d0ba25e34e658a8234aa63 by Miss Islington (bot) 
in branch '3.7':
bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 
Continue (GH-25916) (GH-25934)
https://github.com/python/cpython/commit/078b146f062d212919d0ba25e34e658a8234aa63


--

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread Ned Deily


Change by Ned Deily :


--
stage: commit review -> resolved
versions: +Python 3.6, Python 3.7 -Python 3.10, Python 3.11, 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



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

2021-05-06 Thread Ned Deily


Change by Ned Deily :


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



[issue43558] The dataclasses documentation should mention how to call super().__init__

2021-05-06 Thread Douwe Hoekstra


Douwe Hoekstra  added the comment:

I'd like to fix this. Since this would be my first contribution ever, I will 
need some time to figure out procedures and style requirements regarding 
documentation. I estimate this will take me no longer than 3 days.

--
nosy: +dhoekstra

___
Python tracker 

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



[issue43558] The dataclasses documentation should mention how to call super().__init__

2021-05-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

Sure. Take your time! Thank you in advance for your contribution.

--

___
Python tracker 

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



[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Paul


Paul  added the comment:

Eryk:

The whoami process check output shows that my account is in 
BUILTIN\Administrators, which proves that the account I am logged in as local 
Administrator permissions.

As for the OpenKey method, it fails with [WinError 5] Access denied, exactly 
the same way my example also failed, and the reason why these consistently fail 
is because they are pointed to HKLM, essentially replicating the issue that I 
pointed out.  I have also tried different combinations of security flags 
(winreg.KEY_ALL_ACCESS, winreg.KEY_WOW64_64KEY, etc.), but keep getting the 
same results.

--

___
Python tracker 

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



[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread William Pickard


William Pickard  added the comment:

Here's something you should know about Windows, even if a local account is in 
the Administrators group, it still has restrictions on what it can do, it just 
has the power to elevate itself without requiring login credentials (VIA UAC 
prompts).

This group functions very similar to the sudoers group in Linux.

I expect that disabling UAC only causes Windows to automatically approve them 
on Administrator accounts and deny on non-Administrator accounts for 
applications that explicitly require the prompt (Run as Administrator special 
flag).

There exists a hidden deactivated account called Administrator in Windows that 
functions very similar to root in Linux. UAC prompts are to allow an 
application to run under a temporary Windows Logon session as this hidden 
account while using your logon session, aka elevation.

--

___
Python tracker 

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



[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

The most easy way to do is right click on the application you're running the 
code from, click Run as Administrator and then run the code in that 
application. You'll not get any WinError. And also being in the Administrators 
group doesn't mean whatever application you run has the permission. You have 
the permission to do manually not the application right? I'm saying this 
because I'm the admin of my computer still Python raises WinError if I run it 
normally. Being the admin of my computer I still have to run Python in elevated 
mode. Windows considers Python as a third party app and it'll not give admin 
access to it so easily.

--

___
Python tracker 

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



[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Eryk Sun


Eryk Sun  added the comment:

> The whoami process check output shows that my account is in 
> BUILTIN\Administrators, which proves that the account I am 
> logged in as local Administrator permissions.

Please show the output when whoami.exe is spawned from Python. I never 
questioned whether your account is in the administrators group. I need to know 
exactly how the group is flagged and/or enabled in the security context of the 
Python process. For example, a UAC limited logon will include the group with a 
flag that enables it only for access-denied entries in an object's 
discretionary access control list (DACL):

Group Name: BUILTIN\Administrators
Type:   Alias
SID:S-1-5-32-544
Attributes: Group used for deny only

For the group to apply to access-allowed entries in a DACL, it must be enabled 
as follows:

Group Name: BUILTIN\Administrators
Type:   Alias
SID:S-1-5-32-544
Attributes: Mandatory group, Enabled by default, Enabled group, Group owner

--

___
Python tracker 

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



[issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5

2021-05-06 Thread Rikard Nordgren


New submission from Rikard Nordgren :

The pkgutil.iter_modules crash when using Path object in the first argument. 
The code below works in python 3.8.9 and 3.9.4, but stopped working in python 
3.8.10 and 3.9.5. Changing from Path to str works in all versions.


import pkgutil
from pathlib import Path

for _, modname, ispkg in pkgutil.iter_modules([Path("/home")], 
'somepackage.somesubpackage'):
print(modname, ispkg)


Error message from python 3.8.10 (other path was used):

Traceback (most recent call last):
  File "/home/devel/Python-3.8.10/Lib/pkgutil.py", line 415, in get_importer
importer = sys.path_importer_cache[path_item]
KeyError: PosixPath('/home/devel/pharmpy/src/pharmpy/plugins')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pyissue.py", line 5, in 
for _, modname, ispkg in 
pkgutil.iter_modules([Path("/home/devel/pharmpy/src/pharmpy/plugins")], 
'pharmpy.plugins'):
  File "/home/devel/Python-3.8.10/Lib/pkgutil.py", line 129, in iter_modules
for i in importers:
  File "/home/devel/Python-3.8.10/Lib/pkgutil.py", line 419, in get_importer
importer = path_hook(path_item)
  File "", line 1594, in 
path_hook_for_FileFinder
  File "", line 1469, in __init__
  File "", line 177, in _path_isabs
AttributeError: 'PosixPath' object has no attribute 'startswith'

--
components: Library (Lib)
messages: 393120
nosy: rikard.nordgren
priority: normal
severity: normal
status: open
title: Regression in pkgutil: iter_modules stopped taking Path argument in 
python 3.8.10 and 3.9.5
type: crash
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Paul


Paul  added the comment:

@Eryk:

GROUP INFORMATION
-

Group Name: Everyone
Type:   Well-known group
SID:S-1-1-0
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: NT AUTHORITY\Local account and member of Administrators group
Type:   Well-known group
SID:S-1-5-114
Attributes: Group used for deny only

Group Name: MACHINE_NAME\docker-users
Type:   Alias
SID:S-1-5-21-3084499296-1678378808-3679662973-1002
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: MACHINE_NAME\ORA_ASMDBA
Type:   Alias
SID:S-1-5-21-3084499296-1678378808-3679662973-1028
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: MACHINE_NAME\ORA_DBA
Type:   Alias
SID:S-1-5-21-3084499296-1678378808-3679662973-1019
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: MACHINE_NAME\ORA_OraDB18Home1_SYSBACKUP
Type:   Alias
SID:S-1-5-21-3084499296-1678378808-3679662973-1025
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: MACHINE_NAME\ORA_OraDB18Home1_SYSDG
Type:   Alias
SID:S-1-5-21-3084499296-1678378808-3679662973-1026
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: MACHINE_NAME\ORA_OraDB18Home1_SYSKM
Type:   Alias
SID:S-1-5-21-3084499296-1678378808-3679662973-1027
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: BUILTIN\Administrators
Type:   Alias
SID:S-1-5-32-544
Attributes: Group used for deny only

Group Name: BUILTIN\Users
Type:   Alias
SID:S-1-5-32-545
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: NT AUTHORITY\INTERACTIVE
Type:   Well-known group
SID:S-1-5-4
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: CONSOLE LOGON
Type:   Well-known group
SID:S-1-2-1
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: NT AUTHORITY\Authenticated Users
Type:   Well-known group
SID:S-1-5-11
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: NT AUTHORITY\This Organization
Type:   Well-known group
SID:S-1-5-15
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: NT AUTHORITY\Local account
Type:   Well-known group
SID:S-1-5-113
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: LOCAL
Type:   Well-known group
SID:S-1-2-0
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: NT AUTHORITY\NTLM Authentication
Type:   Well-known group
SID:S-1-5-64-10
Attributes: Mandatory group, Enabled by default, Enabled group

Group Name: Mandatory Label\Medium Mandatory Level
Type:   Label
SID:S-1-16-8192
Attributes:

--

___
Python tracker 

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



[issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s

2021-05-06 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Hi Stephen, 

Thanks for the response and the details. I was able to verify the bug!
I don't know exactly what I was doing previously, but I agree with you that 
this is a bug and will be fixed with your patch. :) 

Thanks,
Senthil

--

___
Python tracker 

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



[issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s

2021-05-06 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Eryk Sun


Eryk Sun  added the comment:

Thank you. The output shows that the Python process is using a UAC limited 
security context, i.e. the administrators group is enabled only for 
access-denied rules, and the integrity level is medium (not elevated to high or 
system level). 

Group Name: BUILTIN\Administrators
Type:   Alias
SID:S-1-5-32-544
Attributes: Group used for deny only

Group Name: Mandatory Label\Medium Mandatory Level
Type:   Label
SID:S-1-16-8192
Attributes:

--

___
Python tracker 

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



[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Paul


Paul  added the comment:

"The most easy way to do is right click on the application you're running the 
code from, click Run as Administrator and then run the code in that 
application. You'll not get any WinError. And also being in the Administrators 
group doesn't mean whatever application you run has the permission. You have 
the permission to do manually not the application right? I'm saying this 
because I'm the admin of my computer still Python raises WinError if I run it 
normally. Being the admin of my computer I still have to run Python in elevated 
mode. Windows considers Python as a third party app and it'll not give admin 
access to it so easily."

@Shreyan, Yes, totally understand that.  I am also keenly aware of this, 
because often times for low-level, environment-related solutions in Visual 
Studio, I have had to set Visual Studio IDE to run as administrator in order 
for certain operations to function properly.  In the case of Python, I am 
currently using VSCode.  When I have set code.exe to run as administrator, and 
configure python.exe to run as administrator under Compatibility mode, then 
both VS Code and Python starts acting strange.  From the IDE, I can no longer 
run in debug mode, and any output that is generated is launched in a separate 
console window, which is viewable only briefly.

So... what I also tried was just eliminating VS Code from the equation at the 
moment.  I run a DOS console as Administrator, then just call Python directly 
along with the .py, and the WinError 5 stops getting thrown.  However, the 
other thing I noticed is that when python.exe is set to run as administrator 
under Compatibility Mode, and you reopen solution in VS Code, I noticed that 
the winregistry library stops getting recognized.

--

___
Python tracker 

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



[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Paul


Paul  added the comment:

"Here's something you should know about Windows, even if a local account is in 
the Administrators group, it still has restrictions on what it can do, it just 
has the power to elevate itself without requiring login credentials (VIA UAC 
prompts)."

@William:
Sure, I understand that, which is also why I have UAC prompts disabled.  Also, 
there are additional security settings that most people do not know about 
Administrator accounts:  There are permission settings that go much further 
than Administrator and disabling of UAC, which is also providing your user 
account "system" level permissions, and "Act as part of the operating system".  
This pretty much puts your account in "god mode" where you can do all kinds of 
things that most of us probably shouldn't need to do for most situations, but 
it is there when needed.  In any case, it should not be necessary to get Python 
permissions to execute write / update methods in Python against HKLM hive. I 
definitely don't need to do much to get it to work in C# or C++ just fine.

--

___
Python tracker 

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



[issue44062] cross: wrong interpreter returned when no python available

2021-05-06 Thread Vincent Fazio


New submission from Vincent Fazio :

When trying to cross compile python3.9, `configure` attempts to find a strict 
python 3.9 version match, however if it fails it still attempts to use `python` 
in PYTHON_FOR_BUILD instead of failing outright like the code implies it should

$/python3/targetbuild# which python3.9 python3 python
/usr/bin/python3

$/python3/targetbuild# python3 --version
Python 3.7.3

$/python3/targetbuild# PYTHON_FOR_REGEN=/python3/hostbuild/python \
ac_cv_file__dev_ptmx=yes \
ac_cv_file__dev_ptc=no \
ac_cv_buggy_getaddrinfo=no \
../configure --build=x86-linux-gnu \
--host=aarch64-linux-gnu \
--enable-loadable-sqlite-extensions \
--enable-option-checking=fatal \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--without-ensurepip
checking build system type... x86-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking for python3.9... /python3/hostbuild/python
checking for python interpreter for cross build... python
...

$/python3/targetbuild# grep PYTHON_FOR_BUILD config.log 
PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) 
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f 
pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) 
python'


in configure

if test "$cross_compiling" = yes; then
AC_MSG_CHECKING([for python interpreter for cross build])
if test -z "$PYTHON_FOR_BUILD"; then
for interp in python$PACKAGE_VERSION python3 python; do
which $interp >/dev/null 2>&1 || continue
if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in 
sys.version_info@<:@:2@:>@) == '$PACKAGE_VERSION')"; then
break
fi
interp=
done
if test x$interp = x; then
AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
fi
AC_MSG_RESULT($interp)
PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) 
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f 
pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) 
'$interp
fi
elif test "$cross_compiling" = maybe; then
AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
else
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
fi
AC_SUBST(PYTHON_FOR_BUILD)


The issue is a failing edge case here:

for interp in python$PACKAGE_VERSION python3 python; do
which $interp >/dev/null 2>&1 || continue

where interp keeps it's last value doesn't trigger the empty check here:

if test x$interp = x; then
AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
fi

Note that there's an explicit clearing of interp when the python version isn't 
a match:

if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in 
sys.version_info@<:@:2@:>@) == '$PACKAGE_VERSION')"; then
break
fi
interp=


The fix should be pretty straightforward:

for interp in python$PACKAGE_VERSION python3 python ''; do

adding '' as the last possible interpreter means one hasn't been found up to 
that point and allows configure to properly fail

$/python3/targetbuild# PYTHON_FOR_REGEN=/python3/hostbuild/python 
ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_buggy_getaddrinfo=no 
../configure --build=x86-linux-gnu --host=aarch64-linux-gnu 
--enable-loadable-sqlite-extensions --enable-option-checking=fatal 
--enable-shared --with-system-expat --with-system-ffi --without-ensurepip
checking build system type... x86-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking for python3.9... /python3/hostbuild/python
checking for python interpreter for cross build... configure: error: python3.9 
interpreter not found

It will continue to work when a proper interpreter is found

$/python3/targetbuild# PATH=/python3/hostbuild:$PATH 
PYTHON_FOR_REGEN=/python3/hostbuild/python ac_cv_file__dev_ptmx=yes 
ac_cv_file__dev_ptc=no ac_cv_buggy_getaddrinfo=no ../configure 
--build=x86-linux-gnu --host=aarch64-linux-gnu 
--enable-loadable-sqlite-extensions --enable-option-checking=fatal 
--enable-shared --with-system-expat --with-system-ffi --without-ensurepip
checking build system type... x86-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking for python3.9... /python3/hostbuild/python
checking for python interpreter for cross build... Could not find platform 
dependent libraries 
Consider setting $PYTHONHOME to [:]
python


This should help highlight any inconsistent environment between configuring and 
building.

--
components: Cross-Build
messages: 393125
nosy: Alex.Willmer, vfazio
priority: normal
severity: normal
status: open
title: cross: 

[issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS.

2021-05-06 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Don't run VSCode in admin mode. Just set python to admin mode. See if it works 
then.

--

___
Python tracker 

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



[issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5

2021-05-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

https://bugs.python.org/issue43105 and 
https://github.com/python/cpython/pull/25121 caused this regression.

--
assignee:  -> steve.dower
keywords: +3.8regression, 3.9regression
nosy: +gregory.p.smith, lukasz.langa, steve.dower
priority: normal -> release blocker
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



[issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path

2021-05-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

This caused a regression described in https://bugs.python.org/issue44061

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5

2021-05-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

(obviously we're missing any tests for use of Path objects in this situation)

--
stage:  -> needs patch
type: crash -> behavior

___
Python tracker 

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



[issue44059] Support SerenityOS Browser in webbrowser module

2021-05-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Quite a humorous long list of historical browsers still in the webbrowser 
module.  This can join the list.  The PR should automerge after the CI runs 
complete.

--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith

___
Python tracker 

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



[issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5

2021-05-06 Thread Steve Dower


Steve Dower  added the comment:

Looks like it was always getting lucky in the past, as sys.path requires 
strings, and the "path" argument here is an alternative to it. The cache was 
definitely not working as intended.

So while it's not clearly documented anywhere (other than the related 
pkgutil.extend_path() method saying it'll ignore non-str paths), we do need to 
only be passing str into _importlib_bootstrap.

I can't do the pkgutil updates right now, but I think it's just get_importer 
than needs an os.fsdecode() call around its argument. Maybe some others in the 
same module. And add tests :)

--
keywords: +easy

___
Python tracker 

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



[issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5

2021-05-06 Thread Steve Dower


Steve Dower  added the comment:

To be clear, I'll get to this when I can, but if someone else wants to write 
the fix I'm happy to review and merge. Don't wait for me to do this one just 
because I'm assigned.

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



[issue44059] Support SerenityOS Browser in webbrowser module

2021-05-06 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +24613
pull_request: https://github.com/python/cpython/pull/25950

___
Python tracker 

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



[issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS.

2021-05-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I don't believe CPython should be working around a bug in specific Linux kernel 
versions in the standard library unless they are extremely pernicious and not 
considered to be a bug and thus ever be fixed in the OS kernel.

As the sendfile system call appears to infinitely return one of EAGAIN, 
EALREADY, EWOULDBLOCK, or EINPROGRESS in this case, there isn't anything 
CPython could do.  A retry/backoff loop won't help.

This should be worked around at the application level by whatever means are 
appropriate.

--
nosy: +gregory.p.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5

2021-05-06 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

It's mentioned that Python 3.9.5 has this regression but the code works fine on 
my windows machine. Is this only reproducible on POSIX?

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



[issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5

2021-05-06 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


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



[issue44062] cross: wrong interpreter returned when no python available

2021-05-06 Thread Vincent Fazio


Change by Vincent Fazio :


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

___
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-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

For completeness reference, the 'main' branch after the master->main rename 
also got fixed to check it early the same was as the release branches via:
 
https://github.com/python/cpython/commit/985ac016373403e8ad41f8d563c4355ffa8d49ff

our robot updating bug comments presumably didn't know about the master -> main 
rename yet so didn't leave a comment here.

--

___
Python tracker 

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



[issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s

2021-05-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24616
pull_request: https://github.com/python/cpython/pull/25953

___
Python tracker 

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



[issue15907] move doctest test-data files into a subdirectory of Lib/test

2021-05-06 Thread Sergey Polischouck


Change by Sergey Polischouck :


--
nosy: +polischouckserg

___
Python tracker 

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



[issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s

2021-05-06 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +24615
pull_request: https://github.com/python/cpython/pull/25952

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

If anyone wants a CVE for it, that's up to them.  This bug is in the CPython 
http.client module which is what urllib uses for http/https.  I'd rate it low 
severity.  A malicious server can hold a http connection from this library open 
as a network traffic sink.  There are other ways to do that.  ex: Just use omit 
a content-length header in a server response and start streaming an infinite 
response.

The difference in this case being that since the data is thrown away, it isn't 
going to result in memory exhaustion and kill the unfortunate process as trying 
to read an infinite response would.  That's the primary DoS potential from my 
point of view.

--

___
Python tracker 

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



[issue44063] compiler: does not revert back the end_* locations

2021-05-06 Thread Batuhan Taskaya

New submission from Batuhan Taskaya :

Something that I've stumbled up while working on another patch is that, the 
compiler doesn't revert the end_lineno and the end_col_offset attributes back 
unlike regular lineno/col_offset. An example of this problem;
ar rcs libpython3.10d.a Modules/getbuildinfo.o Parser/token.o  Parser/pegen.o 
Parser/parser.o Parser/string_parser.o Parser/peg_api.(.venv38) (Python 3.8.5+) 
[ 10:33ÖS ]  [ isidentical@desktop:~/cpython/cpython(main✔) ]
 $ cat t3.py 
def foo(a):
pass

foo(
a=1,
a=2
)

 $ ./python t3.py
  File "/home/isidentical/cpython/cpython/t3.py", line 4
foo(
^
SyntaxError: keyword argument repeated: a

with the fix

 $ ./python t3.py
  File "/home/isidentical/cpython/cpython/t3.py", line 6
a=2
^^^
SyntaxError: keyword argument repeated: a

--
messages: 393138
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: compiler: does not revert back the end_* locations

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-06 Thread Ned Deily


Change by Ned Deily :


--
versions: +Python 3.10, 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



  1   2   >