[issue43211] Python is not responding after running program

2021-02-12 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hi Diasy, welcome!

Please don't post screen shots of code. That makes it difficult or impossible 
for the blind and visually impaired to contribute, and it means that we have to 
retype your code from scratch to run it, which may introduce new errors. 
Instead, please copy and paste the code as text into your bug report, or attach 
it as a .py file.

I'm not entirely sure what your bug report is here. Your program is stuck in a 
loop:

while True:
wn.update

which does nothing and goes nowhere. (By the way, I think you forgot to call 
the update method: it should be `wn.update()` with round brackets.)

Does the program respond to you typing Ctrl-C? You might need to do that from 
your command line or IDE, the "Pong" window itself probably won't respond to it.

So I'm not sure what bug you think you have found. It looks like it is probably 
running normally to me.

(Disclaimer: I am not using Mac OS, so perhaps the behaviour is different on my 
machine than on yours.)

--
nosy: +steven.daprano

___
Python tracker 

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



[issue43202] Cleanup codeop._maybe_compile

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset b676f5f809007533db3e3fdd01243959dd233d57 by Terry Jan Reedy in 
branch 'master':
bpo-43202: More codeop._maybe_compile clean-ups (GH-24512)
https://github.com/python/cpython/commit/b676f5f809007533db3e3fdd01243959dd233d57


--

___
Python tracker 

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



[issue43142] Do not add duplicate FDs to list in duplicate_for_child()

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I can't (lacking multiprocessing knowledge), but someone else might.

PS: when replying via email, please delete post you are responding to.  When 
added to the web page, the copy is redundant noise.

--

___
Python tracker 

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



[issue43205] Python Turtle Colour

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Python consistently uses American (USA) vocabulary and spellings for its 
English.  Anyone over, say, 14, should learn them to the extent used in Python. 
 Kids under 10 are different.

Issue 24990 was rejected because it proposed to hardcode translation.  A 
software solution would be a different matter.  I have some ideas, but the 
details would depend on how Python is setup for kids to use.

Vedran, #24990, issue24990, and  issue 24990 all link to the bpo url *and* 
indicate whether the issue is open or closed.  (24990 is closed as rejected.)

--
nosy: +terry.reedy

___
Python tracker 

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



Re: PSYCOPG2

2021-02-12 Thread Mladen Gogala via Python-list
On Fri, 12 Feb 2021 18:29:48 +, Tony Ogilvie wrote:

> I am trying to write a program to open a PostgesSQL 13 database using
> psycopg2. All seems to work if I write direct to Python but if I write
> the script into IDLE it does not work with the IDLE Shell 3.9.1
> reporting an error of no attribute 'connect'.
> 
> 
>  
> I have tried many options to try and get this to work.
> 
> 
>  
> Regards
> 
> 
>  
> Tony

It looks like your idle is not using the same interpreter that you are 
using when writing direct code. Anyway, my advice would be to ditch Idle 
and use VSCode. It's fabulous.



-- 
Mladen Gogala
Database Consultant
https://dbwhisperer.wordpress.com
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43200] link to copy module in shutil document, not to shutil.copy

2021-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee: docs@python -> terry.reedy
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue43200] link to copy module in shutil document, not to shutil.copy

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 242f6c9ffe3dd8f613942d5364b816cc89c384be by Miss Islington (bot) 
in branch '3.9':
bpo-43200: Fix link to shutil.copy() in the shutil doc (GH-24505)
https://github.com/python/cpython/commit/242f6c9ffe3dd8f613942d5364b816cc89c384be


--

___
Python tracker 

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



[issue43185] AssertRaises() causes core dump in handling recursion

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#43186, #43187 also have recursive code that fails in 3.9 and recovers in 3.10. 
 Am closing them in favor of this.  Also suspect #43188, #43189, #43190 are 
duplicates.  Yang, recheck after Mark does the backport here.

--

___
Python tracker 

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



[issue43190] < test.support > check_free_after_iterating( ) causes core dump in handling iteration.

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I suspect this is another duplicate of #43185

--
nosy: +terry.reedy

___
Python tracker 

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



[issue43188] multiple operations of dict causes core dump of Python interpreter.

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Like the code in #43185, #43186, #43187, this works better in 3.10.0a5, so I 
suspect it is another duplicate.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue43200] link to copy module in shutil document, not to shutil.copy

2021-02-12 Thread miss-islington


miss-islington  added the comment:


New changeset 4230bd52e3f9f289f02e41ab17a95f50ed4db5a6 by Miss Islington (bot) 
in branch '3.8':
bpo-43200: Fix link to shutil.copy() in the shutil doc (GH-24505)
https://github.com/python/cpython/commit/4230bd52e3f9f289f02e41ab17a95f50ed4db5a6


--

___
Python tracker 

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



[issue43200] link to copy module in shutil document, not to shutil.copy

2021-02-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23308
pull_request: https://github.com/python/cpython/pull/24524

___
Python tracker 

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



[issue43200] link to copy module in shutil document, not to shutil.copy

2021-02-12 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43200] link to copy module in shutil document, not to shutil.copy

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 762fe7deed34a1d5294bf82071d318c8427b4893 by Zackery Spytz in 
branch 'master':
bpo-43200: Fix link to shutil.copy() in the shutil doc (GH-24505)
https://github.com/python/cpython/commit/762fe7deed34a1d5294bf82071d318c8427b4893


--
nosy: +terry.reedy

___
Python tracker 

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



[issue43186] Recursive call causes core dump in assertRaises

2021-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
superseder: Recursive call causes core dump in assertRaises ->  
AssertRaises() causes core dump in handling recursion

___
Python tracker 

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



[issue43186] Recursive call causes core dump in assertRaises

2021-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Recursive call causes core dump in assertRaises

___
Python tracker 

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



[issue43185] AssertRaises() causes core dump in handling recursion

2021-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg386896

___
Python tracker 

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



[issue43213] Shortcut for checking if PurePath object contains str

2021-02-12 Thread Tomas Gustavsson


Change by Tomas Gustavsson :


--
keywords: +patch
Added file: https://bugs.python.org/file49806/pure_path_contains.patch

___
Python tracker 

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



[issue43213] Shortcut for checking if PurePath object contains str

2021-02-12 Thread Tomas Gustavsson


New submission from Tomas Gustavsson :

While using pathlib I realised there are situations where I easily want to 
check if part of a returned path object contains a particular given path (as a 
string).

Today the following will give an error:
...
path = PosixPath('/usr/share/doc/')
if 'share' in path:
print('Do something')

The patch will make the example above work and will open up for a simple 
shortcut.

This is my first attempt to contribute, all opinions are very welcome.

I have also pushed the commit to my own branch 
https://github.com/tomplast/cpython/tree/implement-path-contains.

--
components: Library (Lib)
messages: 386904
nosy: tomplast
priority: normal
severity: normal
status: open
title: Shortcut for checking if  PurePath object contains str
versions: Python 3.10

