[issue42488] Mathematical error

2020-11-27 Thread Nishant Gautam


New submission from Nishant Gautam :

Python language have some to solve mathematical problem. It gives wrong answer. 
This is the vulnerability, if you think this the vulnerability for your 
language. Remember this is the mathematical error and no computer language 
effort this. Otherwise it depends on you. Thank you

--
files: main.py
messages: 381983
nosy: Kshitish
priority: normal
severity: normal
status: open
title: Mathematical error
versions: Python 3.8
Added file: https://bugs.python.org/file49629/main.py

___
Python tracker 

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



[issue42452] Improve colorsys.rgb_to_hls code

2020-11-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The change was a suggested TODO in the code itself.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
title: FIX Optimize 'rgb_to_hls' -> Improve colorsys.rgb_to_hls code

___
Python tracker 

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



[issue42452] FIX Optimize 'rgb_to_hls'

2020-11-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset f9195318a863e237f41ed7665c767028cde1c9a3 by Julien Jerphanion in 
branch 'master':
bpo-42452: Improve colorsys.rgb_to_hls code (GH-23306)
https://github.com/python/cpython/commit/f9195318a863e237f41ed7665c767028cde1c9a3


--
nosy: +terry.reedy

___
Python tracker 

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



[issue41818] Lib/pty.py major revision

2020-11-27 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

Update: I closed PR 23533. PR 23536 is much better. It will help us detect 
exact behavior on each platform, which is necessary for making pty.spawn() 
successfully exit its copy loop.

--

___
Python tracker 

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



[issue41818] Lib/pty.py major revision

2020-11-27 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
pull_requests: +22418
pull_request: https://github.com/python/cpython/pull/23536

___
Python tracker 

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



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I would attach simple PRs based on the discussion here to this issue.  If a 
particular change needs additional and particular discussion, I would open a 
separate PR, announce it here, and list it in the Dependencies box.  Then this 
generic issue, 'Remove ... in all...' cannot be closed until the separate 
specialized issues are.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue42436] Google use wrong "hightlight" argument

2020-11-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

With the same query, the first 4 responses for me are to the same page but for 
different Python versions.  None of the URLs include the query string.  
`highlight=s` causes all the 's'es in the document to be highlighted, though 
with a different color than if I hit cntl-F, s, [Highlight All].  Yes, ask 
Google :-( -- or better yet, let it go as a random 'phase of the moon' AI 
glitch.  As Google's AI is constantly adjusted and retrained, I would not 
expect there to every be an exact repeat. There is nothing in your query to 
suggest that 's'es should be highlighted.

--
nosy: +terry.reedy
resolution:  -> third party
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue42447] robotsparser deny all with some rules

2020-11-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This issue tracker is for proposing changes to the github CPython repository, 
used to make python.org python releases.  Your post does not propose a change 
and does not demonstrate that there is a bug in current Python, which is 3.9.  
So my current opinion is that this issue should be closed as 'not a bug'.  
Questions about using Python should be directed to a user help forum, such as 
python.org python-list or stackoverflow.com or some equivalent in French.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue42433] mailbox.mbox fails on non ASCII characters

2020-11-27 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

(The non-ascii chars are “ and ”, versus ascii ".)

Florian, although you did not select a 'Type', selecting multiple versions 
implicitly claims that the current behavior is a bug.  I believe R.David has 
explained that it is not, even if sub-optimal.  Do you want to
A. Argue on the basis of some claim in the docs that this really is a bug.
B. Close this issue as 'Not a bug'.
C. Turn it into an enhancement issue for 3.10 by calling decode in the 
appropriate place.  Is so, you might first try making the change in your code 
after finding the appropriate place and see if the improvement is worth the 
change.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue42433] mailbox.mbox fails on non ASCII characters

2020-11-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.7

___
Python tracker 

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



[issue42487] collections.ChainMap.__iter__ calls __getitem__ on underlying maps

2020-11-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I had a discussion with the release manager and we're good to backport to 3.9 
but not 3.8.

Serhiy, would you also take a look at this?

--
assignee:  -> rhettinger
nosy: +lukasz.langa, rhettinger, serhiy.storchaka
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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-11-27 Thread mohamed koubaa


Change by mohamed koubaa :


--
pull_requests: +22417
pull_request: https://github.com/python/cpython/pull/23535

___
Python tracker 

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



[issue42487] collections.ChainMap.__iter__ calls __getitem__ on underlying maps

2020-11-27 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
type: behavior -> performance
versions:  -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



[issue42487] collections.ChainMap.__iter__ calls __getitem__ on underlying maps

2020-11-27 Thread Andreas Poehlmann


Change by Andreas Poehlmann :


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

___
Python tracker 

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



