[issue44721] Problem in tkinter button widget

2021-07-22 Thread Seyed Amirhossein Misaghi


New submission from Seyed Amirhossein Misaghi :

Hello
The piece of code has false behavior. When click the button, the relief changes 
to tk.SUNKEN. I think this is a wrong behavior.
Thanks

--
components: Tkinter
files: test.tar.gz
messages: 398031
nosy: a.h.misaghi
priority: normal
severity: normal
status: open
title: Problem in tkinter button widget
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50172/test.tar.gz

___
Python tracker 

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



[issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9

2021-07-22 Thread Jack DeVries


Jack DeVries  added the comment:

I just took a look at this, and I'm getting an output of "no data" (just one 
time) on 3.9.6. Has this been fixed?

--
nosy: +jack__d

___
Python tracker 

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



[issue44720] Finding string in iteratively deleted object cause segfault

2021-07-22 Thread Xinmeng Xia


New submission from Xinmeng Xia :

This piece of code is originally from 
https://github.com/python/cpython/tree/main/Lib/test/test_weakref.py. In 
function test_proxy_iter(), we change the original data dependency and then 
this generated test case (see the following "test.py") crashes Python. 

Crashing Python version: 3.6-master(3.11.0a0)

test.py
=
import weakref


def test_proxy_iter():
obj = None

class MyObj:

def __iter__(a):
nonlocal obj
del obj
-   return NotImplemented
+   return p
obj = MyObj()
-   p = weakref.proxy(obj)
+   p = weakref.proxy(TypeError)

-   'blech' in p
+   'blech' in obj

test_proxy_iter()
===


system: ubuntu 16.04
crash: segmentation fault

--
components: Interpreter Core
files: test.py
messages: 398029
nosy: xxm
priority: normal
severity: normal
status: open
title: Finding string in iteratively deleted object cause segfault
type: crash
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9
Added file: https://bugs.python.org/file50171/test.py

___
Python tracker 

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



[issue44719] Incorrect callable object crashes Python 3.11.0a0

2021-07-22 Thread Xinmeng Xia


New submission from Xinmeng Xia :

This program can trigger "Aborted (core dumped)" on Python 3.9.0, Python 3.8.0, 
Python3.10.0a2.  It trigger " segmentation fault" on the master (Python 
3.11.0a0).

==
import weakref

class Object:
def __init__(self, arg):
self.arg = arg

def test_set_callback_attribute():
x = Object(1)
callback = lambda ref: None
callback = weakref.ref(callback, x)
with test_set_callback_attribute():
pass

test_set_callback_attribute()
==

Crashes on the master (Python 3.11.0a0)

.
Traceback (most recent call last):
  File 
"/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py",
 line 26, in test_set_callback_attribute
callback = weakref.ref(callback, x)

TypeError: 'Object' object is not callable
Exception ignored in: <__main__.Object object at 0x7f3e2d56ca90>
Traceback (most recent call last):
  File 
"/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py",
 line 26, in test_set_callback_attribute
Segmentation fault (core dumped)
--


Crashes on the older version of Python
---
File 
"/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py",
 line 27 in test_set_callback_attribute
File 
"/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py",
 line 27 in test_set_callback_attribute
File 
"/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py",
 line 27 in test_set_callback_attribute
File 
"/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py",
 line 27 in test_set_callback_attribute
File 
"/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py",
 line 27 in test_set_callback_attribute
File 
"/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py",
 line 27 in test_set_callback_attribute
File 
"/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py",
 line 27 in test_set_callback_attribute
...
Aborted (core dumped)
---

System: Ubuntu 16.04

--
components: Interpreter Core
messages: 398028
nosy: xxm
priority: normal
severity: normal
status: open
title: Incorrect callable object crashes Python 3.11.0a0
type: crash
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



[issue44718] Incorrect arguments in function select() cause segfault

2021-07-22 Thread Xinmeng Xia


New submission from Xinmeng Xia :

The following program can trigger segfault on all releases of Python. I think 
it may be caused  by incorrect arguments.

Version of Python: 3.6 - master(3.11.0a0)
system: ubuntu 16.04

test.py

import select