___
Python tracker 

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



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2021-02-12 Thread Ken Jin


Ken Jin  added the comment:

Hi Guido, after a month of observing how people stumbled over the related 
collections.abc.Callable bugs, and experience from implementing this PEP, I 
learnt a few things which I think may interest you:

Previously it was *recommended* that everything in typing be hashable. I would 
now say it is *required*. Union uses sets to de-duplicate arguments, and 
Optional uses Union internally. Both blow up if things aren't hashable. A 
surprising number of people caught the collections.abc.Callable bug because 
Optional[Callable[.]] failed.

Going forward, future PEPs to typing.py probably need to ensure their 
implementations are hashable, or risk not working with some of the types in the 
module itself. Alternatively, they can always change the implementations of 
Union and Optional, though I don't know if I recommend that ;).

Thanks for your time.

--

___
Python tracker 

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



[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2021-02-12 Thread Richie Thomas


Richie Thomas  added the comment:

That works for me. Thank you!

On Fri, Feb 12, 2021 at 11:12 PM Dustin Rodrigues 
wrote:

>
> Dustin Rodrigues  added the comment:
>
> You'll probably need to contact the pyenv project (
> https://github.com/pyenv/pyenv) if the following doesn't work for you.
> However, doing something like
>
> CFLAGS="-I$(brew --prefix)/include" CPPFLAGS="-I$(brew --prefix)/include"
> LDFLAGS="-L$(brew --prefix)/lib" pyenv install 3.9.1
>
> is working for me to use the lzma module if you already have xz installed
> with Homebrew.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2021-02-12 Thread Dustin Rodrigues


Dustin Rodrigues  added the comment:

You'll probably need to contact the pyenv project 
(https://github.com/pyenv/pyenv) if the following doesn't work for you. 
However, doing something like 

CFLAGS="-I$(brew --prefix)/include" CPPFLAGS="-I$(brew --prefix)/include" 
LDFLAGS="-L$(brew --prefix)/lib" pyenv install 3.9.1

is working for me to use the lzma module if you already have xz installed with 
Homebrew.

--

___
Python tracker 

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



[issue8264] [doc] hasattr doesn't show private (double underscore) attributes exist

2021-02-12 Thread Ken Jin


Ken Jin  added the comment:

Thanks for merging this Ethan! I think we can close this now (unless you want 
me to backport this to 3.9 and 3.8 as well).

--

___
Python tracker 

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



[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2021-02-12 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

As of June last year, Python 3.7 is in security fix only mode, so there's 
nothing more to be done here.

--
nosy: +jaraco
resolution:  -> fixed
stage: patch review -> 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



Re: New Python implementation

2021-02-12 Thread Alan Gauld via Python-list
On 12/02/2021 21:46, Mr Flibble wrote:

> The neos Python implementation will consist of a schema file 
> which describes the language plus any Python-specific semantic concepts

So the schema file is some kind of formal grammar definition of
the language?

And you "compile" this directly into machine code?
Is that the idea?

So when you say you have a universal compiler for any language
what you mean is that you can produce a compiler/interpreter
for any language from a language definition/schema. Is that it?

I'm still not sure I understand what exactly you are proposing
to do. What the final output looks like?

I'm assuming it's a new executable interpreter that can run any
valid python code. Is that correct?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


-- 
https://mail.python.org/mailman/listinfo/python-list


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

2021-02-12 Thread Eryk Sun


Change by Eryk Sun :


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



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

2021-02-12 Thread Eryk Sun


Eryk Sun  added the comment:

> and it happens that "pkg" is found in a folder that is 
> given in sys.path as a relative path

I'd prefer that Python disallowed relative paths in sys.path [1]. But since 
they're allowed, I think importlib at least could try to resolve relative paths 
in a copy of sys.path before searching. 

> as of 3.8 the current directory is removed from the search path, 
> so the .pyd is never found

It happens to work prior to 3.8 even though the load uses the flag 
LOAD_WITH_ALTERED_SEARCH_PATH, for which it's documented that "[i]f this value 
is used and lpFileName specifies a relative path, the behavior is undefined". 

The implemented behavior with LOAD_WITH_ALTERED_SEARCH_PATH is that the 
directory of the given DLL filename is added to the head of the DLL search 
path, even though it's a relative path. Then the DLL filename is searched for 
like any other relative filename. 

For example, loading r"foo\spam.pyd" will try to load r"foo\foo\spam.pyd" (note 
the double "foo"), r"C:\Windows\System32\foo\spam.pyd", 
r"C:\Windows\System\foo\spam.pyd", r"C:\Windows\foo\spam.pyd", and so on. If 
the current working directory (i.e. ".") is in the DLL search path, and 
r"foo\spam.pyd" isn't accidentally found relative to a directory that's 
searched before ".", then the loader will find r".\foo\spam.pyd". Fortunately 
another thread can't change the working directory while the loader is 
searching, since the PEB lock is held. If r"foo\spam.pyd" is found and it 
depends on "eggs.dll", the loader will look for it first in the DLL directory, 
i.e. as r"foo\eggs.dll".

The implicit inclusion of the working directory can be disabled or replaced 
with another directory via SetDllDirectoryW(), in which case the working 
directory will only be checked if %PATH% contains a "." entry. If it's replaced 
with another directory, then it's even inheritable from a SetDllDirectoryW() 
call in an ancestor process.

3.8+ uses the flag LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, which requires the DLL 
filename to be a fully-qualified path.

---
[1] That includes the "" entry in sys.path in the interactive shell. I wish it 
was implemented to resolve the working directory at startup instead of letting 
the entry vary with the current working directory.

--
nosy: +brett.cannon, eryksun

___
Python tracker 

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



[issue43142] Do not add duplicate FDs to list in duplicate_for_child()

2021-02-12 Thread Sanchit


Sanchit  added the comment:

But can you please add this fix in versions 3.8 & beyond?
Thanks!

From: report=bugs.python@roundup.psfhosted.org 
 on behalf of Terry J. Reedy 

Sent: Friday, February 12, 2021 3:43 PM
To: SANCHIT JAIN 
Subject: [issue43142] Do not add duplicate FDs to list in duplicate_for_child()

Terry J. Reedy  added the comment:

3.7 and before only get security fixes.

--
nosy: +davin, pitrou, terry.reedy
versions:  -Python 3.6, Python 3.7

___
Python tracker 

___

--

___
Python tracker 

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



[issue43185] AssertRaises() causes core dump in handling recursion

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#43185 has other recursive code that has a 'fatal Python error' in 3.9 and 
recovers in 3.10.  Am closing it in favor of this.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2021-02-12 Thread Richie Thomas


Richie Thomas  added the comment:

Hello, can you give me a few more details around the workaround for this. I am 
using pyenv to install 3.9.1 and not sure how I would include the xz installed 
using homebrew. Where do I find the setup.py or configure command? Thanks for 
the help!

--
nosy: +richiejthomas

___
Python tracker 

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



[issue43182] TURTLE: Default values for basic Turtle commands

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Enhancements only go in future versions.

--
nosy: +terry.reedy
versions:  -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



[issue43177] How to use `long double` as a PyObject?

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

You immediate questions are answered.  Adding 128 bit floats to Python itself 
need a discussion on python-ideas and very likely a PEP.  Maybe a decade?

--
nosy: +terry.reedy
resolution:  -> postponed
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



[issue38593] Python 3.7 does not catch infinite recursion for some values of sys.getrecursionlimit()

2021-02-12 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue43154] code.InteractiveConsole can crash if sys.excepthook is broken

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

unraiseable hook is not needed.  The REPL does:

>>> sys.excepthook = lambda: None
>>> 1/0
Error in sys.excepthook:
TypeError: () takes 0 positional arguments but 3 were given

Original exception was:
Traceback (most recent call last):
  File "", line 1, in 
ZeroDivisionError: division by zero
>>> (no crash)


code.Console in the REPL currently does:

>>> import sys
>>> sys.excepthook = 1
>>> arsdfsd
Error in sys.excepthook:
TypeError: 'int' object is not callable

Original exception was:
Traceback (most recent call last):
  File "F:\dev\3x\lib\code.py", line 90, in runcode
exec(code, self.locals)
  File "", line 1, in 
NameError: name 'arsdfsd' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "F:\dev\3x\lib\code.py", line 301, in interact
console.interact(banner, exitmsg)
  File "F:\dev\3x\lib\code.py", line 232, in interact
more = self.push(line)
  File "F:\dev\3x\lib\code.py", line 258, in push
more = self.runsource(source, self.filename)
  File "F:\dev\3x\lib\code.py", line 74, in runsource
self.runcode(code)
  File "F:\dev\3x\lib\code.py", line 94, in runcode
self.showtraceback()
  File "F:\dev\3x\lib\code.py", line 148, in showtraceback
sys.excepthook(ei[0], ei[1], last_tb)
TypeError: 'int' object is not callable
>>> (code console crashes, evidenced by 'sys' not recognized
--
IDLE in its normal 2-process mode, since 3 weeks ago, does:

>>> sys.excepthook = lambda: None
>>> 1/0
Traceback (most recent call last):
  File "", line 1, in 
1/0
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Programs\Python310\lib\idlelib\run.py", line 576, in runcode
sys.excepthook(*self.user_exc_info)
TypeError: () takes 0 positional arguments but 3 were given
>>> (no crash)

In IDLE's 1-process mode, selected with -n command line option, the hook 
exception has several IDLE specific lines added, as with the code exception.  A 
return or two is needed to get >>> back.


In any case, both the immediate code exception and the defective hook exception 
are printed.  The recent patch to IDLE, PR-24302, was to replace 
'print_exception()' (ignoring excepthook) with

if sys.excepthook is sys.__excepthook__:
print_exception()
else:
try:
sys.excepthook(*self.user_exc_info)
except:
print_exception()

I suggest that the code line 148, call to sys.excepthook be wrapped similarly 
(adjusted to write the lines if sys.excepthook fails).

IDLE's exception order is determine by the default context annotation.  I don't 
know what the REPL does to change the output, but I prefer the default.  I will 
prepare a PR.

code tests are in test.test_code_module because test_code tests code objects.

--
nosy: +terry.reedy
stage:  -> test needed
type:  -> behavior
versions: +Python 3.10

___
Python tracker 

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



[issue10794] Infinite recursion while garbage collecting loops indefinitely

2021-02-12 Thread Irit Katriel


Irit Katriel  added the comment:

I think this issue is out of date.

For Mihai's example I get:

>>> class A(object):
...   def __init__(self):
... raise Exception('init error')
... self.m = 'Hello world'
...   def __del__(self):
... #raise RuntimeError('my runtime error')
... self.__del__()
...
>>> def func():
...   h = A()
...
>>> func()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in func
  File "", line 3, in __init__
Exception: init error
>>>



For Amaury's first example I get what I expect:


>>> class A:
... def close(self):
... self.close()
... def __del__(self):
... self.close()
...
>>> class A:
... def close(self):
... self.close()
... def __del__(self):
... self.close()
...
>>> def func():
...   h = A()
...
>>> func()
Exception ignored in: 
Traceback (most recent call last):
  File "", line 5, in __del__
  File "", line 3, in close
  File "", line 3, in close
  File "", line 3, in close
  [Previous line repeated 994 more times]
RecursionError: maximum recursion depth exceeded
>>>


And for Amaury's trashcan example (even when I increase the list length to well 
over the trashcan threshold): 

>>> class C:
... def __del__(self):
... print('.')
... x = self
... for i in range(49):# PyTrash_UNWIND_LEVEL-1
... x = [x]
...
>>> l = [C()]
>>> del l
.
>>> class C:
...  def __del__(self):
...  print('.')
...  x = self
...  for i in range(5000):
... x = [x]
...
>>> l = [C()]
>>> del l
.
>>>

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

___
Python tracker 

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



[issue18163] Add a 'key' attribute to KeyError

2021-02-12 Thread Stéphane Blondon

Stéphane Blondon  added the comment:

I'm interested by such feature.

I see examples of versions of the message provided by KeyError:
- sometimes with a message (for example `PyErr_SetString(PyExc_KeyError, "name 
too long");` at [1])
- sometimes with the missing key (for example `PyErr_SetObject(PyExc_KeyError, 
key);` at [2])

It explains why there is a difference in the messages in KeyError (as said in 
previous messages).

PyErr_SetString(), PyErr_Format(), PyErr_FormatV() (implemented in 
Python/errors.c) don't have a parameter to set the missing key. So I think it 
would be easier to set the missing attribute before calling thoses functions.


According to [3], the C PyExc_KeyError matches the Python KeyError exception.

So I think to:
- Add a 'missing_key' attribute to KeyError_str (in [4])
- Add the missing key to PyExc_KeyError instance before the call of 
PyErr_SetString(), PyErr_SetObject(), etc.

Do you think such strategy is doable?
What do you think about it? Is it the way you think about it? If not, do you 
have some hint?


I already made some minor patches to cpython but only in the Python part, never 
in C one.


1: https://github.com/python/cpython/blob/master/Modules/unicodedata.c#L1398
2: https://github.com/python/cpython/blob/master/Python/hamt.c#L2767
3: 
https://docs.python.org/3/c-api/exceptions.html?highlight=pyerr_format#standard-exceptions
4: https://github.com/python/cpython/blob/master/Objects/exceptions.c#L1569

--

___
Python tracker 

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



[issue43212] Link to class and function source code on GitHub

2021-02-12 Thread Борис Верховский

New submission from Борис Верховский :

We can use shpinx.ext.linkcode to link classes and functions/methods to their 
source code on GitHub from the documentation. See linked PR for screen shots. 
This is far from linking all the symbols in the docs, but it's gets quite a 
few. It would be hard to get to 100% because of C modules that get re-exported 
in Python files.

It slighty increase the time it takes to generate the documentation with `make 
html`. I get 1m33s with these changes vs 1m28s without them.

One thing is that when you merge a PR on GitHub, any files it touches will have 
the wrong line numbers while the documentation is being re-built and deployed. 
That's mostly neglible since most files haven't been edited in the last couple 
of minutes, but if it's an issue it may be possible to set up the CI to build 
the documentation then deploy the docs and merge the PR at the same time.

--
assignee: docs@python
components: Documentation
messages: 386889
nosy: boris, docs@python
priority: normal
pull_requests: 23306
severity: normal
status: open
title: Link to class and function source code on GitHub
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue43139] test_ttk test_compound and test_tk test_type fails with Tk 8.6.11.1

2021-02-12 Thread Felix Yan


Felix Yan  added the comment:

It's Arch Linux x86_64 with system tcl/tk. It's build in a clean chroot for 
packaging and always reproducible.

--

___
Python tracker 

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



[issue43208] Ctypes._FuncPtr.restype doesn't handle NoneType correctly

2021-02-12 Thread Eryk Sun


Eryk Sun  added the comment:

NoneType would have to be replaced with None in make_funcptrtype_dict() and 
PyCFuncPtr_set_restype() in Modules/_ctypes/_ctypes.c. In the C API, NoneType 
is (PyObject *)&_PyNone_Type.

--
nosy: +eryksun

___
Python tracker 

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



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

2021-02-12 Thread Steve Dower


Change by Steve Dower :


--
components: +Windows
nosy: +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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-12 Thread Irit Katriel


Irit Katriel  added the comment:

In 3.9 you had to give exc,val,tb. In 3.10 the shortcut was added. Issue 26389.

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

It seems to me that print_exception(None), etc, *should* raise something.  
Printing "NoneType: None\n" makes no sense to me since NoneType is not an 
exception.  In 3.9, it raised TypeError for # of arguments.

I do note that in 3.9
>>> traceback.print_exception(None, None, None)
NoneType: None

I wonder what the rationale was.  It isn't because these functions never raise.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26389] Expand traceback module API to accept just an exception as an argument

2021-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue43140] built-in open() doesn't use locale.getpreferredencoding() as the default encoding

