[issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

2022-02-19 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Replicated on Linux, Python 3.10.

It looks like mousewheel scrolling jumps by the wrong amount as it pages down 
(or up), and consequently some lines never appear in the view area.

I ran a slightly modified version of the code that had 16 entries instead of 
just seven. By default, just three entries are visible at a time. If we number 
the lines 1-16, and start with lines 1-3 visible, then we get:

* Initial view: lines 1, 2, 3 visible, 4-16 below the view area.
* Scrollwheel down.
* Lines 6-8 visible, 1-5 above the view area, 9-16 below.
* Scrollwheel down.
* Lines 11-13 visible, 1-10 above the view area, 14-16 below.
* Scrollwheel down.
* Lines 14-16 visible, 1-13 above the view area.

So the scrollwheel scrolls down by: 5 lines, 5 lines, 3 lines.

Going back the otherway, the scrollwheel scrolls up by 5, 5, 3.

Why five lines? My guess is that it might have something to do with 16//3 = 5.

I don't know if this is something we can fix, or we're stuck with whatever 
tk/tcl does.

I don't know if this is related, or should be a separate issue, but I see that 
the keyboard PageUp and PageDown keys don't scroll up or down by a page, but by 
a single line -- and they don't correctly highlight the selected line either.

Paging should scroll up or down by N-1 lines, where N is the number of visible 
lines in the view area.

Likewise for clicking in the scrollbar's PageUp/PageDown region, which also 
scrolls by a single line.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

2022-02-19 Thread Jason Yang


New submission from Jason Yang :

When scrolled items by mouse wheel in tk.Listbox/ttk.Combobox, some items not 
shown.

Is it a bug ? or I did something wrong ?

In following case, 'Wednesday' will not shown when scroll mouse wheel at

- tk.Listbox or vertical scrollbar of tk.Listbox, or
- listbox of ttk.Combo

```python
from tkinter import *
from tkinter import ttk

font = ('Courier New', 24)
lst = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 
'Saturday')

root = Tk()

frame1 = Frame(root)
frame1.pack(side=LEFT)
vsb1 = Scrollbar(frame1, orient='v')
vsb1.pack(side=RIGHT, fill='y')
var = StringVar()
var.set(lst)
listbox = Listbox(frame1, width=10, height=3, listvariable=var, font=font, 
yscrollcommand=vsb1.set)
listbox.pack(side=LEFT)
vsb1.configure(command=listbox.yview)

frame2 = Frame(root)
frame2.pack(side=LEFT, fill='y')
combobox = ttk.Combobox(frame2, values=lst, width=10, height=3, font=font)
combobox.pack()

root.mainloop()
```

Platform: WIN10

--
components: Tkinter
files: PeS9r.png
messages: 413564
nosy: Jason990420
priority: normal
severity: normal
status: open
title: Item not shown when using mouse wheel to scroll for Listbox/Combobox
type: behavior
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50634/PeS9r.png

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-02-19 Thread Jack O'Connor


Jack O'Connor  added the comment:

Yes, everything in https://github.com/BLAKE3-team/BLAKE3 and 
https://github.com/oconnor663/blake3-py is public domain via CC0, and dual 
licensed under Apache for good measure. Hopefully that makes it easy to use it 
anywhere.

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1: inlining issue in the big _PyEval_EvalFrameDefault() function with Visual Studio (MSC)

2022-02-19 Thread neonene


Change by neonene :


--
pull_requests: +29570
pull_request: https://github.com/python/cpython/pull/31436

___
Python tracker 

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



[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-19 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 0a8a8e7454c6565cf1554d5f23314e4c70960bcd by Jelle Zijlstra in 
branch 'main':
bpo-46066: Check DeprecationWarning in test_typing (GH-31428)
https://github.com/python/cpython/commit/0a8a8e7454c6565cf1554d5f23314e4c70960bcd


--

___
Python tracker 

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



[issue46802] Wrong result unpacking binary data with ctypes bitfield.

2022-02-19 Thread Jonathan


Jonathan  added the comment:

True, have to admit, that I forgot to search first, that really looks like it 
is the same problem, especially when looking at 
https://bugs.python.org/msg289212. Would say this one can be closed.

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



[issue46802] Wrong result unpacking binary data with ctypes bitfield.

2022-02-19 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Possible duplicate of https://bugs.python.org/issue29753

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue46802] Wrong result unpacking binary data with ctypes bitfield.

2022-02-19 Thread Jonathan


Change by Jonathan :


--
nosy:  -helo9

___
Python tracker 

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



[issue46802] Wrong result unpacking binary data with ctypes bitfield.

2022-02-19 Thread Jonathan


New submission from Jonathan :

I have issues unpacking binary data, produced by C++. The appended jupyter 
notebook shows the problem. It is also uploaded to github gist: 
https://gist.github.com/helo9/04125ae67b493e505d5dce4b254a2ccc

--
components: ctypes
files: ctypes_bitfield_problem.ipynb
messages: 413559
nosy: helo9
priority: normal
severity: normal
status: open
title: Wrong result unpacking binary data with ctypes bitfield.
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50633/ctypes_bitfield_problem.ipynb

___
Python tracker 

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



[issue46801] test_typing emits deprecation warnings

2022-02-19 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
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



[issue46801] test_typing emits deprecation warnings

2022-02-19 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue46801] test_typing emits deprecation warnings