def test_select_mutated():
a = []

class F:
def fileno(a):
del test_select_mutated()[-1]
return sys.__stdout__.fileno()
a[:] = [F()] * 10
select.select([], a, []), ([], a[:5], [])

test_select_mutated()


output:
-
xxm@xxm:~$ '/home/xxm/Desktop/compiler/cpython-main/python'  test.py 
Segmentation fault (core dumped)
-

--
components: Interpreter Core
messages: 398027
nosy: xxm
priority: normal
severity: normal
status: open
title: Incorrect arguments in function select()  cause segfault
type: crash
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL'

2021-07-22 Thread Fantix King


Change by Fantix King :


--
nosy: +fantix
nosy_count: 3.0 -> 4.0
pull_requests: +25844
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/8620

___
Python tracker 

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



[issue39632] variadic function call broken on armhf when passing a float argument

2021-07-22 Thread Filipe Laíns

Filipe Laíns  added the comment:

#28491 is now resolved, so the PR should be unblocked. Would you mind rebasing 
it on main to retrigger the CI?

--
nosy: +FFY00

___
Python tracker 

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



[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-07-22 Thread Guido van Rossum

Guido van Rossum  added the comment:

Maybe we should not fix this then? Copying seems unattractive, and the
reason we proxy in the first place is not absolute safety but to make sure
people don’t accidentally update the dict when they intend to update the
class (for the side effect of updating slots when e.g. __add__ is
added/removed.--
--Guido (mobile)

--

___
Python tracker 

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



[issue36643] Forward reference is not resolved by dataclasses.fields()

2021-07-22 Thread Eric V. Smith

Eric V. Smith  added the comment:

It can’t be resolved in fields(): it is still undefined when the fields are 
created. 

I think the best solution is PEP 649.

--

___
Python tracker 

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



[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-07-22 Thread Brandt Bucher


Brandt Bucher  added the comment:

I believe that delegating to the actual underlying mapping without exposing it 
is a bit of a lost cause, since for some type m we still need these to work:

>>> types.MappingProxyType(m({"a": 0)) | types.MappingProxyType(m({"b": 1}))
m({'a': 0, 'b': 1}) 
>>> types.MappingProxyType(m({"a": 0)) == types.MappingProxyType(m({"a": 0}))
True

(Note that because both sides are proxies, it's impossible for any resolution 
to happen without m explicitly knowing how to handle them unless both mappings 
are unwrapped simultaneously.)

Instead, the attached PR delegates to a *copy* of the underlying mapping for 
these operations instead. I think this is the easiest way to approximate the 
current behavior while maintaining proper encapsulation.

--
stage: patch review -> 

___
Python tracker 

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



[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-07-22 Thread Brandt Bucher


Change by Brandt Bucher :


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

___
Python tracker 

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



[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Ma Lin


Ma Lin  added the comment:

> I suppose it is a very old code

I also found a few old code may have performance loss.

memoryview.cast() method was add in Python 3.3.
This code doesn't use memoryview.cast(), which will bring extra memory overhead 
when the amount of data is very large.
https://github.com/python/cpython/blob/v3.10.0b4/Lib/multiprocessing/connection.py#L190-L194

--
nosy: +malin

___
Python tracker 

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



[issue44717] Improve AttributeError on circular imports of submodules

2021-07-22 Thread Filipe Laíns

Change by Filipe Laíns :


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

___
Python tracker 

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



[issue44717] Improve AttributeError on circular imports of submodules

2021-07-22 Thread Filipe Laíns

New submission from Filipe Laíns :

Consider the following


$ tree a
a
├── b
│   ├── c.py
│   └── __init__.py
└── __init__.py

1 directory, 3 files
$ cat a/b/__init__.py
import a.b.c
$ cat a/b/c.py
import a.b

a.b
$ python
Python 3.9.6 (default, Jun 30 2021, 10:22:16)
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import a.b
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/anubis/test/a/b/__init__.py", line 1, in 
import a.b.c
  File "/home/anubis/test/a/b/c.py", line 3, in 
a.b
AttributeError: module 'a' has no attribute 'b'


This happens because even though the module `a` is initialized, the `b` 
attribute is not set due to the circular import. When a module is partially 
initialized, we get a more helpful error description hinting that we cannot 
access the attribute because the module is partially initialized, we could have 
something similar here.

--
components: Interpreter Core
messages: 398021
nosy: FFY00, pablogsal
priority: normal
severity: normal
status: open
title: Improve AttributeError on circular imports of submodules
type: enhancement

___
Python tracker 

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



[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-22 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I might be missing something here, but if you send arbitrary binary data to 
stdout, where it gets written to the terminal, strange things are likely to 
happen. The terminal interprets the shell characters before Python gets to see 
them.

I think that this is pretty much unavoidable.

The Security Considerations section in the docs is about avoiding shell code 
injection attacks by sending unescaped data to the shell, it isn't relevant to 
the reverse situation where the process sends terminal control codes back.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the follow-up!  Note that the original bug could have been reused.

--
nosy: +eric.araujo
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



[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25841
pull_request: https://github.com/python/cpython/pull/27298

___
Python tracker 

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



[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread miss-islington


miss-islington  added the comment:


New changeset 7d25254cf0763b62f4c4a3019e56385cab597b9f by Jack DeVries in 
branch 'main':
bpo-44713: [doc fix]: typo in subprocess.rst (GH-27297)
https://github.com/python/cpython/commit/7d25254cf0763b62f4c4a3019e56385cab597b9f


--
nosy: +miss-islington

___
Python tracker 

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



[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread Guido van Rossum

Guido van Rossum  added the comment:

Thanks for taking over here, Ł!

--

___
Python tracker 

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



[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

2021-07-22 Thread Łukasz Langa

Łukasz Langa  added the comment:

Interestingly I cannot reproduce the clang report on macOS 10.15 with clang 
12.0.0. Maybe it's a new capability of clang 12.0.5 in Big Sur.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks Serhiy for the report and the fix, and Ken for reviews.

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



[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 21db59fc75b6ebb01bf120a8e5930fe032174f73 by Miss Islington (bot) 
in branch '3.10':
bpo-44653: Support typing types in parameter substitution in the union type. 
(GH-27247) (#27296)
https://github.com/python/cpython/commit/21db59fc75b6ebb01bf120a8e5930fe032174f73


--

___
Python tracker 

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



[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread Jack DeVries


Change by Jack DeVries :


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

___
Python tracker 

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



[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread Jack DeVries


New submission from Jack DeVries :

Good feedback from @merwork just missed the merge, but he is right: it should 
be ``shell=True``, not ``"shell=True"``.

https://github.com/python/cpython/pull/26755#discussion_r675128438

I'll be attaching a PR in just a moment.

--
messages: 398010
nosy: jack__d
priority: normal
severity: normal
status: open
title: subprocess.rst typo ``"shell=True"`` => ``shell=True``

___
Python tracker 

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



[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +25839
pull_request: https://github.com/python/cpython/pull/27296

___
Python tracker 

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



[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 2e3744d50b6e30ea24351e55b4352dcc58fd469e by Serhiy Storchaka in 
branch 'main':
bpo-44653: Support typing types in parameter substitution in the union type. 
(GH-27247)
https://github.com/python/cpython/commit/2e3744d50b6e30ea24351e55b4352dcc58fd469e


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2021-07-22 Thread Josh Meranda


Change by Josh Meranda :


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

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2021-07-22 Thread Jack DeVries


Jack DeVries  added the comment:

Hi all!

@eamanu, I went ahead and picked up where you left off. I stopped short of
opening up a PR, because I don't want to step on any toes, but I definitely
want to do what I can to give this bpo one final shove over the finish line.

Despite not creating a PR, you can see the changes here:

https://github.com/python/cpython/compare/main...jdevries3133:bpo-19217-slow-assertEq

@eamanu, if you prefer, you can probably just merge this branch into
`eamanu:fix_bpo-19217`, and the conversation can move forward on GH-11204.

Also, below is a summary of what I've done:


Revert Change to difflib


Link to the original thread where this change was discussed a bit:

https://github.com/python/cpython/pull/11204#discussion_r242369775

I assume this was a performance improvement. It's not clear to me why we are
not interested in this part of the diff when the input is a list or tuple.
I'm sure someone will help to explain, but this is why I reverted this change:

1. It is not an issue with unittest, and reaches beyond the scope of this bpo
2. The performance problem at the root of this bpo is solved without this
   change.
3. Reverting this change fixes most of the cascading failures throughout other
   parts of the test suite. It better constrains this fix to improving the
   implementation's performance issues while limiting changes to behavior.

Obviously, I don't have knowledge of the reasoning behind this change
sufficient to write a new bpo, but I think that this small change does deserve
its own bpo with an independent explaination of what it does and why it should
be done.

It's definitely possible that I'm missing something here, so let me know if
that's the case!


Add Regression Test
===

The regression test basically attempts to reproduce the problem and asserts
that the code will complete within one second. It's a pretty rough approach,
but I think that it will catch a future regression. If anyone has any better
ideas, I'm all ears.


Misc


I also fixed the one failing test in unittest's own test case, and added a
blurb.

--
nosy: +jack__d

___
Python tracker 

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



[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 0f55d21212a0fb6dec4479eb76249ab2b54e57a3 by Łukasz Langa in 
branch '3.9':
[3.9] bpo-44708: Only re-run test methods that match names of previously 
failing test methods (GH-27287) (GH-27293)
https://github.com/python/cpython/commit/0f55d21212a0fb6dec4479eb76249ab2b54e57a3


--

___
Python tracker 

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



[issue44353] PEP 604 NewType

2021-07-22 Thread Łukasz Langa

Łukasz Langa  added the comment:

Note: we won't be backporting _typing to Python 3.10 as it is much too late for 
a new module at this point in the life cycle. Consequently, 3.10 will be a 
(temporary) performance regression in terms of typing.NewType.

Thanks everyone, most of all Josepth for reporting and Yurii for implementing 
the required changes.

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



[issue44353] PEP 604 NewType

2021-07-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 96c4cbd96c769e92869c62ba898dd9eb670baa81 by Yurii Karabas in 
branch 'main':
bpo-44353: Implement typing.NewType __call__ method in C (#27262)
https://github.com/python/cpython/commit/96c4cbd96c769e92869c62ba898dd9eb670baa81


--

___
Python tracker 

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



[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also issue44712.

--

___
Python tracker 

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



[issue44712] Replace `type(literal)` with corresponding builtin types

2021-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

All cases was manually checked several times (with months passes between 
checks). Several cases were preserved: when the name of built-in type 
conflicted with the name of function parameter (in weakref.py), when the code 
was used for testing type() and when the test code looks clearer with 
type(literal).

--

___
Python tracker 

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



[issue44712] Replace `type(literal)` with corresponding builtin types

2021-07-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +25836
pull_request: https://github.com/python/cpython/pull/27293

___
Python tracker 

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



[issue44712] Replace `type(literal)` with corresponding builtin types

2021-07-22 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

There are several occurrences of type(literal) in the code of the stdlib where 
literal is a literal of built-in type: '', 1, [], {}, etc. I suppose it is a 
remnants of very old code written when str, int, list, dict, etc were functions 
and not classes.

The proposed PR replaces `type(literal)` with corresponding builtin types. It 
makes the code cleaner.

I consider also idea of replacing identity or equality checks ("is" or "==") 
with isinstance(). I suppose that that code was written when built-in  types 
were not subclassable. But now there is a reason to use isinstance().

See also issue44711.

--
components: Library (Lib)
messages: 398002
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Replace `type(literal)` with corresponding builtin types
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



[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 9608719e12b14087c1cb34f77c847974442cd6e7 by Miss Islington (bot) 
in branch '3.10':
bpo-44708: Only re-run test methods that match names of previously failing test 
methods (GH-27287) (GH-27290)
https://github.com/python/cpython/commit/9608719e12b14087c1cb34f77c847974442cd6e7


--

___
Python tracker 

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



[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I suppose it is a very old code written when str was a function, not a type 
(thus using type('')) and builtin types were not subclassable (thus not using 
isinstance()).

I once analyzed other similar cases in the stdlib. Seems it is time to revive 
my old patch.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

2021-07-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

2021-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

AFAIK pointer arithmetic with NULL has undefined behavior. There is similar 
case in list_slice().

--
components: +Interpreter Core
nosy: +mark.dickinson, serhiy.storchaka
type:  -> compile error
versions: +Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Anton Grübel

Anton Grübel  added the comment:

I know that :) , it is just weird to do also do the type check on an empty 
string, which can be replaced with str directly, but as far as I know it is 
usually better to use isinstance instead of type.

--

___
Python tracker 

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



[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +25833
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27291

___
Python tracker 

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



[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

The difference is that type(cmd) is doing an exact match on the type, while 
isinstance is checking for types or derived types. I don't know if that makes a 
difference here, but it's worth noting.

--
nosy: +eric.smith

___
Python tracker 

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



[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Anton G.


New submission from Anton G. :

When I did some work on typeshed I found some weird syntax in pipes.py.

if type(cmd) is not type(''):

which can easily be changed to

if not isinstance(cmd, str):

There are two occurrences and I will directly create the PR :)

--
components: Library (Lib)
messages: 397995
nosy: anton.gruebel
priority: normal
severity: normal
status: open
title: Optimize type check in pipes.py
type: performance

___
Python tracker 

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



[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f1afef5e0d93d66fbf3c9aaeab8b3b8da9617583 by Łukasz Langa in 
branch 'main':
bpo-44708: Only re-run test methods that match names of previously failing test 
methods (GH-27287)
https://github.com/python/cpython/commit/f1afef5e0d93d66fbf3c9aaeab8b3b8da9617583


--

___
Python tracker 

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



[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset d0c61753036dcae292d49aa8ddac555062da6b76 by Miss Islington (bot) 
in branch '3.10':
bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., 
shell=True) (GH-26755) (GH-27288)
https://github.com/python/cpython/commit/d0c61753036dcae292d49aa8ddac555062da6b76


--

___
Python tracker 

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



[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 5ffbb05f1c3c952588ba5c1927da0e8223f5aaa7 by Miss Islington (bot) 
in branch '3.9':
bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., 
shell=True) (GH-26755) (GH-27289)
https://github.com/python/cpython/commit/5ffbb05f1c3c952588ba5c1927da0e8223f5aaa7


--

___
Python tracker 

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



[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25831
pull_request: https://github.com/python/cpython/pull/27289

___
Python tracker 

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



[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +25830
pull_request: https://github.com/python/cpython/pull/27288

___
Python tracker 

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



[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 50ffbe3dafcae7826d114df61d56c7ac45a6358c by Jack DeVries in 
branch 'main':
bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., 
shell=True) (GH-26755)
https://github.com/python/cpython/commit/50ffbe3dafcae7826d114df61d56c7ac45a6358c


--
nosy: +iritkatriel

___
Python tracker 

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



[issue44689] MacOS: Python binaries not portable between Catalina and Big Sur

2021-07-22 Thread Tobias Bergkvist


Tobias Bergkvist  added the comment:

Okay, I decided to look into how I could do dynamic loading as you suggested.

Here is a POC (executable) for using _dyld_shared_cache_contains_path when 
available:

```
#include 
#include 

void* libsystemb_handle;
typedef bool (*_dyld_shared_cache_contains_path_f)(const char* path);
_dyld_shared_cache_contains_path_f _dyld_shared_cache_contains_path;

bool _dyld_shared_cache_contains_path_fallback(const char* name) {
return false;
}

__attribute__((constructor)) void load_libsystemb(void) {
if (
(libsystemb_handle = dlopen("/usr/lib/libSystem.B.dylib", RTLD_LAZY)) 
== NULL ||
(_dyld_shared_cache_contains_path = dlsym(libsystemb_handle, 
"_dyld_shared_cache_contains_path")) == NULL
) {
_dyld_shared_cache_contains_path = 
_dyld_shared_cache_contains_path_fallback;
}
}

__attribute__((destructor)) void unload_libsystemb(void) {
if (libsystemb_handle != NULL) {
dlclose(libsystemb_handle);
}
}

int main(int argc, char ** argv) {
printf("Library exists in cache: %d\n", 
_dyld_shared_cache_contains_path(argv[1]));
}
```

A fallback function is used when _dyld_shared_cache_contains_path cannot be 
loaded, which always returns false. If there is no cache - the (nonexistent) 
cache also does not contain whatever path you pass it.

The constructor function is called when the Python extension is loaded - 
ensuring that _dyld_shared_cache_contains_path is defined and callable. I've 
read that C extension modules cannot be autoreloaded 
(https://ipython.org/ipython-doc/3/config/extensions/autoreload.html) - so this 
might mean there is no need for a deconstructor? Instead the OS would handle 
cleanup once the process exits?

This could be compiled on either MacOS Catalina or Big Sur, and run without 
problems on the other MacOS version.

Regarding the "explicit weak linking" when building on MacOS Big Sur and later; 
wouldn't this mean that a Big Sur build wouldn't work on Catalina?

Would you be positive towards a PR with the approach I demonstrated here?

--

___
Python tracker 

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



[issue44710] Unexpected behavior in empty class with pass (Python 3.7.3)

2021-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Because super().__init__(name, bases, nmspc) does not have any effect. Type is 
created by the metaclass' __new__ method, and the __init__ method is virtually 
no-op.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44710] Unexpected behavior in empty class with pass (Python 3.7.3)

2021-07-22 Thread Cheuk Ting Ho


New submission from Cheuk Ting Ho :

Demo example:

===
class MyType(type):
def __init__(cls, name, bases, nmspc):

if "__annotations__" in nmspc:
annotations = nmspc["__annotations__"]
else:
nmspc["__annotations__"] = {}
annotations = nmspc["__annotations__"]

for parent in bases:
base_annotations = (
parent.__annotations__ if hasattr(parent, "__annotations__") 
else {}
)
annotations.update(base_annotations)

super().__init__(name, bases, nmspc)

class Coordinate(metaclass=MyType):
x: float
y: float

class Address(metaclass=MyType):
street: str
country: str


class Location(Address, Coordinate):
pass


class Location2(Address, Coordinate):
name: str


print(Location.__annotations__)
print(Location2.__annotations__)

Output:

{'street': , 'country': }
{'name': , 'street': , 'country': , 'x': 
, 'y': }

Was expecting the two print to be only different by 'name':  but 
the `Location fails to inherit the attribute from `Coordinate`. Not the case 
for `Location2`


*it's my first time submitting an issue, please kindly tell me what to do if I 
am not doing the right thing.

--
components: C API
messages: 397988
nosy: Cheukting
priority: normal
severity: normal
status: open
title: Unexpected behavior in empty class with pass (Python 3.7.3)
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue44651] An unclear definition in Doc/glossary.rst

2021-07-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

Closing. @StevenHsuYL: Thank you for the contribution!

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



[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-22 Thread San


New submission from San :

I was trying to wrap an old game server executable with a built-in console 
using Popen.

class ServerWrapper(Thread):
def __init__(self, pathToExecutable: str, statusMonitor: Popen = None, 
active: bool = False):
super().__init__()
self.pathToExecutable = pathToExecutable
self.statusMonitor = statusMonitor
self.active = active

def run(self):
self.statusMonitor = Popen(['./bf1942_lnxded', "+statusMonitor", '1'], 
encoding='latin_1', stdout=PIPE,
   stdin=PIPE, cwd=self.pathToExecutable)
while self.active:
currentLine = self.statusMonitor.stdout.readline()
if currentLine:
print(currentLine)
input('')

def start(self):
self.active = True
super().start()

def stop(self):
self.active = False



I expected to be able to read the output line-by-line using enter, in a 'normal 
fashion'.
After importing this from a terminal and setting it up somewhat like so:

wrapper = ServerWrapper('bf1942')
wrapper.start()

However, once the server process started and thereby started writing to stdout, 
weird stuff started to happen to my shell with the python interpreter.

Apparently, there are control characters and ansi-escape codes sent from the 
process, that somehow manage to manipulate my shell if I specify an encoding. 
Consequentially the lines output with 'print(currentLine)' are reduced by these 
chars.

Is this the desired behaviour of the decoder? If so then I think this should 
potentially be further clarified in the documentation of Popen. I would have 
expected the chars to be escaped because the worst thing is, this happens even 
if you don't actually read from stdout at all. Seemingly the decoder executes 
incoming control sequences immediately (probably for the buffer?), regardless 
of if you actually bother to read the stdout or not.

The paragraph in 
https://docs.python.org/3.7/library/subprocess.html#security-considerations 
sounds like this shouldn't be happening if 'shell' is not set to 'True' at 
least.

--
files: shell.png
messages: 397986
nosy: San
priority: normal
severity: normal
status: open
title: [3.7] Popen Control Characters in stdout affect shell session
versions: Python 3.7
Added file: https://bugs.python.org/file50170/shell.png

___
Python tracker 

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



[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa

Change by Łukasz Langa :


--
keywords: +patch
pull_requests: +25829
pull_request: https://github.com/python/cpython/pull/27287

___
Python tracker 

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



[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa

New submission from Łukasz Langa :

When the CPython test suite re-runs a flaky failed test, it doesn’t actually 
re-run just that failed test but the entire test file. The most common case for 
flaky tests is when networking, threading, or multiprocessing is involved. 
Frustratingly those are some of the largest test files we have. Re-running them 
takes a lot of time.

Instead of re-running the entire file, regrtest should only re-run what 
actually failed.

NOTE: I added 3.10 and 3.9 to this issue even though it's not a pure bugfix. 
The reason is that this can visibly speed up CI for open pull requests.

(Of course, it would be best to avoid flaky tests altogether and we’re working 
on that, but re-running what failed is a pragmatic stopgap that is necessary in 
times of distributed CI that we don’t fully control.)

--
assignee: lukasz.langa
components: Tests
messages: 397985
nosy: lukasz.langa, pablogsal
priority: normal
severity: normal
stage: patch review
status: open
title: Regression tests with -w should only re-run affected test methods, not 
the entire file
type: resource usage
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue41556] hostname verification fails if hostname starts with literal IPv4

2021-07-22 Thread Devin Bayer


Change by Devin Bayer :


--
nosy: +akvadrako

___
Python tracker 

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



[issue44697] Memory leak when asyncio.open_connection raise

2021-07-22 Thread Artem


Change by Artem :


--
nosy: +bquinlan

___
Python tracker 

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



[issue44689] MacOS: Python binaries not portable between Catalina and Big Sur

2021-07-22 Thread Tobias Bergkvist

Tobias Bergkvist  added the comment:

You are absolutely right! From the manpage of dlopen(3) on MacOS Big Sur:

> dlopen() examines the mach-o file specified by path. If the file is 
> compatible with the current process and has not already been loaded into the 
> current process, it is loaded and linked.  After being linked, if it contains 
> any initializer functions, they are called, before dlopen() returns. dlopen() 
> can load dynamic libraries and bundles.  It returns a handle that can be used 
> with dlsym() and dlclose(). A second call to dlopen() with the same path will 
> return the same handle, but the internal reference count for the handle will 
> be incremented. Therefore all dlopen() calls should be balanced with a 
> dlclose() call.

Essentially, if the shared library contains initializer functions that have 
some kind of side-effects, dlopen will also trigger these side-effects.

Basic example:
```
// mylib.c
#include 
void myinit(void) {
printf("Hello from mylib\n");
}
__attribute__((section("__DATA,__mod_init_func"))) typeof(myinit) *__init = 
myinit;
```

---
```
// main.c
#include 
#include 
int main(void) {
void* handle = dlopen("./mylib.dyld", RTLD_LAZY);
if (handle == NULL) printf("Failed to load"); 
}
```

$ clang mylib.c -shared -o mylib.dyld
$ clang main.c -o main
$ ./main
Hello from mylib

--

___
Python tracker 

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



[issue44651] An unclear definition in Doc/glossary.rst

2021-07-22 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset c05a790693b3b00ac7cb5b96ad416ca9d8ecb14a by Steven Hsu in branch 
'main':
bpo-44651: delete entry of "coercion" in Doc/glossary.rst (GH-27226)
https://github.com/python/cpython/commit/c05a790693b3b00ac7cb5b96ad416ca9d8ecb14a


--

___
Python tracker 

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



[issue42414] unable to document fields of dataclass

2021-07-22 Thread Denis Laxalde


Change by Denis Laxalde :


--
nosy: +dlax

___
Python tracker 

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



[issue44697] Memory leak when asyncio.open_connection raise

2021-07-22 Thread Andrey


Andrey  added the comment:

Confirmed. I have the same problem. I suspect this is related to 
https://bugs.python.org/issue41699.

--
nosy: +whoKilledLora

___
Python tracker 

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



[issue35183] os.path.splitext documentation needs typical example

2021-07-22 Thread Jake Stockwin


Jake Stockwin  added the comment:

Thanks for the info, @jack__d - very helpful.
I have now submitted a PR for this and will await a review. Let me know if 
anything else is needed.

--

___
Python tracker 

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



[issue35183] os.path.splitext documentation needs typical example

2021-07-22 Thread Jake Stockwin


Change by Jake Stockwin :


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

___
Python tracker 

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



[issue44705] Support Windows file open modes for `open` built-in function

2021-07-22 Thread Eryk Sun


Eryk Sun  added the comment:

Currently you can use os.open() if you need platform-specific open flags such 
as Windows O_RANDOM, O_SEQUENTIAL, O_SHORT_LIVED, and O_TEMPORARY. The file 
descriptor can be passed to builtin open() to get a file object that owns the 
fd.

It might be more convenient if the os module had a function to translate an 
open() mode string into a combination of the flags O_RDONLY, O_WRONLY, O_RDWR, 
O_CREAT, O_TRUNC, O_EXCL, and O_APPEND. Plus O_BINARY in Windows.

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue44689] MacOS: Python binaries not portable between Catalina and Big Sur

2021-07-22 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The disadvantage of using dlopen is that this function has side effects, and 
those can affect program behaviour.  Because of this I'm against switching to 
using dlopen to probe for libraries.

--

___
Python tracker 

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



[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

2021-07-22 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

New submission from Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
:

After seeing this issue https://bugs.python.org/issue44698, I wanted to run 
clang on the main branch (c878f5d81772dc6f718d6608c78baa4be9a4f176) with an 
undefined option enabled.

Is the following a bug or false positive?

Objects/listobject.c:527:24: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
Objects/listobject.c:527:24 in


Steps to reproduce.
1. export CC="/usr/bin/clang -fsanitize=undefined"
2. ./configure --with-pydebug --with-openssl=$(brew --prefix openssl)
3. make -j

Meta :
➜ clang --version
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

➜ uname -a
Darwin Srinivass-MBP.Dlink 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 
00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64

--
messages: 397978
nosy: thatiparthy
priority: normal
severity: normal
status: open
title: runtime error: applying zero offset to null pointer in 
Objects/listobject.c

___
Python tracker 

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



[issue44706] UUID constructor should accept another UUID instance

2021-07-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is a duplicate of issue32112.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Should uuid.UUID() accept another UUID() instance?

___
Python tracker 

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



[issue44706] UUID constructor should accept another UUID instance

2021-07-22 Thread Tzach Yarimi


Change by Tzach Yarimi :


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

___
Python tracker 

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



[issue44706] UUID constructor should accept another UUID instance

2021-07-22 Thread Tzach Yarimi


New submission from Tzach Yarimi :

Primitives usually accept an instance of their own type in the constructor, for 
example:

int(5)
str("a")
tuple((1,2,3))

This is not the case for UUID:
>>> from uuid import uuid4, UUID
>>> x = uuid4()
>>> UUID(x)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/uuid.py",
 line 168, in __init__
hex = hex.replace('urn:', '').replace('uuid:', '')
AttributeError: 'UUID' object has no attribute 'replace'

--

___
Python tracker 

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



[issue44706] UUID constructor should accept another UUID instance

2021-07-22 Thread Tzach Yarimi


Change by Tzach Yarimi :


--
components: Library (Lib)
nosy: tzach
priority: normal
severity: normal
status: open
title: UUID constructor should accept another UUID instance
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