2021-02-12 Thread Eryk Sun


Eryk Sun  added the comment:

> If my understanding is right, the open() will invoke 
> locale.getpreferredencoding() by setting the do_setlocale=False 
> -- i.e. locale.getpreferredencoding(False) -- to avoid invoking 
> setlocale(LC_CTYPE, "").

Yes, that's the case in POSIX systems. With do_setlocale=False, 
getpreferredencoding() gets the current locale's LC_CTYPE codeset via 
nl_langinfo(CODESET). This is thread safe, whereas calling setlocale(LC_CTYPE, 
"") beforehand is not thread safe.

In Windows, locale.getpreferredencoding() always returns the encoding of the 
default locale, regardless of do_setlocale. It's needlessly inconsistent with 
POSIX.

> are you suggesting that this should be closed as 'Not a bug'?

Sorry, Terry. I forgot to close the issue.

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

___
Python tracker 

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



[issue43145] Leak of locks from multiprocessing.Process

2021-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue43144] test_unicodedata: test_normalization uses network but doesn't depend on network resource

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

After a week without response, I consider making a PR open to anyone.  Whoever 
should add "Original patch by ..." in the message part.
The patch is obvious enough that I would be willing to merge if no one else.

--
keywords: +easy
nosy: +terry.reedy

___
Python tracker 

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