2022-02-19 Thread Irit Katriel


New submission from Irit Katriel :

==
ERROR: test_typeddict_create_errors (test.test_typing.TypedDictTests)
--
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython-1/Lib/test/test_typing.py", line 4589, 
in test_typeddict_create_errors
TypedDict('Emp', _fields={'name': str, 'id': int})
^^
  File "/Users/iritkatriel/src/cpython-1/Lib/typing.py", line 2609, in TypedDict
warnings.warn(
^^
DeprecationWarning: The kwargs-based syntax for TypedDict definitions is 
deprecated in Python 3.11, will be removed in Python 3.13, and may not be 
understood by third-party type checkers.

==
ERROR: test_typeddict_errors (test.test_typing.TypedDictTests)
--
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython-1/Lib/test/test_typing.py", line 4602, 
in test_typeddict_errors
TypedDict('Hi', x=1)

  File "/Users/iritkatriel/src/cpython-1/Lib/typing.py", line 2609, in TypedDict
warnings.warn(
^^
DeprecationWarning: The kwargs-based syntax for TypedDict definitions is 
deprecated in Python 3.11, will be removed in Python 3.13, and may not be 
understood by third-party type checkers.

--
components: Tests
messages: 413558
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: test_typing emits deprecation warnings
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



[issue46761] functools.update_wrapper breaks the signature of functools.partial objects

2022-02-19 Thread Larry Hastings


Larry Hastings  added the comment:

Yury, Ka-Ping, can you guys shed any light on this?  Your names are still on 
inspect.py.

--
nosy: +ping, yselivanov

___
Python tracker 

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



[issue46800] Support for pause(2)

2022-02-19 Thread Zachary Ware


Zachary Ware  added the comment:

See signal.pause: https://docs.python.org/3/library/signal.html#signal.pause

--
nosy: +zach.ware

___
Python tracker 

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



[issue46757] dataclasses should define an empty __post_init__

2022-02-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

The fact that it's never been needed in the years that dataclasses and attrs 
have existed tell me it's kind of a niche requirement.

This does not seem like the ugliest code I've ever seen:

if hasattr(super(), "__post_init__"):
super().__post_init__()

or the probably more efficient, but more lines of code:

try:
post_init = super().__post_init__
except AttributeError:
pass
else:
post_init()

As always with calling super functions, the whole hierarchy needs to cooperate. 
Say you had a dataclass:

@dataclass
class Base:
def __post_init__(self, some_arg):
pass

How would an arbitrary derived class know how to call this? It can't. There has 
to be knowledge of the base class's requirements already. Surely knowing 
"__post_init__ must be called with some_arg" isn't too different from "I know 
__post_init__ doesn't exist". I don't think adding ways to make the "always 
call super" pattern easier is a good idea.

I'm still unconvinced, but I'll hold off on making a decision to see if there's 
more support. Maybe taking it to python-ideas would be worthwhile.

--

___
Python tracker 

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



[issue46800] Support for pause(2)

2022-02-19 Thread Philip Rowlands


New submission from Philip Rowlands :

Went looking for os.pause() but found nothing in the docs, bpo, or Google.
https://man7.org/linux/man-pages/man2/pause.2.html

Obviously not a popular syscall, but I have a use case for it.

--
components: Library (Lib)
messages: 413554
nosy: philiprowlands
priority: normal
severity: normal
status: open
title: Support for pause(2)
type: enhancement

___
Python tracker 

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



[issue46757] dataclasses should define an empty __post_init__

2022-02-19 Thread Neil Girdhar


Neil Girdhar  added the comment:

> I'm not crazy about adding a method to every dataclass just for the 0.1% of 
> the times it's needed.

I'm not sure I totally understand the cost here.  You can have a single shared 
global function that you set on each dataclass.  So the only cost would be an 
entry in each dataclass type's dict.  Even if a user creates a thousand 
dataclasses, that should only be tens of killobytes in pointers.

> I think using hasattr or catching the exception is a better way to go.

If you choose this, then I think this should be documented under the 
__post_init__ saying that any time you define __post_init__, you should either 
be a final class, or else call super.  If you call super, you musteither use 
hasattr(super().__post_init__) or catch the exception.

I have to admit, I find this quite ugly from a user perspective.

--

___
Python tracker 

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



[issue46795] Why Does 3rd/Python39/Lib/site-packages/psycopg2/_psycopg.cp39-win_amd64.pyd Have the CVE-2021-3711 CVE-2021-23840 CVE-2021-3450 CVE-2021-3712 CVE-2021-23841 CVE-2021-3449 CVE-2021-4160 V

2022-02-19 Thread Zachary Ware


New submission from Zachary Ware :

Psycopg2 is a third-party package; questions about it should be directed to the 
Users category of discuss.python.org, the python-list mailing list, or a forum 
specific to psycopg2.

Also, note that Python 3.9.2 is well out of date; you should update to 3.9.10 
or 3.10.2.  On Windows, OpenSSL is included with Python, and is most easily 
updated by updating Python.

And lastly, please use the comment field rather than cramming your comments 
into the title field.

--
nosy: +zach.ware
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



[issue46400] Please update bundled libexpat to 2.4.4 with security fixes (CVE-2021-45960)

2022-02-19 Thread sping


sping  added the comment:

Overlooked your reference, so you already know, my bad, nevermind.

--

___
Python tracker 

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



[issue46400] Please update bundled libexpat to 2.4.4 with security fixes (CVE-2021-45960)

2022-02-19 Thread sping


sping  added the comment:

Yes, I have already created bpo-46794 for 2.4.5.

--

___
Python tracker 

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



[issue45098] asyncio.CancelledError should contain more information on cancellations

2022-02-19 Thread Sam Bull


Sam Bull  added the comment:

I think there's still a problem, in that the user still expects a task to be 
cancelled in the example previously: 
https://github.com/aio-libs/async-timeout/issues/229#issuecomment-908502523

If we encounter the race condition where the timeout cancels the task and then 
the user cancels the task, then we still have the case that async-timeout 
swallows the cancellation and the task will run forever. This would basically 
require the user to check everytime they want to cancel the task, with 
something awkward like:

```
while not task.cancel() and not task.cancelled():
await asyncio.sleep(0)
```

I think this change is still necessary, but rather than adding multiple values 
to e.args, we can use the new ExceptionGroup to raise multiple CancelledErrors. 
So, each call of task.cancel() will create a new CancelledError, and then all 
of those CancelledErrors will get raised together.

For async-timeout, we can then just catch the CancelledError with our sentinel 
and raise a TimeoutError, while reraising any other CancelledErrors.

--

___
Python tracker 

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



[issue46757] dataclasses should define an empty __post_init__

2022-02-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm not crazy about adding a method to every dataclass just for the 0.1% of the 
times it's needed.

I think using hasattr or catching the exception is a better way to go.

--

___
Python tracker 

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



[issue46200] Discourage logging f-strings due to security considerations

2022-02-19 Thread Arie Bovenberg


Arie Bovenberg  added the comment:

Thanks @gregory.p.smith! I didn't know about discuss.python.org. I created a 
new topic there: 
https://discuss.python.org/t/safer-logging-methods-for-f-strings-and-new-style-formatting/13802

--

___
Python tracker 

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



[issue46797] ast.Constant.n deprecated without warning

2022-02-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is because we did not have a plan for removing deprecates features. 
Deprecation in documentation only helps third-party code. Instead of adding a 
complex code which switches between using old and new names depending on Python 
version, the third-party code can continue to use old names without worring 
about deprecation warnings, and switch completely to using new features only 
when support of old Python versions be dropped. 3.7 and 3.8 are not so old and 
may be still supported in third-party code.

I have created a PR which adds deprecation warnings, but I am not sure that it 
is worth to include it in 3.11.

--
priority: normal -> low
resolution:  -> postponed

___
Python tracker 

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



[issue46797] ast.Constant.n deprecated without warning

2022-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue46791] Allow os.remove to defer to rmdir

2022-02-19 Thread Eryk Sun


Eryk Sun  added the comment:

In Windows, checking for a directory in order to defer to either 
os_rmdir_impl() or os_unlink_impl() would lead to a redundant directory check. 
os_unlink_impl() already has to check for a directory in order to delete a 
directory symlink or mountpoint. I suggest implementing a common _Py_remove() 
function in Windows. For example:

typedef enum {
REMOVE_FILE,
REMOVE_DIR,
REMOVE_BOTH,
} _Py_remove_mode;

int
_Py_remove(path_t *path, _Py_remove_mode mode)
{
BOOL isDir = FALSE;
BOOL isLnk = FALSE;
BOOL success = FALSE;

if (mode != REMOVE_DIR) {
DWORD fileAttributes = GetFileAttributesW(path->wide);
if (fileAttributes != INVALID_FILE_ATTRIBUTES) {
isDir = fileAttributes & FILE_ATTRIBUTE_DIRECTORY;
}

if (isDir && (mode == REMOVE_FILE)) {
WIN32_FIND_DATAW data;
HANDLE hFind = FindFirstFileW(path->wide, );
if (hFind != INVALID_HANDLE_VALUE) {
FindClose(hFind);
if (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
isLnk = IsReparseTagNameSurrogate(data.dwReserved0);
}
}
}
}

if (mode == REMOVE_DIR || isDir && (mode == REMOVE_BOTH || isLnk)) {
success = RemoveDirectoryW(path->wide);
} else {
success = DeleteFileW(path->wide);
}

return success ? 0 : -1;
}

The multiple opens for GetFileAttributesW(), FindFirstFileW() and DeleteFileW() 
add up to make the delete more expensive and more race prone than it has to be. 
It would be nice to use a single open for all operations. But the Windows API 
just has CreateFileW(), which requires SYNCHRONIZE access. The latter can't be 
granted by the parent directory, unlike FILE_READ_ATTRIBUTES and DELETE access. 
We could implement a version that uses CreateFileW(), and fall back on the 
above version when access is denied, similar to what we do for os.stat(). Also, 
Python is limited to the Windows 8.1 SDK, which makes it awkward to use 
FileDispositionInfoEx (POSIX delete) like DeleteFileW() does in Windows 10, but 
it should still be possible.

--
nosy: +eryksun
stage:  -> needs patch
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



[issue46799] ShareableList memory bloat and performance improvement

2022-02-19 Thread Ting-Che Lin


New submission from Ting-Che Lin :

The current implementation of ShareableList keeps an unnecessary list of 
offsets in self._allocated_offsets. This list could have a large memory 
footprint if the number of items in the list is high. Additionally, this list 
will be copied in each process that needs access to the ShareableList, 
sometimes negating the benefit of the shared memory. Furthermore, in the 
current implementation, different metadata is kept at different sections of 
shared memory, requiring multiple struck.unpack_from calls for a __getitem__ 
call. I have attached a prototype that merged the allocated offsets and packing 
format into a single section in the shared memory. This allows us to use single 
struck.unpack_from operation to obtain both the allocated offset and the 
packing format. By removing the self._allocated_offset list and reducing the 
number of struck.unpack_from operations, we can drastically reduce the memory 
usage and increase the reading performance by 10%. In the case where there are 
only intege
 rs in the ShareableList, we can reduce the memory usage by half. The attached 
implementation also fixed the issue https://bugs.python.org/issue44170 that 
causes error when reading some Unicode characters. I am happy to adapt this 
implementation into a proper bugfix/patch if it is deemed reasonable.

--
components: Library (Lib)
files: shareable_list.py
messages: 413544
nosy: davin, pitrou, tcl326
priority: normal
severity: normal
status: open
title: ShareableList memory bloat and performance improvement
type: performance
versions: Python 3.10, Python 3.11, Python 3.9
Added file: https://bugs.python.org/file50632/shareable_list.py

___
Python tracker 

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



[issue46798] xml.etree.ElementTree: get() doesn't return default value, always ATTLIST value

2022-02-19 Thread padremayi


New submission from padremayi :

XML test file:









]>