[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2020-11-27 Thread Ernest W. Durbin III

Ernest W. Durbin III  added the comment:

Apologies, wrong issue. I’ll have to take a closer look at this.

--

___
Python tracker 

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



[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2020-11-27 Thread Ernest W. Durbin III


Ernest W. Durbin III  added the comment:

I am away from my computer at the moment, but there is a direct access hostname 
for the buildbot host that was announced to the build server owners. 
Configuring that bypasses the load balancer.

--

___
Python tracker 

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



[issue42487] collections.ChainMap.__iter__ calls __getitem__ on underlying maps

2020-11-27 Thread Andreas Poehlmann


New submission from Andreas Poehlmann :

Hello,

I encountered an issue with collections.ChainMap, that was introduced when 
https://bugs.python.org/issue32792 got fixed.

Iterating a ChainMap will call __getitem__ on its underlying maps:


>>> from collections import UserDict, ChainMap
>>> class MyDict(UserDict):
... def __getitem__(self, k):
... print("expensive computation", k)
... return super().__getitem__(k)
... 
>>> set(ChainMap(MyDict(a=1, b=2, c=3)))
expensive computation a
expensive computation b
expensive computation c
{'c', 'b', 'a'}

--
components: Library (Lib)
messages: 381971
nosy: ap--
priority: normal
severity: normal
status: open
title: collections.ChainMap.__iter__ calls __getitem__ on underlying maps
type: behavior
versions: Python 3.10, 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



[issue29777] argparse arguments in main parser hide an argument in subparser

2020-11-27 Thread Zackery Spytz


Zackery Spytz  added the comment:

Python 2.7 is no longer supported, so I think this issue should be closed.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue17083] can't specify newline string for readline for binary files

2020-11-27 Thread Alex Shpilkin


Change by Alex Shpilkin :


--
nosy: +Alex Shpilkin

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Re-adding older versions.

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



[issue41818] Lib/pty.py major revision

2020-11-27 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

PR-23533 should fix the test_master_read() issue on Solaris. Actually, instead 
of adding 'or PLATFORM == "SunOS"', I ended up removing the whole line and 
replaced it with 'if platform.system() != "Linux"' because I expect that test 
to fail on every platform that is not Linux.

--

___
Python tracker 

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



[issue41818] Lib/pty.py major revision

2020-11-27 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
pull_requests: +22415
pull_request: https://github.com/python/cpython/pull/23533

___
Python tracker 

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



[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2020-11-27 Thread STINNER Victor


STINNER Victor  added the comment:

We need someone of the PSF Infra team to increase the load balancer delay. Or 
fix the load balancer.

--

___
Python tracker 

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



[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2020-11-27 Thread David Bolen


David Bolen  added the comment:

I was wondering if there was any update on whether or not this new behavior can 
be corrected?

I was attempting to review a buildbot failure today and it's actually pretty 
tough to "race the refresh" when trying to review the build steps and logs.

--
nosy: +db3l

___
Python tracker 

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



[issue41818] Lib/pty.py major revision

2020-11-27 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

This is actually good news. I had not tested the code on Solaris; this confirms 
my suspicion that Linux is the only platform that "behaves differently". Sadly, 
the current Lib/pty.py code depends on such "different behavior" to exit from 
pty.spawn()'s copy loop, which is why it hangs on the BSDs, macOS, and now we 
know that it (probably) also hangs on Solaris. Adding 'or PLATFORM == "SunOS"' 
is the correct thing to do. I am working on this now.

--

___
Python tracker 

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



[issue42328] ttk style.map function incorrectly handles the default state for element options.

2020-11-27 Thread David Bolen


David Bolen  added the comment:

This change to the 3.8 branch appears to be consistently failing on the Windows 
7 buildbot (first failing build at 
https://buildbot.python.org/all/#/builders/270/builds/126).

It's all failures in the new test_configure_custom_copy and 
test_map_custom_copy tests, such as:

FAIL: test_configure_custom_copy (tkinter.test.test_ttk.test_style.StyleTest) 
(theme='vista', name='.')
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.8.bolen-windows7\build\lib\tkinter\test\test_ttk\test_style.py",
 line 140, in test_configure_custom_copy
self.assertEqual(style.configure(newname), None)
AssertionError: {'foreground': 'SystemWindowText', 'selec[233 chars]bar'} != 
None

and

==
FAIL: test_map_custom_copy (tkinter.test.test_ttk.test_style.StyleTest) 
(theme='vista', name='.')
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.8.bolen-windows7\build\lib\tkinter\test\test_ttk\test_style.py",
 line 162, in test_map_custom_copy
self.assertEqual(style.map(newname), {})
AssertionError: {'foreground': [('disabled', 'SystemGrayTe[34 chars]1')]} != {}
+ {}
- {'embossed': [('disabled', '1')],
-  'foreground': [('disabled', 'SystemGrayText')]}

Since it seems related to themes, I should mention that the buildbot is running 
with a Windows 7 classic (non-Aero) theme with all appearance effects disabled 
(the "best performance" option).  So I'm not sure if this is an issue with the 
code changes, or behavior due to the host environment not anticipated by the 
tests.

--
nosy: +db3l

___
Python tracker 

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



[issue39732] plistlib should export UIDs in XML like Apple does

2020-11-27 Thread Jon Janzen


Change by Jon Janzen :


--
nosy: +bigfootjon

___
Python tracker 

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



[issue42483] Way working directory is added to sys.path differs between using -c or -m

2020-11-27 Thread Paolo Lammens

Paolo Lammens  added the comment:

Hmm I think that’s unrelated; it’s a discussion about whether to add or not
the working directory at all. Here the issue is that the way it *is* added
differs between -c and -m (which isn’t documented). In both cases it is
added (I’m not discussing that) but with -c it is added as an empty string
while with -m it’s expanded to the full path beforehand, which results in
different behaviour.

On Fri, 27 Nov 2020 at 20:33, STINNER Victor  wrote:

>
> STINNER Victor  added the comment:
>
> See
> https://discuss.python.org/t/python-flag-envvar-not-to-put-current-directory-to-sys-path-but-dont-ignore-pythonpath/4235
> discussion.
>
> --
> nosy: +vstinner
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Irit Katriel


Irit Katriel  added the comment:

I've added the refcount check that Victor suggested.

--

___
Python tracker 

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



[issue42486] Investigate docs.python.org egregious SEO performance on Google

2020-11-27 Thread Nelson Elhage


Nelson Elhage  added the comment:

Thanks! Filed https://github.com/python/pythondotorg/issues/1691 to follow-up 
there.

--

___
Python tracker 

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



[issue42483] Way working directory is added to sys.path differs between using -c or -m

2020-11-27 Thread STINNER Victor


STINNER Victor  added the comment:

See 
https://discuss.python.org/t/python-flag-envvar-not-to-put-current-directory-to-sys-path-but-dont-ignore-pythonpath/4235
 discussion.

--
nosy: +vstinner

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread STINNER Victor


STINNER Victor  added the comment:

I consider PR 23531 change as a bugfix and IMO it's fine to backport it.

TracebackException docstring is quite explicit:

The traceback module captures enough attributes from the original exception
to this intermediary form to ensure that no references are held, while
still being able to fully print or format it.

This issue shows that there was a bug in the implementation.

--

The unit test should check the ref count of the exception and the exception 
traceback, to check functionally that no strong reference is hold.

--

___
Python tracker 

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



[issue42486] Investigate docs.python.org egregious SEO performance on Google

2020-11-27 Thread STINNER Victor


STINNER Victor  added the comment:

> This request might be out-of-scope for this bugtracker

Please report python.org issues to https://github.com/python/pythondotorg/

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



[issue42486] Investigate docs.python.org egregious SEO performance on Google

2020-11-27 Thread Alex Gaynor


Change by Alex Gaynor :


--
nosy: +alex

___
Python tracker 

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



[issue42486] Investigate docs.python.org egregious SEO performance on Google

2020-11-27 Thread Nelson Elhage


New submission from Nelson Elhage :

This request might be out-of-scope for this bugtracker, but I
suspect that something is causing Google to actively downweight
docs.python.org in its search results, and want to request
someone investigate.

I would expect, for instance, a search for [python set] to turn
up https://docs.python.org/3/library/stdtypes.html#set
_somewhere_ on the first page of results, but it does not. In
fact, the only python.org result I see is for the long-deprecated
Python 2 `sets` module --
https://docs.python.org/2/library/sets.html

Similarly, [python shuffle list] does not turn up
https://docs.python.org/3/library/random.html -- or any other
python.org site -- _anywhere_ in the first page of results.

These results are egregious enough to make me suspect you're
being actively downranked for some reason, which is hopefully
identifiable and fixable by a site admin using Google's search
tools at https://developers.google.com/search

--
assignee: docs@python
components: Documentation
messages: 381957
nosy: docs@python, nelhage
priority: normal
severity: normal
status: open
title: Investigate docs.python.org egregious SEO performance on Google
type: enhancement

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

For background, see 
https://github.com/iritkatriel/cpython/pull/3#issuecomment-734640036 -- it 
seems the link to exc_traceback was added with little concern for the original 
design of TracebackExceptionGroup.

The question is, can we get rid of it, even though it's been undocumented.

--

___
Python tracker 

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



[issue42474] improve test coverage for TracebackException's __eq__

2020-11-27 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 44ca05afc89c9967f5dbc6c3ad89fc298c460e93 by Irit Katriel in 
branch 'master':
bpo-42474: test TracebackException comparison to non-equal instances (GH-23522)
https://github.com/python/cpython/commit/44ca05afc89c9967f5dbc6c3ad89fc298c460e93


--
nosy: +gvanrossum

___
Python tracker 

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



[issue42485] Full grammar specification should link to PEP 617

2020-11-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +gvanrossum, lys.nikolaou, pablogsal

___
Python tracker 

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



[issue42485] Full grammar specification should link to PEP 617

2020-11-27 Thread James Gerity


Change by James Gerity :


--
keywords: +patch
nosy: +SnoopJeDi2
nosy_count: 2.0 -> 3.0
pull_requests: +22414
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23532

___
Python tracker 

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



[issue42485] Full grammar specification should link to PEP 617

2020-11-27 Thread James Gerity


New submission from James Gerity :

Now that CPython uses the new PEG parser, it would be helpful to include a 
reference to the guiding PEP (617) on the docs page 
(https://docs.python.org/3/reference/grammar.html) that gives the grammar.

--
assignee: docs@python
components: Documentation
messages: 381954
nosy: docs@python, snoopjedi
priority: normal
severity: normal
status: open
title: Full grammar specification should link to PEP 617
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



[issue42481] Add to pathlib function to check permission similar to os.access

2020-11-27 Thread Christian Heimes


Christian Heimes  added the comment:

> That's interesting. In Linux, for example, I would expect the access()
> and faccessat() system calls to also check mandatory permissions. I 
> know from experience that at least the [i]mmutable file attribute is 
> checked.

access(2) takes extended file attributes like immutable bit and CAPS into 
account. For example it returns True for access("testfile", R_OK) for testfile 
with DAC permission 0o000 and process context with CAP_DAC_OVERRIDE. I would 
also bet that it handles POSIX ACLs correcty.

But LSM and seccomp are not evaluated by access() -- at least SELinux is not. A 
seccomp syscall filter can have a BPF program attached to. It's a powerful 
feature that allows filtering and blocking by syscall argument.

$ python3
>>> os.access("testfile", os.R_OK)
True
>>> open("testfile")
Traceback (most recent call last):
...
PermissionError: [Errno 13] Permission denied: 'testfile'

# ausearch -m AVC
...
time->Fri Nov 27 16:14:31 2020
type=AVC msg=audit(1606490071.292:4204): avc:  denied  { read } for  pid=293015 
comm="httpd" name="testfile" dev="dm-0" ino=399163 
scontext=system_u:system_r:httpd_t:s0 
tcontext=unconfined_u:object_r:testcontext_t:s0 tclass=file permissive=0

--

___
Python tracker 

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



[issue38768] [feature request] Add lldb equivalent to Tools/gdb

2020-11-27 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
title: Support lldb enhancement in MacOS -> [feature request] Add lldb 
equivalent to Tools/gdb
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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue41015] warning: 'sqlite3_enable_shared_cache' is deprecated

2020-11-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

This is a duplicate of #24464

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> "sqlite3_enable_shared_cache" deprecation warning when 
compiling with macOS system SQLite3

___
Python tracker 

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



[issue30053] Problems building with --enable-profiling on macOS using homebrew GCC

2020-11-27 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
title: Problems building with --enable-profiling on macOS -> Problems building 
with --enable-profiling on macOS using homebrew GCC

___
Python tracker 

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



[issue24893] Tk occasionally mispositions Text() insert cursor on mouse click.

2020-11-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Is this still reproducible? 

A question to those that can reproduce this: does this happen with the built-in 
screen (assuming a laptop or iMac) or an external interface? If the latter, is 
that a retina display? And does this happen more when moving IDLE from a retina 
display to a non-retina display?

--

___
Python tracker 

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



[issue39961] warning: this use of "defined" may not be portable (Mac OS)

2020-11-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

This is incompatibility between upstream clang and Apple's headers. The same 
warning is not present when using Xcode's compiler.

As a workaround this warning can be disabled when including pthread.h, 
something like:

```
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wexpansion-to-defined"
#endif

#include 

#ifdef __clang__
#pragma clang diagnostic pop
#endif
```

I won't create a PR for this because I don't have homebrew on my systems.

Alternatively build with "-Wno-expansion-to-defined" in CFLAGS.

--

___
Python tracker 

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



[issue31713] python3 python-config script generates invalid includes

2020-11-27 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> "python-config --includes" returns a wrong path (double prefix)

___
Python tracker 

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



[issue42463] test_pty.test_openpty() failed on x86 Gentoo Installed with X 3.x: unexpected success

2020-11-27 Thread STINNER Victor


STINNER Victor  added the comment:

https://buildbot.python.org/all/#/builders/464 is back to green.

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



[issue42481] Add to pathlib function to check permission similar to os.access

2020-11-27 Thread Eryk Sun


Eryk Sun  added the comment:

> os.access() is not a good and sufficient permission check. It 
> only checks DAC (discrete access control) permissions 

That's interesting. In Linux, for example, I would expect the access() and 
faccessat() system calls to also check mandatory permissions. I know from 
experience that at least the [i]mmutable file attribute is checked.

That said, the Linux faccessat() system call doesn't support the flags 
parameter. So, according to the man page, AT_EACCESS (effective_ids=True) and 
AT_SYMLINK_NOFOLLOW (follow_symlinks=False) are implemented in the glibc 
wrapper by calling fstatat() instead. I presume that's limited to the 
discretionary st_mode permissions.

For Windows, note that the current implementation of os.access() doesn't check 
the process/thread security context against mandatory and discretionary file 
security. Manually checking access is usually a discouraged practice, so there 
hasn't been any pressure to provide a real implementation.

Regarding the example in msg381940, this seems confused. The title mentions 
os.access(), i.e. a result that checks F_OK or some combination of R_OK, W_OK, 
and X_OK. In theory, this can be supported in Windows. But the example shows 
POSIX owner-group-other permissions, which are not supported in Windows. 

As currently 'supported' by os.chmod() and st_mode in the os.stat() result, 
POSIX permissions in Windows are a fantasy that's based on a category error 
(that readonly is a granted permission, when it's actually a file attribute, 
similar to the POSIX immutable attribute) and assumptions (e.g. all files are 
readable, all directories are executable, all files with .com, .exe, .bat, and 
.cmd extensions are executable, and only these files are executable).

--
nosy: +eryksun

___
Python tracker 

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



[issue42484] parse_message_id, get_msg_id, get_obs_local_part is poorly written

2020-11-27 Thread Dickson Chan


New submission from Dickson Chan :

parse_message_id in the email module crashes with bogus message-id

Having a Message-ID '<[>' gives me an IndexError: list index out of range

This happens when 
- creating an EmailMessage with the said Message-ID
msg = EmailMessage()
msg['Message-ID'] = '<[>'

- accessing the bogus Message-ID through
msg.items()
or
msg.get('Message-ID')

this doesn't happen with python 3.6 or 3.7 when MessageIDHeader didn't exist

3.8/Lib/email/headerregistry.py line 542

_default_header_map = {

'message-id': MessageIDHeader,
}

---
Traceback (most recent call last):
  File "/usr/lib/python3.8/email/_header_value_parser.py", line 2069, in 
get_msg_id
token, value = get_dot_atom_text(value)
  File "/usr/lib/python3.8/email/_header_value_parser.py", line 1334, in 
get_dot_atom_text
raise errors.HeaderParseError("expected atom at a start of "
email.errors.HeaderParseError: expected atom at a start of dot-atom-text but 
found '[>'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 4, in 
msg['Message-ID'] = '<[>'
  File "/usr/lib/python3.8/email/message.py", line 409, in __setitem__
self._headers.append(self.policy.header_store_parse(name, val))
  File "/usr/lib/python3.8/email/policy.py", line 148, in header_store_parse
return (name, self.header_factory(name, value))
  File "/usr/lib/python3.8/email/headerregistry.py", line 607, in __call__
return self[name](name, value)
  File "/usr/lib/python3.8/email/headerregistry.py", line 202, in __new__
cls.parse(value, kwds)
  File "/usr/lib/python3.8/email/headerregistry.py", line 535, in parse
kwds['parse_tree'] = parse_tree = cls.value_parser(value)
  File "/usr/lib/python3.8/email/_header_value_parser.py", line 2126, in 
parse_message_id
token, value = get_msg_id(value)
  File "/usr/lib/python3.8/email/_header_value_parser.py", line 2073, in 
get_msg_id
token, value = get_obs_local_part(value)
  File "/usr/lib/python3.8/email/_header_value_parser.py", line 1516, in 
get_obs_local_part
if (obs_local_part[0].token_type == 'dot' or
IndexError: list index out of range
---

as you can see in the traceback
get_msg_id() calls get_obs_local_part()
and in get_obs_local_part(), you have this

def get_obs_local_part(value):

obs_local_part = ObsLocalPart()

while value and (value[0]=='\\' or value[0] not in PHRASE_ENDS):
...
if (obs_local_part[0].token_type == 'dot':
...

if value does not satisfy the condition in the while loop, 
this gives an IndexError as obs_local_part is empty
(the value in my example is '[>' from the message id '<[>')

shouldn't we have a proper Error or default back to no parsing if parsing fails?
There's no way of bypassing the parser and getting the Message-ID and 
I can't even handle the error with a try catch

--
components: email
messages: 381947
nosy: barry, dxn126, r.david.murray
priority: normal
severity: normal
status: open
title: parse_message_id, get_msg_id, get_obs_local_part is poorly written
type: behavior
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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Irit Katriel


Irit Katriel  added the comment:

>From the TracebackException docstring:

"The traceback module captures enough attributes from the original exception to 
this intermediary form to ensure that no references are held, while still being 
able to fully print or format it."

> If the tracebacks are different, they're not exactly equivalent.

The formatted form is identical, so from TracebackException's POV they are 
equivalent. 

> If we did accept this patch, would that mean there would no longer be any 
> need to delete the exception variable at the end of an `except` block?

No, it's not related to that.

--

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This would be a change of behaviour, and 3.8 and 3.9 are in feature freeze, so 
we could only add it in 3.10.

You say:

"it's supposed to capture the output without holding references to real things"

Is this requirement documented somewhere, or is it just your preference?

"it makes comparison wrong for equivalent exceptions"

If the tracebacks are different, they're not exactly equivalent.

If we did accept this patch, would that mean there would no longer be any need 
to delete the exception variable at the end of an `except` block?

--
nosy: +steven.daprano
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



[issue30388] ndbm can't iterate through values on OS X

2020-11-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I've attached a C program that demonstrates the problem, and have filed an 
issue with Apple about this: FB8919203

It is not clear to me what we can do about this, other than not building the 
ndbm binding on macOS.  The manpages for the ndbm APIs do not mention 
limitations on item sizes, and the dbopen manpage mention that there a no 
limitations on item sizes).

--
Added file: https://bugs.python.org/file49627/ndbm-repro.c

___
Python tracker 

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



[issue25479] Increase unit test coverage for abc.py

2020-11-27 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy -easy (C), patch

___
Python tracker 

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



[issue42481] Add to pathlib function to check permission similar to os.access

2020-11-27 Thread Christian Heimes


Christian Heimes  added the comment:

A word of warning: os.access() is not a good and sufficient permission check. 
It only checks DAC (discrete access control) permissions and suffers from 
TOCTOU issues. Operating systems have additional permission checks and security 
policies, for example  mandatory access control (AppArmor, SELinux, Smack) and 
seccomp.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue42483] Way working directory is added to sys.path differs between using -c or -m

2020-11-27 Thread Paolo Lammens

New submission from Paolo Lammens :

Tested on:
 - Python 3.8.6 for Windows 10 64 bit
 - Python 3.9.0 for Windows 10 64 bit
 - Python 3.8.6 for Ubuntu 20.04
 - Python 3.9.0 for Ubuntu 20.04

Originally asked here: https://stackoverflow.com/q/65024647/6117426

-

If you launch a Python process either as a single command from the command line 
(with the `-c` flag) or by specifying a module path (with the `-m` flag), the 
working directory is prepended to `sys.path`. From the 
[docs](https://docs.python.org/3/using/cmdline.html#cmdoption-c) (emphases 
mine):

> - **-c \**
> 
>[...]
> 
>If this option is given, the first element of `sys.argv` will be 
>`"-c"` and **the current directory will be added to the start of 
>`sys.path`** (allowing modules in that directory to be imported as top 
> level 
>modules).
>
>   [...]
> 
> - **-m \**
> 
>[...]
> 
>If this option is given, the first element of `sys.argv` will be
>thefull path to the module file (while the module file is being
>located, the first element will be set to `"-m"`). As with the
>`-c` option, **the current directory will be added to the start of
>`sys.path`**.
>
>[...]


But it seems the way this is done is different for each option:

```none
$ python -c "import sys; print sys.path"
['', '/usr/lib/python38.zip', '/usr/lib/python3.8', 
'/usr/lib/python3.8/lib-dynload', 
'/home/plammens/.local/lib/python3.8/site-packages', 
'/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']

$ python -m script  # script.py does the same as the command above
['/mnt/c/Users/Paolo/Desktop/Code Sandbox/Python/clean', 
'/usr/lib/python38.zip', '/usr/lib/python3.8', 
'/usr/lib/python3.8/lib-dynload', 
'/home/plammens/.local/lib/python3.8/site-packages', 
'/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']
```

Notice how the first option uses an empty string to denote the current working 
directory while the second explicitly adds the path to the directory I ran the 
command in.

The empty string is always interpreted dynamically to denote the current 
working directory during execution, as per the [docs on the import 
system](https://docs.python.org/3/reference/import.html):

> The current working directory – denoted by an empty string – is
> handled slightly differently from other entries on `sys.path`. First, if
> the current working directory is found to not exist, no value is
> stored in `sys.path_importer_cache`. Second, **the value for the current
> working directory is looked up fresh for each module lookup**. Third,
> the path used for `sys.path_importer_cache` and returned by
> `importlib.machinery.PathFinder.find_spec()` will be the actual current
> working directory and not the empty string.

So this means that the `-c` version will always use the current working 
directory of the Python process, not the directory that it was originally 
launched in.


Indeed, we can make an example to show this. Consider the following file tree,

```none
.
├── script.py
└── secret-folder
└── findme.py
```

with `findme.py` just containing the one statement `print("you found me!")`. If 
we run the following

```python
import os
os.chdir('secret-folder')
import findme
```

both as a command (`-c`) and as a script (in `script.py`), we get:

```none
$ python -c "import os; os.chdir('secret-folder'); import findme"
you found me!

$ python -m script
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
  File "/.../script.py", line 5, in 
import findme
ModuleNotFoundError: No module named 'findme'
```

This is because `-m` is using the "hardcoded" working directory while `-c` is 
using the "dynamically interpreted" current directory.

By how it's phrased in the documentation for `-c` and `-m` though, one would 
think these two should behave identically.

Is this intended? If so, it isn't documented.

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 381942
nosy: docs@python, plammens
priority: normal
severity: normal
status: open
title: Way working directory is added to sys.path differs between using -c or -m
type: behavior
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



[issue25538] Traceback from __exit__ method is misleading

2020-11-27 Thread Alexander Kurakin


Change by Alexander Kurakin :


--
nosy: +kuraga

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2020-11-27 Thread Peixing Xin


Change by Peixing Xin :


--
pull_requests: +22412
pull_request: https://github.com/python/cpython/pull/23530

___
Python tracker 

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



[issue41818] Lib/pty.py major revision

2020-11-27 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset f5a19ead4ba8c81cc27d5a530f830f4709ce240e by Soumendra Ganguly in 
branch 'master':
bpo-41818: Make test_openpty() avoid unexpected success due to number of rows 
and/or number of columns being == 0. (GH-23526)
https://github.com/python/cpython/commit/f5a19ead4ba8c81cc27d5a530f830f4709ce240e


--

___
Python tracker 

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



[issue42481] Add to pathlib function to check permission similar to os.access

2020-11-27 Thread Piotr Kopalko


New submission from Piotr Kopalko :

Path('example.toml').permissions() == Permissions(owner=(READ, WRITE, EXECUTE), 
group=(READ), other=(,))

--

___
Python tracker 

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



[issue24695] Don't print traceback header if traceback is None in TracebackException

2020-11-27 Thread Irit Katriel


Irit Katriel  added the comment:

The patch here added a reference from TracebackException to the actual 
traceback, which I think should be removed. Please see this issue: 
https://bugs.python.org/issue42482

--
nosy: +iritkatriel

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Irit Katriel


New submission from Irit Katriel :

TracebackException holds a reference to the exc_traceback, which is wrong 
because (1) it's supposed to capture the output without holding references to 
real things. (2) it makes comparison wrong for equivalent exceptions, as in 
this example:

--
import sys
import traceback

excs = []
for _ in range(2):
try:
1/0
except:
excs.append(traceback.TracebackException(*sys.exc_info()))

print('formats equal: ', list(excs[0].format()) == list(excs[0].format()))
print('excs equal: ', excs[0] == excs[1])
excs[0].exc_traceback = excs[1].exc_traceback = None
print('excs equal w/o exc_traceback: ', excs[0] == excs[1])

--
Output:

formats equal:  True
excs equal:  False
excs equal w/o exc_traceback:  True

--


The good news is that it's only used to check for non-None (added here 
https://bugs.python.org/issue24695) so should be easy to remove.

--
components: Library (Lib)
messages: 381938
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: TracebackException should not hold reference to the exception traceback
type: behavior
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



[issue42481] Add to pathlib function to check permission similar to os.access

2020-11-27 Thread Maciej Olko


Change by Maciej Olko :


--
nosy: +Maciej Olko

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-11-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Note that a python installation created using 
Mac/BuildScript/build-instalelr.py works fine on macOS 11.0 (I haven't tested 
on 11.1 beta yet). This may be a problem with homebrew or the way it builds 
Python and/or Tcl/Tk.

--

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-11-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

On macOS 11 the system version is reported as 11.x if the binary was build 
using Xcode 12, and as 10.16.x for older binaries.

--

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-11-27 Thread Ned Deily


Change by Ned Deily :


--
components: +macOS -Tkinter
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue42481] Add to pathlib function to check permission similar to os.access

2020-11-27 Thread Piotr Kopalko


Change by Piotr Kopalko :


--
nosy: copalco
priority: normal
severity: normal
status: open
title: Add to pathlib function to check permission similar to os.access
type: enhancement

___
Python tracker 

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



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-27 Thread Wyko ter Haar


Wyko ter Haar  added the comment:

Starting at .1, not .0.

Sincerely,

Wyko ter Haar

On Fri, Nov 27, 2020, 10:14 AM Wyko ter Haar 
wrote:

> >>> X = ip_network("10.0.0.0/24")
> >>> H= X.hosts(as_interfaces= True)
> >>> next(H)
> IPv4Interface('10.0.0.0/24')
> >>> next(H)
> IPv4Interface('10.0.0.1/24')
>
> Something like that. Sure, I could cast the output of hosts as an
> interface, but then it would be missing the netmask.
>
> Sincerely,
>
> Wyko ter Haar
>
> On Fri, Nov 27, 2020, 10:04 AM Wyko ter Haar 
> wrote:
>
>>
>> Wyko ter Haar  added the comment:
>>
>> Literally just the same thing as .hosts(), except outputting interface
>> objects instead of addresses. Maybe it could be a flag in .hosts()
>> instead,
>> something like "cast_as_interface".
>>
>> Sincerely,
>>
>> Wyko ter Haar
>>
>> On Fri, Nov 27, 2020, 3:18 AM Eric V. Smith 
>> wrote:
>>
>> >
>> > Eric V. Smith  added the comment:
>> >
>> > I'm not sure what you mean by iterating over the interfaces in a subnet.
>> > Could you give an example?
>> >
>> > --
>> > nosy: +eric.smith
>> >
>> > ___
>> > Python tracker 
>> > 
>> > ___
>> >
>>
>> --
>>
>> ___
>> Python tracker 
>> 
>> ___
>>
>

--

___
Python tracker 

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



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-27 Thread Wyko ter Haar


Wyko ter Haar  added the comment:

>>> X = ip_network("10.0.0.0/24")
>>> H= X.hosts(as_interfaces= True)
>>> next(H)
IPv4Interface('10.0.0.0/24')
>>> next(H)
IPv4Interface('10.0.0.1/24')

Something like that. Sure, I could cast the output of hosts as an
interface, but then it would be missing the netmask.

Sincerely,

Wyko ter Haar

On Fri, Nov 27, 2020, 10:04 AM Wyko ter Haar  wrote:

>
> Wyko ter Haar  added the comment:
>
> Literally just the same thing as .hosts(), except outputting interface
> objects instead of addresses. Maybe it could be a flag in .hosts() instead,
> something like "cast_as_interface".
>
> Sincerely,
>
> Wyko ter Haar
>
> On Fri, Nov 27, 2020, 3:18 AM Eric V. Smith 
> wrote:
>
> >
> > Eric V. Smith  added the comment:
> >
> > I'm not sure what you mean by iterating over the interfaces in a subnet.
> > Could you give an example?
> >
> > --
> > nosy: +eric.smith
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-11-27 Thread Christopher Snowhill


New submission from Christopher Snowhill :

The Tkinter module, in a freshly built copy of Python 3.9 built by Brew, using 
the latest Xcode 12.3 command line tools, crashes on Big Sur 11.1 beta. It 
emits the following error:

macOS 11 or later required !

I believe I recently read on macOS developer documentation, there is a special 
behavior in the system version reporting now, possibly only taking effect in 
11.1 and newer. Basically, if you query the major version first, you'll get 11 
or higher. If you query the minor version first, it will switch on 
compatibility mode and start reporting either 10.15 or 10.16, I'm not terribly 
sure which, but it does lie and say it's running version 10.

--
components: Tkinter
messages: 381933
nosy: kode54
priority: normal
severity: normal
status: open
title: Python Tkinter crashes on macOS 11.1 beta
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



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-27 Thread Wyko ter Haar


Wyko ter Haar  added the comment:

Literally just the same thing as .hosts(), except outputting interface
objects instead of addresses. Maybe it could be a flag in .hosts() instead,
something like "cast_as_interface".

Sincerely,

Wyko ter Haar

On Fri, Nov 27, 2020, 3:18 AM Eric V. Smith  wrote:

>
> Eric V. Smith  added the comment:
>
> I'm not sure what you mean by iterating over the interfaces in a subnet.
> Could you give an example?
>
> --
> nosy: +eric.smith
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-11-27 Thread Xavier Morel


Xavier Morel  added the comment:

> Do you want to submit a PR for this?

Sure. Do you think the code I proposed would be suitable?

> * The current logic matches the logic before the warning was added.
> * The proposed logic matches what the code will do after the
>   deprecation period (it will only check for non-sequences).

Yes, that was my basis for it as it seemed sensible, but you're right that it's 
a bit of a behavioural change as you note:

> * There is some value in the warning in that it lets you know an
>   inefficient code path is being used (i.e. the conversion to a tuple).
> * The proposed logic doesn't just change the warning, it changes
>   what actually happens to the data.  IMO the change is for the
>   better, but it is a behavior change and could potentially cause
>   a failure in someone's code.

Aye, and also I guess the "sequence" implementation of the input collection 
might be less efficient than one-shot converting to a set and sampling from the 
set.

> * The case of an object that is both a sequence and a set is
>   likely very rare.

Chances are you're right, but it's what got me to stumble upon it ($dayjob 
makes significant use of a "unique list / ordered set" smart-ish collection, 
that collection was actually registered against Set and Sequence specifically 
because Python 3's random.sample typechecks those, we registered against both 
as the collection technically implements both interfaces so that seemed like a 
good idea at the time).

--

___
Python tracker 

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



[issue41818] Lib/pty.py major revision

2020-11-27 Thread Jakub Kulik


Jakub Kulik  added the comment:

This change also broke Solaris (SunOS), where (similarly to BSDs and Darwin) 
OSError is not raised in the `new test_master_read()` test.

Adding `or PLATFORM == "SunOS"` into the `expectedFailureOnBSD` function fixes 
this issue, but it's no longer just BSDs and it's derivates.

--
nosy: +kulikjak

___
Python tracker 

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



[issue42479] Canvas's create_image method not work in some situaction.

2020-11-27 Thread IceWorm


Change by IceWorm :


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



[issue42479] Canvas's create_image method not work in some situaction.

2020-11-27 Thread IceWorm


New submission from IceWorm :

create a window using Tk()
create canvas
create image using create_image
enter main loop 
   IT OK ABOVE
-
   BUT BELOW WILL not show image. just extract code to a method.
def setupUI(winddow):
create canvas
create image using create_image

create a window using Tk()
call setupUI(window)
enter main loop

--
components: Tkinter
files: test.py
messages: 381929
nosy: MangoIceCup
priority: normal
severity: normal
status: open
title: Canvas's create_image method not work in some situaction.
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49626/test.py

___
Python tracker 

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