[issue43211] Python is not responding after running program

2021-02-12 Thread Diasy Barrett


Change by Diasy Barrett :


Added file: https://bugs.python.org/file49805/Screen Shot 2021-02-12 at 
23.56.46.png

___
Python tracker 

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



[issue43211] Python is not responding after running program

2021-02-12 Thread Diasy Barrett


New submission from Diasy Barrett :

Good day all
I am very new to Python programming so forgive me.

The Python application is not responding after I run my program.

--
components: macOS
files: Screen Shot 2021-02-12 at 23.55.56.png
messages: 386882
nosy: diasybarrett, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python is not responding after running program
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49804/Screen Shot 2021-02-12 at 
23.55.56.png

___
Python tracker 

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



Re: New Python implementation

2021-02-12 Thread Mr Flibble

On 12/02/2021 00:15, Alan Gauld wrote:

On 11/02/2021 12:30, Mr Flibble wrote:


I am starting work on creating a new Python implementation
from scratch using "neos" my universal compiler that can
compile any programming language.


Can i clarify that?
Are you saying that you are going to recompile the existing
C code for pyhton using yoour universal compiler and the
resulting binary file will be a new implementation of
the interpreter that you expect to be faster?


Nope.



That's what it sounds like to me.
In which case the question is not whether you can write a
better interpreter than CPython but whether you can write
a better compiler than GNU/MING/VC etc


See previous answer.



While a universal compiler is  certainly an interesting
and challenging project I'm not sure how much it tells us
about existing Python implementations.


The two things are unrelated; however it is well known that Python is slow.



On the other hand, if you are planning on rewriting the
existing interpreter in something other than C, what
is that something?


Nope.




Sample neos session (parsing a fibonacci program,
neoscript rather than Python in this case):


I'm not sure what relevance this has unless you want
to rewrite Python in neoscript? Or are you translating
the C into neoscript and then compiling it? But in a
later response you seem to say neoscript was not involved?

Slightly confused...



The neos Python implementation will consist of a schema file which describes 
the language plus any Python-specific semantic concepts that don't generalize 
to more than one language.

/Flibble

--

--
https://mail.python.org/mailman/listinfo/python-list


Re: New Python implementation

2021-02-12 Thread Mr Flibble

On 12/02/2021 02:45, Terry Reedy wrote:

On 2/11/2021 5:33 PM, Mr Flibble wrote:

On 11/02/2021 22:25, Dan Stromberg wrote:

On Thu, Feb 11, 2021 at 2:00 PM Mr Flibble 
wrote:


On 11/02/2021 21:13, Dan Stromberg wrote:

Does your project have a name yet?  I'd like to follow it through google
alerts or an announcement mailing list.


"neos" - https://neos.dev/ https://github.com/i42output/neos



Pypi already appears to have another project named neos:
https://pypi.org/project/neos/


neos isn't a Python package so that isn't a problem.


Since it obviously is a Python package, as in importable into a Python program, 
why do you deny it?


You are mistaken: it isn't a Python package and it isn't importable into a 
Python program.

/Flibble

--

--
https://mail.python.org/mailman/listinfo/python-list


[issue43141] `asdict` fails with frozen dataclass keys, using raw dict form

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On freshly compiled master on Win10, the example code gives "TypeError: 
unhashable type: 'dict'".

--
nosy: +terry.reedy
title: `asdict` fails with frozen dataclass keys; tries to use raw dict form as 
key -> `asdict` fails with frozen dataclass keys, using raw dict form
versions: +Python 3.10