This is a simple object
2022
Myself




Python code:
import xml.etree.ElementTree


try:
xml_data = xml.etree.ElementTree.iterparse("test.xml", events=("start", 
"end"))

for event, xml_tag in xml_data:
if event == "end" and xml_tag.tag == "object":
object_name = xml_tag.get("name")
object_description = xml_tag.find("description").text
works = xml_tag.get("works", default="foo")

print("works value: " + str(works))

xml_tag.clear()

print("Done!")

except (NameError, xml.etree.ElementTree.ParseError):
print("XML error!")


Output:
works value: yes
Done!


Expected behaviour:
works value: foo
Done!

--
components: XML
messages: 413543
nosy: padremayi
priority: normal
severity: normal
status: open
title: xml.etree.ElementTree: get() doesn't return default value, always 
ATTLIST value
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue46782] Docs error for 3.10

2022-02-19 Thread Éric Araujo

Éric Araujo  added the comment:

Octal 777 is really the same as decimal 511.
If you are calling mkdir and looking at the permissions on the created 
directory, you may think the mode is wrong because of umask (default permission 
bitmask that’s applied to the mode).  But the numbers are really equivalent, we 
are only talking about a doc presentation issue here, not any problem in code.

--

___
Python tracker 

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



[issue46795] Why Does 3rd/Python39/Lib/site-packages/psycopg2/_psycopg.cp39-win_amd64.pyd Have the CVE-2021-3711 CVE-2021-23840 CVE-2021-3450 CVE-2021-3712 CVE-2021-23841 CVE-2021-3449 CVE-2021-4160 V