___
Python tracker 

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



[issue43142] Do not add duplicate FDs to list in duplicate_for_child()

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

3.7 and before only get security fixes.

--
nosy: +davin, pitrou, terry.reedy
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



PSYCOPG2

2021-02-12 Thread Tony Ogilvie
I am trying to write a program to open a PostgesSQL 13 database using
psycopg2. All seems to work if I write direct to Python but if I write the
script into IDLE it does not work with the IDLE Shell 3.9.1 reporting an
error of no attribute 'connect'.

 

I have tried many options to try and get this to work.

 

Regards

 

Tony

 

 



 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: super() in injected methods

2021-02-12 Thread Alan Gauld via Python-list
On 12/02/2021 02:39, Andras Tantos wrote:

> 1. Ports, which are the connection points on the various netlist 
> entities. These would be the inputs and outputs of an AND gate for example
> 
> 2. NetTypes, which describe the type of data that can travel through a 
> net (and thus through a Port). One such type would be an 8-bit signed 
> integer, or a simple logic signal.

> 2. A (derived) Port instance has a member of a (derived) NetType instance

Sounds like the right solution.

> Now, when a Port gets assigned a NetType, it needs to gain all sorts of 
> new features. It for example should have a 'length' attribute that tells 
> how many bits are needed to represent its possible values. The list of 
> these new features (attributes, methods, properties) are known to the 
> NetType and should be injected into the Port when the NetType is 
> assigned to the Port.

So aren't these operations of the type rather than the port.
If you expose the type the users can message it directly.

n = myport.type.length()

Keep the responsibility with the object that owns them.
Creating a facade over another object is sometimes useful
but a dynamic facade sounds like trouble. Client code is
going to have to know which methods exist and when.
Can you ever change the type? What happens to the injected
methods, do you need to remove them and replace them
with others?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: mutating a deque whilst iterating over it

2021-02-12 Thread Terry Reedy

On 2/11/2021 3:22 PM, duncan smith wrote:


   It seems that I can mutate a deque while iterating over it if I
assign to an index, but not if I append to it. Is this the intended
behaviour?


Does the deque doc say anything about mutation while iterating? 
(Knowing the author of deque, I would consider everything about it 
intentional without *good* reason to think otherwise.



from collections import deque
d = deque(range(8))
it = iter(d)
next(it)

0

d[1] = 78


This does not change the structure of the deque, so next does not 
notice.  It could be considered not be a mutation.  It could be detected 
by changing deque.__setitem__, but why bother and slow down all 
__setitem__ calls.



next(it)

78

d.append(8)


This changes the structure, which can apparently mess-up iteration.


next(it)

Traceback (most recent call last):
   File "", line 1, in 
 next(it)
RuntimeError: deque mutated during iteration





--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: New Python implementation

2021-02-12 Thread Terry Reedy

On 2/11/2021 5:33 PM, Mr Flibble wrote:

On 11/02/2021 22:25, Dan Stromberg wrote:
On Thu, Feb 11, 2021 at 2:00 PM Mr Flibble 


wrote:


On 11/02/2021 21:13, Dan Stromberg wrote:
Does your project have a name yet?  I'd like to follow it through 
google

alerts or an announcement mailing list.


"neos" - https://neos.dev/ https://github.com/i42output/neos



Pypi already appears to have another project named neos:
https://pypi.org/project/neos/


neos isn't a Python package so that isn't a problem.


Since it obviously is a Python package, as in importable into a Python 
program, why do you deny it?


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: @unittest.skip doesn't print anything in Python <= 3.7

2021-02-12 Thread Terry Reedy

On 2/11/2021 3:25 PM, אורי wrote:

Hi,

https://stackoverflow.com/questions/66161394/unittest-skip-doesnt-print-anything-in-python-3-7

We are using Django with unittest. Some tests are skipped with the
@unittest.skip decorator. But if I run the tests with Python 3.6 or 3.7, I
get a number of tests passed (Ran 993 tests / OK), and if I run the same
tests with Python 3.8, I get the same number of tests but with some tests
skipped (Ran 993 tests / OK (skipped=4)).


...


I think the skipped tests are skipped in all Python versions, but in Python
3.6 and 3.7 there is no output about them being skipped. Is it a bug?


Perhaps you have discover a bug in 3.7 that was fixed in 3.8.  Each new 
version comes with a few hundred bug fixes, not just the new features, 
although only the latter are featured in the new version announcement.


If you are really concerned, find What's New in 3.8 and look changelog, 
linked in the first paragraph, for 'unittest' issues.


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: New Python implementation

2021-02-12 Thread Alan Gauld via Python-list
On 11/02/2021 12:30, Mr Flibble wrote:

> I am starting work on creating a new Python implementation 
> from scratch using "neos" my universal compiler that can 
> compile any programming language.  

Can i clarify that?
Are you saying that you are going to recompile the existing
C code for pyhton using yoour universal compiler and the
resulting binary file will be a new implementation of
the interpreter that you expect to be faster?

That's what it sounds like to me.
In which case the question is not whether you can write a
better interpreter than CPython but whether you can write
a better compiler than GNU/MING/VC etc

While a universal compiler is  certainly an interesting
and challenging project I'm not sure how much it tells us
about existing Python implementations.

On the other hand, if you are planning on rewriting the
existing interpreter in something other than C, what
is that something?

> Sample neos session (parsing a fibonacci program, 
> neoscript rather than Python in this case):

I'm not sure what relevance this has unless you want
to rewrite Python in neoscript? Or are you translating
the C into neoscript and then compiling it? But in a
later response you seem to say neoscript was not involved?

Slightly confused...

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43140] built-in open() doesn't use locale.getpreferredencoding() as the default encoding

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Eryk, are you suggesting that this should be closed as 'Not a bug'?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue43139] test_ttk test_compound and test_tk test_type fails with Tk 8.6.11.1

2021-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

When system? It appears to be some *nix.  Is this a buildbot?
Whose tcl/tk?  Distributed with system or locally compiled?

--
nosy: +serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue43139] test_ttk test_compound and test_tk test_type fails with Tk 8.6.11.1

2021-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +Tkinter

___
Python tracker 

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



[issue43210] Fix inaccurate byteswap comment in sha512module.c

2021-02-12 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Introduced by 1ae035b7e847064d09df01ca62b8a761e9b5aae3

--

___
Python tracker 

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



[issue43172] Fix test_readline when compiled using --with-readline=edit

2021-02-12 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue43172] Fix test_readline when compiled using --with-readline=edit

2021-02-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset fd053fdd39fbdf114b4218ea4309666bafa95788 by Gregory P. Smith in 
branch 'master':
bpo-43172: readline now passes its tests when built against libedit (GH-24499)
https://github.com/python/cpython/commit/fd053fdd39fbdf114b4218ea4309666bafa95788


--

___
Python tracker 

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



[issue19094] urljoin should raise a TypeError if URL is not a string

2021-02-12 Thread Irit Katriel


Irit Katriel  added the comment:

Still broken in 3.10:

Running Release|x64 interpreter...
Python 3.10.0a5+ (heads/master:bf2e7e55d7, Feb 11 2021, 23:09:25) [MSC v.1928 
64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.parse
>>> urllib.parse.urljoin('foo', [])
'foo'
>>>

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue43210] Fix inaccurate byteswap comment in sha512module.c

2021-02-12 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
title: Fix inaccurate byteswap comment in sha512.module.c -> Fix inaccurate 
byteswap comment in sha512module.c

___
Python tracker 

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



[issue43205] Python Turtle Colour

2021-02-12 Thread Vedran Čačić

Vedran Čačić  added the comment:

It is just a matter of a different (though not very different) language. As 
such, it is a duplicate of https://bugs.python.org/issue24990.

--
nosy: +veky

___
Python tracker 

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



[issue43210] Fix inaccurate byteswap comment in sha512.module.c

2021-02-12 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue43210] Fix inaccurate byteswap comment in sha512.module.c

2021-02-12 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Include/internal/pycore_bitutils.h is included bco. _Py_bswap64(), not 
_Py_bswap32().

--
components: Library (Lib)
messages: 386873
nosy: christian.heimes, erlendaasland
priority: normal
severity: normal
status: open
title: Fix inaccurate byteswap comment in sha512.module.c
versions: Python 3.10

___
Python tracker 

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



[issue43209] system cannot find the file specified in subprocess.py

2021-02-12 Thread Steve Dower


Steve Dower  added the comment:

This line won't work on Windows: shell.run("rm -rf .cache".split(), 
cwd=repository)

You should probably use shutil.rmtree(".cache") instead if you want it 
to be cross platform.

--

___
Python tracker 

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



[issue30799] Improved test coverage Lib/_osx_support.py 99%

2021-02-12 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
components: +macOS

___
Python tracker 

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



[issue43209] system cannot find the file specified in subprocess.py

2021-02-12 Thread robert j richardson


New submission from robert j richardson :

When using >python synth.py in the directory 
google-api-java-client-services-master
python returns:
synthtool > Cloning 
https://github.com/googleapis/discovery-artifact-manager.git.
synthtool > Cleaning output directory.
Traceback (most recent call last):
  File "D:\google-api-java-client-services-master\synth.py", line 47, in 

shell.run("rm -rf .cache".split(), cwd=repository)
  File 
"C:\Users\rober\AppData\Local\Programs\Python\Python39\lib\site-packages\synthtool\shell.py",
 line 27, in run
return subprocess.run(
  File 
"C:\Users\rober\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 
501, in run
with Popen(*popenargs, **kwargs) as process:
  File 
"C:\Users\rober\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 
947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
  File 
"C:\Users\rober\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 
1416, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

--
components: Windows
messages: 386871
nosy: paul.moore, robertjrichardson, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: system cannot find the file specified in subprocess.py
type: behavior
versions: Python 3.9

___
Python tracker 

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



Re: super() in injected methods

2021-02-12 Thread Andras Tantos


On 2/11/21 10:35 PM, Greg Ewing wrote:

On 12/02/21 3:39 pm, Andras Tantos wrote:
Now, when a Port gets assigned a NetType, it needs to gain all sorts 
of new features. It for example should have a 'length' attribute that 
tells how many bits are needed to represent its possible values.


The way I would probably approach this is to have a single
Port type with all the methods that might be required, and
forward their implementations to the NetType.

e.g.

class Port:

    @property
    def length(self):
    return self.net_type.length

Another possibility might be to change the __class__ of the port
object at run time to a subclass of Port having the required
features. That would be a lot easier and more efficient than
adding individual methods to every Port instance, and super()
should work normally.

That's actually a pretty good idea, thanks! Let me turn it around in my 
head to see how to integrate it into the library.


Thanks again,
Andras


--
https://mail.python.org/mailman/listinfo/python-list


[issue43155] PyCMethod_New not defined in python3.lib

2021-02-12 Thread Petr Viktorin


Petr Viktorin  added the comment:

> Is there a test suite that checks that the limited API functions can all be 
> linked against?

Not yet. There's not even consensus about exactly what functions are part of 
the limited API.
I plan to address both issues in PEP 652 (currently in Draft status).

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue43203] Default value incorrectly read with unittests on Windows & macOS but not Linux

2021-02-12 Thread Steve Dower


Steve Dower  added the comment:

I'm afraid there's nowhere near enough context in your post for us to look into 
this.

Can you provide some code that you think *should* work but does not? Ideally in 
a post (as in, it should be that short) or as an attachment?

--

___
Python tracker 

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



[issue43206] Optional parameter got passed even when not in the call

2021-02-12 Thread Abhilash Jindal


Abhilash Jindal  added the comment:

Aah TIL. Thanks.

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

___
Python tracker 

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



[issue43207] InspectLoader.is_package is not an abstract method

2021-02-12 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue43208] Ctypes._FuncPtr.restype doesn't handle NoneType correctly

2021-02-12 Thread Thijs Miedema


New submission from Thijs Miedema :

When setting the restype of a ctypes._FuncPtr you can use None to indicate a 
void function. However, I use inspect.signature to dynamically bind python 
functions to a DLL, and that doesn't return None but NoneType if the type hint 
return type is None starting at python 3.10.

This change caused me to set the restype to NoneType, which makes ctypes cause 
a cryptic "TypeError: NoneType takes no arguments" upon returning from a 
successfully executed C function. 

The included example demonstrates the differing results from inspect, a working 
example, a failing example and an example that works in 3.9 but fails in 3.10.

Proposed solution: Treat NoneType as None for ctypes._FuncPtr.restype

--
components: ctypes
files: minimal_example_ctypes_nonetype_behaviour.py
messages: 386867
nosy: thijsmiedema94
priority: normal
severity: normal
status: open
title: Ctypes._FuncPtr.restype doesn't handle NoneType correctly
type: behavior
versions: Python 3.10
Added file: 
https://bugs.python.org/file49803/minimal_example_ctypes_nonetype_behaviour.py

___
Python tracker 

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



[issue43207] InspectLoader.is_package is not an abstract method

2021-02-12 Thread Jun


New submission from Jun :

In the documentation of importlib:
https://docs.python.org/3/library/importlib.html#importlib.abc.InspectLoader

It says InspectLoader.is_package is an abstract method while it is not in the 
implementation.

@abc.abstractmethod decorator was removed with this commit
https://github.com/python/cpython/commit/b523f8433a8982e10eb41a3e2b37ee0e6d6a6e00

--
assignee: docs@python
components: Documentation
messages: 386866
nosy: Jun, docs@python
priority: normal
severity: normal
status: open
title: InspectLoader.is_package is not an abstract method
versions: Python 3.10

___
Python tracker 

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