2022-02-19 Thread zjmxq


Change by zjmxq :


--
title: Why Does 
3rd/Python39/Lib/site-packages/psycopg2/_psycopg.cp39-win_amd64.pyd Have the 
CVE-20211-4160 Vulnerability? I Use Python 3.9.2? Where Is OpenSSL Used? -> Why 
Does 3rd/Python39/Lib/site-packages/psycopg2/_psycopg.cp39-win_amd64.pyd Have 
the CVE-2021-3711 CVE-2021-23840 CVE-2021-3450 CVE-2021-3712 CVE-2021-23841 
CVE-2021-3449 CVE-2021-4160 Vulnerability? I Use Python 3.9.2? Where Is OpenSSL 
Used?

___
Python tracker 

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



[issue46797] ast.Constant.n deprecated without warning

2022-02-19 Thread Jakub Wilk


New submission from Jakub Wilk :

ast.Constant.n is documented to be deprecated, but you don't get any warning 
when you use it:

$ python3.11 -Wd
Python 3.11.0a5 (main, Feb 12 2022, 17:11:59) [GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> help(ast.Constant.n)
Help on property:

Deprecated. Use value instead.

>>> ast.Constant(value=42).n
42

--
components: Library (Lib)
messages: 413541
nosy: jwilk, serhiy.storchaka
priority: normal
severity: normal
status: open
title: ast.Constant.n deprecated without warning
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



[issue46757] dataclasses should define an empty __post_init__

2022-02-19 Thread Neil Girdhar

Neil Girdhar  added the comment:

On Sat, Feb 19, 2022 at 2:51 AM Vedran Čačić  wrote:

>
> Vedran Čačić  added the comment:
>
> That "except AttributeError" approach is a powerful bug magnet, since it
> can very easily mask real attribute errors stemming from misspelled
> attribute names in the __post_init__ call itself. What you should _really_
> do is
>
> def __post_init__(self):
> with contextlib.suppress(AttributeError):
> post_init = super().__post_init__
> post_init()
>
> But of course, nobody will ever write that.
>
> Great point!

Raymond in his "super considered super" video (
> https://youtu.be/xKgELVmrqfs?t=2068) says the right thing to do is to
> make your own root which knows exactly what classes it manages, and drops
> the supercalls from them (after possibly verifying that all kwargs have
> actually been used and so on).
>
> But in case of dataclasses, usually any class can serve as such a root,
> and the main reason people use dataclasses is to avoid boilerplate code. So
> I think it would be a nice compromise.
>

I'm not sure I understand what you're saying here.  Anyone can inherit from
a class C with the special root and some other class D, and then your
introduced root won't catch D's super calls.

>
> --
> nosy: +veky
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue46777] Fix incorrect use of directives in asyncio documentation

2022-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue24053] Define EXIT_SUCCESS and EXIT_FAILURE constants in sys

2022-02-19 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

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