[issue43206] Optional parameter got passed even when not in the call

2021-02-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

It's hard to tell because you didn't show the whole program, but this looks 
like a mutable default argument problem. Basically you're changing the default 
value in a different call to Row().

https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects

--
nosy: +eric.smith

___
Python tracker 

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



[issue43206] Optional parameter got passed even when not in the call

2021-02-12 Thread Abhilash Jindal


New submission from Abhilash Jindal :

Seeing a very unexpected behavior. A call to __init__ method is receiving extra 
arguments not present in the caller. Following is a debugger session to 
demonstrate. Notice that "data_dict" is not being passed in the caller, yet the 
callee is receiving it!

```python
(Pdb) bt
  /Users/apple/Library/Python/3.8/bin/celery(10)()
-> sys.exit(main())
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/__main__.py(15)main()
-> sys.exit(_main())
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/bin/celery.py(213)main()
-> return celery(auto_envvar_prefix="CELERY")
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/click/core.py(829)__call__()
-> return self.main(*args, **kwargs)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/click/core.py(782)main()
-> rv = self.invoke(ctx)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/click/core.py(1259)invoke()
-> return _process_result(sub_ctx.command.invoke(sub_ctx))
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/click/core.py(1066)invoke()
-> return ctx.invoke(self.callback, **ctx.params)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/click/core.py(610)invoke()
-> return callback(*args, **kwargs)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/click/decorators.py(21)new_func()
-> return f(get_current_context(), *args, **kwargs)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/bin/base.py(132)caller()
-> return f(ctx, *args, **kwargs)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/bin/worker.py(327)worker()
-> worker.start()
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/worker/worker.py(203)start()
-> self.blueprint.start(self)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/bootsteps.py(116)start()
-> step.start(parent)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/bootsteps.py(365)start()
-> return self.obj.start()
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/concurrency/base.py(129)start()
-> self.on_start()
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/concurrency/prefork.py(107)on_start()
-> P = self._pool = Pool(processes=self.limit,
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/concurrency/asynpool.py(460)__init__()
-> super().__init__(processes, *args, **kwargs)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/pool.py(1046)__init__()
-> self._create_worker_process(i)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/concurrency/asynpool.py(477)_create_worker_process()
-> return super()._create_worker_process(i)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/pool.py(1158)_create_worker_process()
-> w.start()
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/process.py(124)start()
-> self._popen = self._Popen(self)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/context.py(333)_Popen()
-> return Popen(process_obj)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/popen_fork.py(24)__init__()
-> self._launch(process_obj)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/popen_fork.py(79)_launch()
-> code = process_obj._bootstrap()
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/process.py(327)_bootstrap()
-> self.run()
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/process.py(114)run()
-> self._target(*self._args, **self._kwargs)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/pool.py(292)__call__()
-> sys.exit(self.workloop(pid=pid))
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/billiard/pool.py(362)workloop()
-> result = (True, prepare_result(fun(*args, **kwargs)))
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/app/trace.py(580)_trace_task_ret()
-> R, I, T, Rstr = trace_task(app.tasks[name],
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/app/trace.py(536)trace_task()
-> return task.__trace__(uuid, args, kwargs, request)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/app/trace.py(405)trace_task()
-> R = retval = fun(*args, **kwargs)
  
/Users/apple/Library/Python/3.8/lib/python/site-packages/celery/app/trace.py(697)__protected_call__()
-> return self.run(*args, **kwargs)
  /Users/apple/Documents/research/hint/code/scope/core/nodes.py(23)process()
-> processor(idx)
  /Users/apple/Documents/research/hint/code/scope/core/nodes.py(96)__call__()
-> k = next(iter(self.named_in_edges))
> /Users/apple/Documents/research/hint/code/scope/examples/word_count.py(55)__call__()
-> out_row = Row(node_name, self.schema, from_rows=[input_row])
  /Users/apple/Documents/research/hint/code/scope/model/row.py(21)__init__()
-> self.lnode_name = lnode_name
(Pdb) l.
 50 def __call__(self, input_row: Row, 

ANN: Blue 0.6.0 Released

2021-02-12 Thread Grant Jenks
Announcing the release of Blue version 0.6.0!

2021-02-11 (0.6.0)
==

* Preserve the whitespace before the hash mark for right hanging
  comments. (GH#20)

* Support multiple config files: pyproject.toml, setup.cfg, tox.ini, and .blue
  (GH#30)

* Fixed blue --version (GH#32)

* Added tests!



Blue


Some folks like `black `_ but I
prefer `blue `_.


What is blue?
=

``blue`` is a somewhat less uncompromising code formatter than ``black``, the
OG of Python formatters.  We love the idea of automatically formatting Python
code, for the same reasons that inspired ``black``, however we take issue with
some of the decisions ``black`` makes.  Kudos to ``black`` for pioneering code
formatting for Python, and for its excellent implementation.

Where the ``blue`` maintainers disagree with the stylistic (and
unconfigurable) choices made by ``black``, we monkeypatch to change these
decisions to our own liking.  We intend for these differences to be minimal;
even in cases where we'd prefer something different, there's a lot we can live
with for the sake of consistency.

We'd prefer not to fork or monkeypatch.  Instead, our hope is that eventually
we'll be able to work with the ``black`` maintainers to add just a little bit
of configuration and merge back into the ``black`` project.  We'd be ecstatic
if ``blue`` eventually were retired.  Until then, we'll maintain our small set
of hacks on top of ``black`` and carefully consider what other deviations are
needed to assuage our sensitive, but experienced, eye.


How do I use blue?
==

Exactly the same as you would use ``black``.  Invoke and configure ``blue`` as
you would ``black`` -- just replace the ``black`` command with ``blue``, sit
back, and enjoy even betterly formatted Python code!  You can refer to
`black's `_ documentation for
anything not listed here.


So what's different?


Here is a brief list of differences between ``blue`` and ``black``:

* ``blue`` defaults to single-quoted strings.  This is probably the most
  painful ``black`` choice to our eyes, and the thing that inspired ``blue``.
  We strongly prefer using single quoted strings over double quoted strings
  for everything *except* docstrings.  Don't ask us why we prefer double
  quoted strings for docstrings; it just looks better to us!  For all other
  strings, ``blue`` defaults to single quoted strings.

* ``blue`` defaults to line lengths of 79 characters. Nearly every project
  creates a pyproject.toml just to change this one setting so making it
  consistent with PEP 8 seems relatively harmless.

* ``blue`` preserves the whitespace before the hash mark for right hanging
  comments.

* ``blue`` supports multiple config files: ``pyproject.toml``, ``setup.cfg``,
  ``tox.ini``, and ``.blue``.

We are `accumulating `_ a list of
other deviations we are considering.  As we decide to implement any particular
suggestion, we'll turn those into individual issues and tackle them
one-by-one.  If you have suggestions for other deviations from ``black``'s
choices, please open a separate ticket on our tracker, and we'll see how it
goes!


Why "blue"?
===

Several reasons!  If your formatter is going to beat up your code, it'll leave
it black and blue, or maybe in this case, black *or* blue.  Blue is better!

We also thought about "tan" because, yum!  But that project name was already
taken.  Frankly, "blue" was also taken, but largely unused.  Our thanks to
Nick Ficano for donating the project namespace to us!

Blue is also the color of `LinkedIn `_, the
authors' gracious employer, and we intend to socialize its use within our
company code base.


Contributors


``blue`` thanks this list of contributors for all its wonderful goodness.

* The `wonderful folks `_ from the
  ``black`` project.
* Grant Jenks
* Barry Warsaw
* Corey from FutureSpaceDesigns for the unofficial logo and `blue project
  merchandise `_.

``blue`` is licensed under the terms of the Apache License Version 2.0.
``black`` is `licensed `_ under the
terms of the MIT license.


Project details
===

.. image:: https://img.shields.io/badge/code%20style-blue-blue.svg
   :target: https://blue.readthedocs.io/

.. image:: https://github.com/grantjenks/blue/workflows/integration/badge.svg
   :target: 
https://github.com/grantjenks/blue/actions?query=workflow%3Aintegration

.. image:: https://github.com/grantjenks/blue/workflows/release/badge.svg
   :target: https://github.com/grantjenks/blue/actions?query=workflow%3Arelease

* Project home: https://github.com/grantjenks/blue
* Report bugs and suggestions at: 

[issue43193] Installer for All users

2021-02-12 Thread Steve Dower


Steve Dower  added the comment:

I don't think this is resolvable without either being fixed by WiX Toolset or 
us completely rewriting the installer. And they've already shown very little 
interest in fixing this.

That said, WiX Toolset was eventually funded to fix the MSI hijacking issue 
that they initially dismissed, so it could happen.

What I'd *love* to see happen is some other group take up the responsibility 
for user-friendly Python distributions. If that happened, the python.org 
installer could go back to being a trivial installer for admins, rather than 
trying to handle every user scenario perfectly (and leading to literal abuse 
and defamation towards our maintainers from "famous" people because of their 
faulty memories... okay, maybe that's just for me to get over on my own time...)

--

___
Python tracker 

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



[issue43205] Python Turtle Colour

2021-02-12 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
nosy: +gregorlingl, willingc

___
Python tracker 

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



[issue42624] sqlite3 package document mistake

2021-02-12 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

*error handling => exception emitted

--

___
Python tracker 

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



[issue42624] sqlite3 package document mistake

2021-02-12 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

... and also bpo-16379

--

___
Python tracker 

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



[issue42624] sqlite3 package document mistake

2021-02-12 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Ref. bpo-24139

--

___
Python tracker 

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



[issue42624] sqlite3 package document mistake

2021-02-12 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Exception originates from _pysqlite_seterror() in Modules/_sqlite/util.c, line 
64:
https://github.com/python/cpython/blob/master/Modules/_sqlite/util.c#L64

Error code 1 (SQLITE_ERROR, https://sqlite.org/rescode.html#error) is a generic 
sqlite3 error. Changing the default sqlite3 exception for this error code may 
not be what we want.

Anyway, we should clean up the error handling in the sqlite3 module. There are 
other inconsistencies apart from this.

--

___
Python tracker 

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



[issue43205] Python Turtle Colour

2021-02-12 Thread Mr Johnson


New submission from Mr Johnson :

An incredibly small annoyance, but as a teacher in the UK, using the Turtle 
library to teach students how to code, I spend more time explaining that they 
should use "color" instead of "colour" then actually teaching them coding!

Would it be possible to add a duplicated function to each "color" function in 
the python turtle that uses the UK spelling, "colour"? They would behave 
exactly the same, you could have the "colour" functions just call the "color" 
function, it would just save a lot of hassle in class!

--
components: Demos and Tools
messages: 386858
nosy: Johnson.S
priority: normal
severity: normal
status: open
title: Python Turtle Colour
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue43204] Fix LibTom URL's in hashlib comments

2021-02-12 Thread miss-islington


miss-islington  added the comment:


New changeset df2197f2ec410817299f671e353c2fb0a3d61cbd by Miss Islington (bot) 
in branch '3.9':
bpo-43204: Fix LibTomCrypt URL in md5module.c and sha*module.c comments 
(GH-24507)
https://github.com/python/cpython/commit/df2197f2ec410817299f671e353c2fb0a3d61cbd


--

___
Python tracker 

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



[issue43054] What does the existence of a struct in a header file imply about the C-API

2021-02-12 Thread Mark Shannon


Mark Shannon  added the comment:

Why do you think the distinction between category 1 and 2 is not clear?

If the struct if not produced, or initialized, by an API function, then it 
cannot be accessed in the first place. If you can't access the struct in the 
first place, then you can't access its fields.

--

___
Python tracker 

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



[issue43204] Fix LibTom URL's in hashlib comments

2021-02-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23302
pull_request: https://github.com/python/cpython/pull/24515

___
Python tracker 

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



[issue43204] Fix LibTom URL's in hashlib comments

2021-02-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23303
pull_request: https://github.com/python/cpython/pull/24516

___
Python tracker 

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



[issue43204] Fix LibTom URL's in hashlib comments

2021-02-12 Thread miss-islington


miss-islington  added the comment:


New changeset 5ec7d535581bc99918e032891167a96abd224ed6 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43204: Fix LibTomCrypt URL in md5module.c and sha*module.c comments 
(GH-24507)
https://github.com/python/cpython/commit/5ec7d535581bc99918e032891167a96abd224ed6


--
nosy: +miss-islington

___
Python tracker 

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



[issue43204] Fix LibTom URL's in hashlib comments

2021-02-12 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue43204] Fix LibTom URL's in hashlib comments

2021-02-12 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

The comments in Modules/md5module.c, Modules/sha1module.c, 
Modules/sha256module.c, and Modules/sha512module.c all point to 
http://libtom.org. However the LibTom website has in fairly recent years been 
relaunched at https://libtom.net. The old URL is now used by a blog called 
"Libations Tom" and has no connection to LibTomCrypt.

--
components: Library (Lib)
messages: 386854
nosy: christian.heimes, erlendaasland
priority: normal
severity: normal
status: open
title: Fix LibTom URL's in hashlib comments
versions: Python 3.10

___
Python tracker 

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



[issue43054] What does the existence of a struct in a header file imply about the C-API

2021-02-12 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

To channel Victor: Another thing to look into is to introduce accessors for 
struct fields in category 1 and 2 so that the struct can be made private in the 
future.

The difference between category 1 and 2 is sadly not very clear cut. Anything 
defined in public headers could be used 3th-party code.

In this particular instance there is no documentation for the fields of the 
struct, which may indicate that the struct is private. However, this struct is 
used by code outside of the stdlib and there are currently no accessors that 
can replace this usage.

--
nosy: +ronaldoussoren

___
Python tracker 

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