Re: Best way to check if there is internet?

2022-02-08 Thread Abdur-Rahmaan Janhangeer
Thanks everybody for the answers. It was very enlightening. Here's my
solution:

# using rich console
def ensure_internet():
console = Console()
domains = [
'https://google.com',
'https://yahoo.com',
'https://bing.com',
'https://www.ecosia.org',
'https://www.wikipedia.org'
]
results = []
with console.status("Checking internet ...", spinner="dots"):
for domain in domains:
try:
requests.get(domain)
results.append(1)
except Exception as e:
results.append(0)
if not any(results):
print('No internet connection')
sys.exit()

gist link:
https://gist.github.com/Abdur-rahmaanJ/7917dc5ab7f5d2aa37b2723909be08f7

I think for me having the internet means ability to request urls

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

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


[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Eryk Sun


Eryk Sun  added the comment:

The venv launcher can quote the executable path either always or only when it 
contains spaces. The following is a suggestion for implementing the latter.

Before allocating `executable`, use memchr() (include ) to search the 
UTF-8 source for a space. If found, increment the character count by two. After 
allocating `executable`, add the initial quote character, and increment the 
pointer.

BOOL add_quotes = FALSE;
if (memchr(start, ' ', (size_t)len) != NULL) {
add_quotes = TRUE;
cch += 2;
}

executable = (wchar_t *)malloc(cch * sizeof(wchar_t));
if (executable == NULL) {
error(RC_NO_MEMORY, L"A memory allocation failed");
}

if (add_quotes) {
*executable++ = L'\"';
}

Later, after checking the existence via GetFileAttributesW(), add the trailing 
quote and null, and decrement the pointer:

if (GetFileAttributesW(executable) == INVALID_FILE_ATTRIBUTES) {
error(RC_NO_PYTHON, L"No Python at '%ls'", executable);
}

if (add_quotes) {
size_t n = wcslen(executable);
executable[n] = L'\"';
executable[n + 1] = L'\0';
executable--;
}

--

___
Python tracker 

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



[issue46688] Add sys.is_interned

2022-02-08 Thread Inada Naoki


Inada Naoki  added the comment:

Thank you, I can not find it because it is too old.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Add sys.isinterned()

___
Python tracker 

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



[issue46688] Add sys.is_interned

2022-02-08 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also https://bugs.python.org/issue34392

--
nosy: +xtreak

___
Python tracker 

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



[issue46688] Add sys.is_interned

2022-02-08 Thread Inada Naoki


Inada Naoki  added the comment:

I thought sys.is_interned() is needed to implement bpo-46430, but GH-30683 
looks nice to me.
I will close this issue after GH-30683 is merged.

--

___
Python tracker 

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



[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue46688] Add sys.is_interned

2022-02-08 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue46688] Add sys.is_interned

2022-02-08 Thread Inada Naoki


New submission from Inada Naoki :

deepfreeze.py needs to know the unicode object is interned.

Ref: https://bugs.python.org/issue46430

--
components: Interpreter Core
messages: 412890
nosy: methane
priority: normal
severity: normal
status: open
title: Add sys.is_interned
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



[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Eryk Sun


Eryk Sun  added the comment:

I checked the source code in PC/launcher.c process(). It turns out that 
`executable` is not getting quoted in the venv launcher case.

CreateProcessW() tries to get around this. If the command isn't quoted, it has 
a loop that consumes up to a space (or tab) and checks for an existing file 
(not a directory). If it finds a file, it rewrites the command line to quote 
the path of the file.

My test happened to work. But it's simple enough to create an example that 
fails. For example, as an elevated admin, create a file named "C:\Program". Now 
the venv launcher won't be able to execute a base interpreter that's installed 
in "C:\Program Files":

C:\Temp>echo >C:\Program

C:\Temp>"C:\Program Files\Python310\python.exe" -m venv env
Error: Command '['C:\\Temp\\env\\Scripts\\python.exe', '-Im', 
'ensurepip', '--upgrade', '--default-pip']' returned non-zero 
exit status 101.

--
priority: normal -> critical
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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

That's a question better suited to a forum such as the Users category of 
discuss.python.org, the python-l...@python.org mailing list, or StackOverflow, 
not a bug tracker issue.

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

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


German Salazar  added the comment:

So, help me understand, please. 


if I use "--enable-shared":
the build produces a rather small python executable; but, 
the build produces a dynamic library, too
and the path to the dynamic library must be included into LD_LIBRARY_PATH for 
the python executable to work correctly.

if I do NOT use "--enable-shared"
the build produces a larger python executable; and,
it does not produce a dynamic library, but
it produces an static library.
Does this mean that I do not have to worry about setting up LD_LIBRARY_PATH?

In the non-shared, static case, I thought the static library would be inside 
the executable, but, funny enough, I noticed that the python executable is 
smaller than the static library, so...I am confused. 

I would like to have 3.6, next to 3.7 and 3.8 with minimal setup, thus the 
static route.

Please advise.

--
components: +Installation
resolution: not a bug -> 
status: closed -> open
type:  -> behavior

___
Python tracker 

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



Re: Can't get iterator in the C API

2022-02-08 Thread MRAB

On 2022-02-09 01:12, Jen Kris via Python-list wrote:

I am using the Python C API to load the Gutenberg corpus from the nltk library 
and iterate through the sentences.  The Python code I am trying to replicate is:

from nltk.corpus import gutenberg
for i, fileid in enumerate(gutenberg.fileids()):
     sentences = gutenberg.sents(fileid)
     etc

where gutenberg.fileids is, of course, iterable.

I use the following C API code to import the module and get pointers:

int64_t Call_PyModule()
{
     PyObject *pModule, *pName, *pSubMod, *pFidMod, *pFidSeqIter,*pSentMod;

     pName = PyUnicode_FromString("nltk.corpus");
     pModule = PyImport_Import(pName);

     if (pModule == 0x0){
     PyErr_Print();
     return 1; }

     pSubMod = PyObject_GetAttrString(pModule, "gutenberg");
     pFidMod = PyObject_GetAttrString(pSubMod, "fileids");
     pSentMod = PyObject_GetAttrString(pSubMod, "sents");

     pFidIter = PyObject_GetIter(pFidMod);
     int ckseq_ok = PySeqIter_Check(pFidMod);
     pFidSeqIter  = PySeqIter_New(pFidMod);

     return 0;
}

pSubMod, pFidMod and pSentMod all return valid pointers, but the iterator lines 
return zero:

pFidIter = PyObject_GetIter(pFidMod);
int ckseq_ok = PySeqIter_Check(pFidMod);
pFidSeqIter  = PySeqIter_New(pFidMod);

So the C API thinks gutenberg.fileids is not iterable, but it is.  What am I 
doing wrong?

Look at your Python code. You have "gutenberg.fileids()", so the 
'fileids' attribute is not an iterable itself, but a method that you 
need to call to get the iterable.

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


[issue36876] [subinterpreters] Global C variables are a problem

2022-02-08 Thread Eric Snow


Eric Snow  added the comment:


New changeset 77bab59c8a1f04922bb975cc4f11e5323d1d379d by Eric Snow in branch 
'main':
bpo-36876: Update the c-analyzer whitelist. (gh-31225)
https://github.com/python/cpython/commit/77bab59c8a1f04922bb975cc4f11e5323d1d379d


--

___
Python tracker 

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



[issue46613] Add PyType_GetModuleByDef to the public & limited API

2022-02-08 Thread Hai Shi


Change by Hai Shi :


--
nosy: +shihai1991

___
Python tracker 

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



Re: Kind Remainder: How do Practitioners Approach towards Requirements Engineering?

2022-02-08 Thread Avi Gross via Python-list
Is there any way to get this mesage to stop showing up in my mailbox in what 
seems to be a shotgun approach asking everybody everywhere they can think of to 
participate in something very amorphous and at the same time having NOTHING 
particular to do with Python?
I consider things like this SPAM and will not click on anything so have no idea 
if it is legitimate, but I suggest multiple requests with no real details 
become an imposition. Anyone who wanted to do the survey has had a chance. Why 
bully the rest of us?
Is there some policy that might apply here about not being relevant?


-Original Message-
From: ETEM ÇETİN TOPTANİ 
To: python-list@python.org
Sent: Tue, Feb 8, 2022 3:52 am
Subject: Kind Remainder: How do Practitioners Approach towards Requirements 
Engineering?

Dear Sir or Madam,


We prepared a short survey to understand practitioners’ perspectives
towards the requirements engineering. Our survey basically aims to clarify
on many aspects of the requirements engineering applied in industry, including
(i) requirements gathering and specifications, (ii) requirements
modifications, (iii) requirements analysis, and (iv) requirements
transformation. We will use the results to publish a journal paper on the
practitioners' perspectives towards requirements engineering


The survey takes about 2-7 minutes to participate. We will be so grateful
if you can separate just a few minutes of you. Also, please circulate the
email to anyone who may be interested.


The survey link: https://forms.gle/DhLqr15GXVhJhzzy6


All the best,

Etem Çetin Toptani

-- 
*Bu mesajı yazdırmadan önce çevreye verebileceğiniz zararları bir kez daha 
düşününüz. *
*Think of the environment once more before printing out this 
message.*

-- 
*Bu mesajı yazdırmadan önce çevreye verebileceğiniz zararları bir kez daha 
düşününüz. *
*Think of the environment once more before printing out this 
message.*
-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Correct way to setup a package with both compiled C code and Python code?

2022-02-08 Thread Christian Gollwitzer

Am 08.02.22 um 18:57 schrieb Dieter Maurer:

Christian Gollwitzer wrote at 2022-2-7 20:33 +0100:

we've developed a Python pacakge which consists of both a compiled
extension module and some helper functions in Python. Is there a
tutorial on how to package such an extension?


Look at "https://package.python.org;,
especially 
"https://packaging.python.org/en/latest/guides/packaging-binary-extensions/;.


Thank you, but that page is more like a high-level description, it talks 
a lot about the differences between C code and Python and how it can be 
combined using SWIG etc, but I already have a working extension.


My question was more targeted at how to write the setup.py file in this 
case such that both the compiled code and the Python code gets loaded.


In the meantime, I found a similar example for C++ code with CMake and 
pybind11 here:


https://github.com/benjaminjack/python_cpp_example

That gave me enough to create a similar thing for a pure CPython extension:

https://github.com/auriocus/python_setuptools_sandbox

Now, I still have to figure out how to get this on PyPI and how to 
enable OpenMP during compilation.


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


[issue36876] [subinterpreters] Global C variables are a problem

2022-02-08 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +29396
pull_request: https://github.com/python/cpython/pull/31225

___
Python tracker 

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



Can't get iterator in the C API

2022-02-08 Thread Jen Kris via Python-list
I am using the Python C API to load the Gutenberg corpus from the nltk library 
and iterate through the sentences.  The Python code I am trying to replicate is:

from nltk.corpus import gutenberg
for i, fileid in enumerate(gutenberg.fileids()):
    sentences = gutenberg.sents(fileid)
    etc

where gutenberg.fileids is, of course, iterable. 

I use the following C API code to import the module and get pointers:

int64_t Call_PyModule()
{
    PyObject *pModule, *pName, *pSubMod, *pFidMod, *pFidSeqIter,*pSentMod;

    pName = PyUnicode_FromString("nltk.corpus");
    pModule = PyImport_Import(pName);

    if (pModule == 0x0){
    PyErr_Print();
    return 1; }

    pSubMod = PyObject_GetAttrString(pModule, "gutenberg");
    pFidMod = PyObject_GetAttrString(pSubMod, "fileids");
    pSentMod = PyObject_GetAttrString(pSubMod, "sents");

    pFidIter = PyObject_GetIter(pFidMod);
    int ckseq_ok = PySeqIter_Check(pFidMod);
    pFidSeqIter  = PySeqIter_New(pFidMod);

    return 0;
}

pSubMod, pFidMod and pSentMod all return valid pointers, but the iterator lines 
return zero: 

pFidIter = PyObject_GetIter(pFidMod);
int ckseq_ok = PySeqIter_Check(pFidMod);
pFidSeqIter  = PySeqIter_New(pFidMod);

So the C API thinks gutenberg.fileids is not iterable, but it is.  What am I 
doing wrong?


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


[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Kesh Ikuma


Kesh Ikuma  added the comment:

@eryksun - I knew the reproducibility is the issue with this bug. On the same 
PC I've been having a problem with, I created another dummy account with a 
space in its username, and it worked flawlessly... So, it's something I've done 
to my account which triggered this behavior. 

Is there anything that I can try and report on my machine? I'd be happy to do so

--

___
Python tracker 

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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to use PyTuple_GET_ITEM(), but PySequence_Fast_ITEMS() is more 
effecient. It's hard to beat an array in C.

--

___
Python tracker 

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



[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Eryk Sun


Eryk Sun  added the comment:

run_child() expects `cmdline` to be correctly quoted, and normally it is.

I can't reproduce this problem with Python 3.10.2. I created a user account 
with a space in the account name, logged on, and installed 3.10.2 for the 
current user, with the option enabled to add Python to PATH. Next I opened a 
command prompt in the user profile directory and created a virtual environment 
via `python.exe -m venv .venv`. Running ".venv\Scripts\python.exe -X utf8" 
worked. The command line used by the venv "python.exe" launcher was properly 
quoted and thus properly parsed in the original list of command-line arguments, 
sys.orig_argv.

--
nosy: +eryksun

___
Python tracker 

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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-08 Thread hydroflask


hydroflask  added the comment:

I don't have github so I can't comment there but just as a nitpick, alloca() 
never returns NULL, so you don't have to check that. I know that is 
inconsistent with its use in callproc.c so for consistency's sake the NULL 
check should stay but I would remove both checks in a future change.

More importantly you can completely avoid the args_stack variable since 
alloca() has the same end affect. I would also add an assert that the number of 
args is <= CTYPES_MAX_ARGCOUNT, that should be the case since GH 31188

--

___
Python tracker 

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



[issue46687] Update pyexpat for CVE-2021-45960

2022-02-08 Thread Ned Deily


Ned Deily  added the comment:

Duplicate of Issue46400 ?

--
nosy: +ned.deily

___
Python tracker 

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



[issue46687] Update pyexpat for CVE-2021-45960

2022-02-08 Thread Steve Dower


New submission from Steve Dower :

libexpat recently fixed a security issue relating to some arithmetic: 
https://github.com/libexpat/libexpat/pull/534

I assume we should take this fix, either by updating our entire bundled copy or 
just backporting the patch.

--
components: XML
messages: 412880
nosy: steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: Update pyexpat for CVE-2021-45960
type: security
versions: Python 3.10, Python 3.11, 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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-08 Thread Dong-hee Na


Dong-hee Na  added the comment:

And it even better from performance view

--

___
Python tracker 

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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-08 Thread Dong-hee Na


Dong-hee Na  added the comment:

@hydroflask

Sound reasonable, I submitted a new patch to use alloca which is already used 
in _ctypes module.

--

___
Python tracker 

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



[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Joshua Bronson


Joshua Bronson  added the comment:

Thanks for the explanation, Raymond.

Regarding:

> Lastly, pure python hashable sets based on the ABC are not common

This would have implications for other use cases though, that are perhaps more 
common.

See, for example, the following code: 
https://github.com/jab/bidict/blob/ae9d06/bidict/_frozenbidict.py#L36-L38

This example demonstrates an implementation of a hashable, immutable Mapping 
type, whose __hash__ implementation returns 
collections.abc.ItemsView(self)._hash(). Since there are several other 
libraries I know of that implement hashable/immutable mapping types as well, I 
thought this might be beneficial enough to users to warrant consideration.

--

___
Python tracker 

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



[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-08 Thread Éric Araujo

Change by Éric Araujo :


--
versions:  -Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-08 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +29395
pull_request: https://github.com/python/cpython/pull/31224

___
Python tracker 

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



[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Would it be horrible to have the timezone instance control this?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

The same problem exists for any attribute that has the same name as a builtin, 
see for example https://docs.python.org/3/library/sys.html#sys.float_info

--

___
Python tracker 

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



[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-08 Thread Kesh Ikuma


New submission from Kesh Ikuma :

After months of proper operation, my per-user Python install started to error 
out when I attempt `python -m venv .venv` with 

"Error: Command '['C:\\Users\\kesh\\test\\.venv\\Scripts\\python.exe', '-Im', 
'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 101."

Following the StackOverflow solution, I reinstalled Python for all users and it 
was working OK. I recently looked into it deeper and found the root issue in 
the function PC/launcher.c/run_child(). The path to the 
"...\Python\Python310\python.exe" contains a space, and the CreateProcessW() 
call on Line 811 is passing the path without quoting the path, causing the 
process creation to fail.

I fixed my issue by using the Windows short path convention on my path env. 
variable, but there must be a more permanent fix possible.

Here is the link to my question and self-answering to the problem:

https://stackoverflow.com/questions/71039131/troubleshooting-the-windows-venv-error-101

--
components: Windows
messages: 412874
nosy: hokiedsp, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [venv / PC/launcher] issue with a space in the installed python path
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Why not expose the C implementation via a frozenset._hash()
> classmethod, and change Set._hash() to merely call that?

The frozenset.__hash__ method is tightly bound to the internals of real sets to 
take advantage of the hash values already being known for real sets.  So we 
can't just expose it to ABC sets.

Also, the ABC sets need to be kept in sync with an __eq__ method, so users 
really need to see what Set._hash is actually doing.

Lastly, pure python hashable sets based on the ABC are not common, so it 
doesn't warrant a C fast path.  If C fast paths were offered, the union, 
intersection, and difference methods would more important targets.

So, thanks for the suggestion but it isn't as straight-forward as exposing 
existing code and it might make it harder for implementer to stay synced with 
an __eq__ method.

Tangential thought:  If you do implement __hash__ with Set._hash, consider 
using a cached_property decorator.

--
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
type:  -> performance
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



Re: How do you log in your projects?

2022-02-08 Thread Barry


> On 8 Feb 2022, at 14:15, Lars Liedtke  wrote:
> 
> Hello,
> 
> inspired by this thread 
> https://mail.python.org/pipermail/python-list/2022-February/905167.html I 
> finally came around to send in this question.
> 
> I know how to use python logging generally. Being on the DevOps-Side of 
> things at the moment, I naturally began liking to run tools, which not only 
> have logging, but also have different levels of logging configurable, because 
> often when you run a couple of different services and software projects, 
> logging is often the first help you turn to, and sometimes it is the only way 
> to know what is going on. Not that the code of most (FLOSS) software is not 
> available, but you simply do not have the time to read into the code of every 
> piece of software you run.
> 
> So of course I want to write software on my own, if I have to or wpuld like 
> to, that has got a decent amount of logging. But how often to actually log 
> things? Of course the obvious answer is "it depends".
> 
> So how do you do your logging?
> - On a line per line basis? on a function/method basis?
> - Do you use decorators to mark beginnings and ends of methods/functions in 
> log files?
> - Which kind of variable contents do you write into your logfiles? Of course 
> you shouldn't leak secrets...
> - How do you decide, which kind of log message goes into which level?
> - How do you prevent logging cluttering your actual code?

You seem to be thinking about how to log the flow of the code.
That is useful to log when debugging your code. But depending
on your performance goals you may have to remove from the
production version.

But it is not what you do to be able to maintain a production service.
In this case you log events that the service is processing.

Barry

> 
> Maybe there are some questions I forgot, so please feel free to add whatever 
> you think might help finding the best way of logging (tm)
> 
> Cheers
> 
> Lars
> 
> -- 
> punkt.de GmbH
> Lars Liedtke
> .infrastructure
> 
> Kaiserallee 13a
> 76133 Karlsruhe
> 
> Tel. +49 721 9109 500
> https://infrastructure.punkt.de
> i...@punkt.de
> 
> AG Mannheim 108285
> Geschäftsführer: Jürgen Egeling, Daniel Lienert, Fabian Stein
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-08 Thread hydroflask


hydroflask  added the comment:

Two things, one is a nit pick the other is more serious. I think vstinner 
mentioned this in his review of your patch but on this line:

https://github.com/python/cpython/commit/b5527688aae11d0b5af58176267a9943576e71e5#diff-706e65ee28911740bf638707e19578b8182e57c6a8a9a4a91105d825f95a139dR180

Instead of using PySequence_Fast_ITEMS(), you can just use PyTuple_GET_ITEM() 
since you know the converters are a tuple. In terms of runtime efficiency it 
doesn't change anything but is consistent with this line: 
https://github.com/python/cpython/commit/b5527688aae11d0b5af58176267a9943576e71e5#diff-706e65ee28911740bf638707e19578b8182e57c6a8a9a4a91105d825f95a139dR157

Though on second thought I think PySequence_Fast_ITEMS() is probably a better 
API overall in terms of efficiency if PyTuple_GET_ITEM() would eventually 
become a real function call given the long term push toward a stable API.

The other issue is more serious, you are always allocating an array of 
CTYPES_MAX_ARGCOUNT pointers on the stack on every C callback. This could cause 
stack overflows in situations where a relatively deep set of callbacks are 
invoked. This usage of CTYPES_MAX_ARGCOUNT differs its usage in callproc.c, 
where in that case `alloca()` is used to allocate the specific number of array 
entries on the stack. To avoid an unintended stack overflow I would use 
alloca() or if you don't like alloca() I would only allocate a relatively small 
constant number on the stack.

--

___
Python tracker 

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



[issue46678] Invalid cross device link in Lib/test/support/import_helper.py

2022-02-08 Thread Brett Cannon


Change by Brett Cannon :


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



[issue46678] Invalid cross device link in Lib/test/support/import_helper.py

2022-02-08 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset c2735b75afd530631efde4ddd3cb24bbdc285559 by Miss Islington (bot) 
in branch '3.10':
bpo-46678: Fix Invalid cross device link in Lib/test/support/import_helper.py 
(GH-31204) (GH-31207)
https://github.com/python/cpython/commit/c2735b75afd530631efde4ddd3cb24bbdc285559


--
nosy: +brett.cannon

___
Python tracker 

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



[issue46556] pathlib.Path.__enter__() should emit DeprecationWarning

2022-02-08 Thread Brett Cannon


Change by Brett Cannon :


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



[issue46556] pathlib.Path.__enter__() should emit DeprecationWarning

2022-02-08 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset 06e1701ad3956352bc0f42b8f51c2f8cc85bf378 by Barney Gale in branch 
'main':
bpo-46556: emit `DeprecationWarning` from `pathlib.Path.__enter__()` (GH-30971)
https://github.com/python/cpython/commit/06e1701ad3956352bc0f42b8f51c2f8cc85bf378


--
nosy: +brett.cannon

___
Python tracker 

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



[issue46685] Add additional tests for new features in `typing.py`

2022-02-08 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
pull_requests: +29394
pull_request: https://github.com/python/cpython/pull/31223

___
Python tracker 

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



[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-02-08 Thread Gregory Beauregard


Gregory Beauregard  added the comment:

I have made a thread on typing-sig to discuss this: 
https://mail.python.org/archives/list/typing-...@python.org/thread/WZ4BCFO4VZ7U4CZ4FSDQNFAKPG2KOGCL/

--

___
Python tracker 

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



Re: How do you log in your projects?

2022-02-08 Thread Marco Sulla
These are a lot of questions. I hope we're not off topic.
I don't know if mine are best practices. I can tell what I try to do.

On Tue, 8 Feb 2022 at 15:15, Lars Liedtke  wrote:
> - On a line per line basis? on a function/method basis?

I usually log the start and end of functions. I could also log inside
a branch or in other parts of the function/method.

> - Do you use decorators to mark beginnings and ends of methods/functions
> in log files?

No, since I put the function parameters in the first log. But I think
that such a decorator it's not bad.

> - Which kind of variable contents do you write into your logfiles? Of
> course you shouldn't leak secrets...

Well, all the data that is useful to understand what the code is
doing. It's better to repeat the essential data to identify a specific
call in all the logs of the function, so if it is called
simultaneously by more clients you can distinguish them

> - How do you decide, which kind of log message goes into which level?

It depends on the importance, the verbosity and the occurrences of the logs.

> - How do you prevent logging cluttering your actual code?

I have the opposite problem, I should log more. So I can't answer your question.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-08 Thread Eric Snow


Eric Snow  added the comment:


New changeset 81c72044a181dbbfbf689d7a977d0d99090f26a8 by Eric Snow in branch 
'main':
bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized 
global objects. (gh-30928)
https://github.com/python/cpython/commit/81c72044a181dbbfbf689d7a977d0d99090f26a8


--

___
Python tracker 

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



[issue46657] Add mimalloc memory allocator

2022-02-08 Thread Christian Heimes


Christian Heimes  added the comment:

I re-ran the benchmark of d6f5f010b586:

| Benchmark   | 2022-02-08_11-54-master-69e10976b2e7 | 
2022-02-08_11-57-master-d6f5f010b586 |
|-|::|::|
| pickle_pure_python  | 312 us   | 281 us: 
1.11x faster |
| unpickle_pure_python| 238 us   | 216 us: 
1.10x faster |
| pyflate | 380 ms   | 349 ms: 
1.09x faster |
| hexiom  | 6.04 ms  | 5.55 ms: 
1.09x faster|
| logging_silent  | 97.5 ns  | 89.8 ns: 
1.09x faster|
| float   | 63.1 ms  | 59.3 ms: 
1.07x faster|
| html5lib| 62.8 ms  | 59.1 ms: 
1.06x faster|
| crypto_pyaes| 70.1 ms  | 66.1 ms: 
1.06x faster|
| json_loads  | 20.6 us  | 19.4 us: 
1.06x faster|
| tornado_http| 90.3 ms  | 86.1 ms: 
1.05x faster|
| mako| 8.85 ms  | 8.45 ms: 
1.05x faster|
| richards| 43.0 ms  | 41.1 ms: 
1.05x faster|
| xml_etree_parse | 126 ms   | 120 ms: 
1.05x faster |
| logging_format  | 5.47 us  | 5.25 us: 
1.04x faster|
| sympy_integrate | 17.2 ms  | 16.5 ms: 
1.04x faster|
| sympy_str   | 260 ms   | 251 ms: 
1.04x faster |
| fannkuch| 325 ms   | 314 ms: 
1.04x faster |
| regex_v8| 21.1 ms  | 20.4 ms: 
1.04x faster|
| sympy_expand| 441 ms   | 425 ms: 
1.04x faster |
| regex_compile   | 121 ms   | 117 ms: 
1.03x faster |
| sympy_sum   | 138 ms   | 134 ms: 
1.03x faster |
| scimark_lu  | 106 ms   | 103 ms: 
1.03x faster |
| go  | 128 ms   | 125 ms: 
1.03x faster |
| pathlib | 14.1 ms  | 13.7 ms: 
1.02x faster|
| scimark_monte_carlo | 58.8 ms  | 57.9 ms: 
1.02x faster|
| nqueens | 70.9 ms  | 69.9 ms: 
1.02x faster|
| pidigits| 155 ms   | 153 ms: 
1.01x faster |
| pickle  | 9.34 us  | 9.22 us: 
1.01x faster|
| raytrace| 278 ms   | 275 ms: 
1.01x faster |
| 2to3| 216 ms   | 213 ms: 
1.01x faster |
| deltablue   | 3.60 ms  | 3.56 ms: 
1.01x faster|
| logging_simple  | 4.84 us  | 4.78 us: 
1.01x faster|
| xml_etree_iterparse | 82.5 ms  | 81.7 ms: 
1.01x faster|
| regex_dna   | 164 ms   | 162 ms: 
1.01x faster |
| unpack_sequence | 32.7 ns  | 32.4 ns: 
1.01x faster|
| telco   | 5.53 ms  | 5.48 ms: 
1.01x faster|
| python_startup  | 5.56 ms  | 5.58 ms: 
1.00x slower|
| xml_etree_generate  | 71.2 ms  | 71.6 ms: 
1.01x slower|
| unpickle_list   | 4.08 us  | 4.12 us: 
1.01x slower|
| chameleon   | 6.07 ms  | 6.14 ms: 
1.01x slower|
| chaos   | 64.6 ms  | 65.3 ms: 
1.01x slower|
| json_dumps  | 9.61 ms  | 9.75 ms: 
1.01x slower|
| xml_etree_process   | 49.9 ms  | 50.7 ms: 
1.01x slower|
| meteor_contest  | 80.7 ms  | 82.0 ms: 
1.02x slower   

[issue45713] gcc warning when compiling Modules/expat/xmltok_ns.c

2022-02-08 Thread Cyril Jouve


Change by Cyril Jouve :


--
keywords: +patch
nosy: +Cyril Jouve
nosy_count: 2.0 -> 3.0
pull_requests: +29393
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31022

___
Python tracker 

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



[issue46685] Add additional tests for new features in `typing.py`

2022-02-08 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks for catching these details! Please send a PR.

--

___
Python tracker 

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



[issue46685] Add additional tests for new features in `typing.py`

2022-02-08 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46685] Add additional tests for new features in `typing.py`

2022-02-08 Thread Nikita Sobolev


New submission from Nikita Sobolev :

New features (like `Self` type and `Never` type), in my opinion, require some 
extra testing.

Things that were not covered:
- Inheritance from `Self`, only `type(Self)` is covered: 
https://github.com/python/cpython/blob/c018d3037b5b62e6d48d5985d1a37b91762fbffb/Lib/test/test_typing.py#L193-L196
- Equality and non-equality for `Self` and `Never`. We should be sure that 
`NoReturn` is not equal to `Never`, but they are equal to themselfs
- `get_type_hints` with `Never`
- `get_origin` with `Self` and `Never` types, it should return `None` for both 
cases
- (not exactly related) I've also noticed that this line is not covered at all: 
https://github.com/python/cpython/blob/c018d3037b5b62e6d48d5985d1a37b91762fbffb/Lib/typing.py#L725

Maybe there are some other cases? 

I will send a PR :)

--
components: Tests
messages: 412865
nosy: AlexWaygood, Jelle Zijlstra, gvanrossum, kj, sobolevn
priority: normal
severity: normal
status: open
title: Add additional tests for new features in `typing.py`
type: behavior
versions: Python 3.11

___
Python tracker 

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



[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

Requiring IEEE 754 support is being discussed on python-dev: 
https://mail.python.org/archives/list/python-...@python.org/thread/J5FSP6J4EITPY5C2UJI7HSL2GQCTCUWN/

--

___
Python tracker 

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



[issue45490] [C API] PEP 670: Convert macros to functions in the Python C API

2022-02-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29391
pull_request: https://github.com/python/cpython/pull/31221

___
Python tracker 

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



[issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type

2022-02-08 Thread Georg Brandl


Change by Georg Brandl :


--
nosy:  -georg.brandl

___
Python tracker 

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



[issue46159] Segfault when using trace functions in 3.11a3

2022-02-08 Thread Cyril Jouve


Cyril Jouve  added the comment:

this looks related to https://github.com/nedbat/coveragepy/issues/1294 / 
https://github.com/nedbat/coveragepy/issues/1316 related to binary 
incompatibility in coverage (6.2) binary wheel built with 3.11alpha2 and 
running on 3.11alpha3 or later.

Latest release of coverage (6.3) do not ship binary wheel for python 3.11 
anymore, so it's installed and built with your current python.

--
nosy: +Cyril Jouve

___
Python tracker 

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



[issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type

2022-02-08 Thread Irit Katriel


Change by Irit Katriel :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
title: Allow catching virtual subclasses in except clauses -> [doc] clarify 
that except does not match virtual subclasses of the specified exception type
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



[issue45952] Tools/c-analyzer is out-of-date.

2022-02-08 Thread Eric Snow


Eric Snow  added the comment:


New changeset c018d3037b5b62e6d48d5985d1a37b91762fbffb by Eric Snow in branch 
'main':
bpo-45952: Get the C analyzer tool working again. (gh-31220)
https://github.com/python/cpython/commit/c018d3037b5b62e6d48d5985d1a37b91762fbffb


--

___
Python tracker 

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



[issue45490] [C API] PEP 670: Convert macros to functions in the Python C API

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

I will use this issue to track changes related to PEP 670.

--
title: [meta][C API] Avoid C macro pitfalls and usage of static inline 
functions -> [C API]  PEP 670: Convert macros to functions in the Python C API

___
Python tracker 

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



[issue46475] typing.Never and typing.assert_never

2022-02-08 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue45952] Tools/c-analyzer is out-of-date.

2022-02-08 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +29390
pull_request: https://github.com/python/cpython/pull/31220

___
Python tracker 

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



[issue46475] typing.Never and typing.assert_never

2022-02-08 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 243436f3779c1e7bed1fd4b23d5a8ec5eff40699 by Jelle Zijlstra in 
branch 'main':
bpo-46475: Add typing.Never and typing.assert_never (GH-30842)
https://github.com/python/cpython/commit/243436f3779c1e7bed1fd4b23d5a8ec5eff40699


--

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue45952] Tools/c-analyzer is out-of-date.

2022-02-08 Thread Eric Snow


Eric Snow  added the comment:


New changeset 1e6214dbd6a980b47123229aefd60bb2c9341b53 by Eric Snow in branch 
'main':
bpo-45952: Get the C analyzer tool working again. (gh-31219)
https://github.com/python/cpython/commit/1e6214dbd6a980b47123229aefd60bb2c9341b53


--

___
Python tracker 

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



[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Joshua Bronson


New submission from Joshua Bronson :

collections.abc.Set provides a _hash() method that includes the following in 
its docstring:

"""
Note that we don't define __hash__: not all sets are hashable.
But if you define a hashable set type, its __hash__ should
call this function.
...
We match the algorithm used by the built-in frozenset type.
"""

Because Set._hash() is currently implemented in pure Python, users face having 
to make a potentially challenging decision between whether to trade off runtime 
efficiency vs. space efficiency:

>>> hash(frozenset(x))  # Should I use this?
>>> Set._hash(x)# Or this?

The former requires O(n) memory to create the frozenset, merely to throw it 
immediately away, but on the other hand gets to use frozenset's __hash__ 
implementation, which is implemented in C.

The latter requires only O(1) memory, but does not get the performance benefit 
of using the C implementation of this algorithm.

Why not expose the C implementation via a frozenset._hash() classmethod, and 
change Set._hash() to merely call that?

Then it would be much clearer that using Set._hash() is always the right answer.

--
messages: 412856
nosy: jab
priority: normal
severity: normal
status: open
title: Expose frozenset._hash classmethod

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


German Salazar  added the comment:

Pre-post-edit: you are right, just saw your answer as I was typing this one. 


Aaaa

./python --version

is not enough, I guess I need to properly setup PATH, LD_LIBRARY_PATH and 
possibly PKG_CONFIG_PATH.

Sorry for the bother, guys. All is good. My apologies and thank you very much 
for the super fast response, it prompted to question and double question what I 
was doing.

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

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

I confirmed by downloading a fresh copy of each, extracting, and looking at 
Include/patchlevel.h.  You could further check by downloading a 3.6.8 tarball 
and comparing it against the 3.6.15 tarball.

Is 3.6.8 the version you already have installed, and are you building with 
`./configure --enable-shared`?  If so, my best guess would be that your new 
`./python` binary is picking up the system `libpython3.6.so`.  Try 
`LD_LIBRARY_PATH=$(pwd) ./python --version`.

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

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


German Salazar  added the comment:

I hear you, but I continue to need 3.6 for a bit longer.
I am on Linux, Centos 7; building from sources in a sandbox, no installation 
conflict with any else...

How do you confirm that the tarball indeed contains that it says? 

I build it and then I do "./python --version" and I get 3.6.8, instead of 
3.6.15   

I also have 3.7, and 3.8 installs (I also need them) and working on installing 
3.9 and 3.10

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

___
Python tracker 

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



[issue45952] Tools/c-analyzer is out-of-date.

2022-02-08 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +29389
pull_request: https://github.com/python/cpython/pull/31219

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

Also note that 3.6 is now EOL, so an upgrade is highly recommended anyway :)

--

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

I've just confirmed that both tarballs (gzip and xz) on the official download 
page (https://www.python.org/downloads/release/python-3615/) contain 3.6.15.

Note that 3.6.8 was the last bugfix release that included Windows and macOS 
installers.  If you're on one of those platforms, you may need to go through 
some extra steps to replace an existing 3.6.8 install with 3.6.15, and at that 
point you would likely be better off upgrading to 3.10 (or at least 3.9, which 
is the oldest release that still has a current binary installer).

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


German Salazar  added the comment:

>From 
https://www.python.org/downloads/release/python-3615/

Downloaded the XZ one:
https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tar.xz

I am currently building the Gzipped one, let's see what it turns out.

--
nosy:  -eric.smith

___
Python tracker 

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



Re: Correct way to setup a package with both compiled C code and Python code?

2022-02-08 Thread Dieter Maurer
Christian Gollwitzer wrote at 2022-2-7 20:33 +0100:
>we've developed a Python pacakge which consists of both a compiled
>extension module and some helper functions in Python. Is there a
>tutorial on how to package such an extension?

Look at "https://package.python.org;,
especially 
"https://packaging.python.org/en/latest/guides/packaging-binary-extensions/;.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

Where did you get the tarball?

--
nosy: +eric.smith

___
Python tracker 

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



[issue44006] symbol documentation still exists

2022-02-08 Thread Julien Palard


Julien Palard  added the comment:

Oh, it's ~unrelated, but thanks for the heads up, I overlooked a Sentry error :D

It's related to: https://github.com/python/docsbuild-scripts/issues/122, let's 
track it there.

(The visible effects are the same: the full build, reponsible for deleting the 
file is failing, while the quick (html only, not removing files) build succeed, 
so the old HTML files are kept if PDF builds are failing...)

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

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


Change by German Salazar :


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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


New submission from German Salazar :

wanted to install 3.6.15, but the source tarball installs 3.6.8

--
messages: 412849
nosy: salgerman
priority: normal
severity: normal
status: open
title: Python 3.6.15 source tarball installs 3.6.8?
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



[issue46682] python 3.10 Py_Initialize/Py_Main std path no longer includes site-packages

2022-02-08 Thread Paul Jaggi


New submission from Paul Jaggi :

Have the following simple program:
#include 
#include 

using namespace std;

int main(int argc, char** argv) {
  wchar_t* args[argc];
  for(int i = 0; i < argc; ++i) {
args[i] = Py_DecodeLocale(argv[i], nullptr);
  }

  Py_Initialize();
  const int exit_code = Py_Main(argc, args);
  cout << "Exit code: " << exit_code << endl;
  cout << "press any key to exit" << endl;
  cin.get();
  return 0;
}

When you run this program and in the console:
import sys
sys.path

for Python versions between 3.7-3.9, you get the installed python site-packages 
by default.  For Python 3.10, you don't.  This happens on both windows and Mac. 
 Is this an intentional change?

--
components: C API
messages: 412848
nosy: pjaggi1
priority: normal
severity: normal
status: open
title: python 3.10 Py_Initialize/Py_Main std path no longer includes 
site-packages
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



[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

I created GH-31218 which basically restores Python 3.10 code but enhances the 
test.

--

___
Python tracker 

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29388
pull_request: https://github.com/python/cpython/pull/31218

___
Python tracker 

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



[issue28159] Deprecate isdst argument in email.utils.localtime

2022-02-08 Thread Alan WiIliams


Alan WiIliams  added the comment:

Hi, I'd like to work on this issue. Based on the discussion, the main thing to 
do here is to raise a deprecation warning when isdst is used?

--
nosy: +Alan.Williams

___
Python tracker 

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



[issue45490] [meta][C API] Avoid C macro pitfalls and usage of static inline functions

2022-02-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29387
pull_request: https://github.com/python/cpython/pull/31217

___
Python tracker 

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



[issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

> Can issue be closed now?

I think so; if others disagree they can reopen it :)

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue44006] symbol documentation still exists

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue for binhex.

https://docs.python.org/dev/library/binhex.html is still there whereas 
https://github.com/python/cpython/blob/main/Doc/library/binxhex.rst is gone.

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-08 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 6.0 -> 7.0
pull_requests: +29386
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/31216

___
Python tracker 

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



[issue46681] gzip.compress does not forward compresslevel to zlib.compress

2022-02-08 Thread Ilya Leoshkevich


Change by Ilya Leoshkevich :


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

___
Python tracker 

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



[issue46681] gzip.compress does not forward compresslevel to zlib.compress

2022-02-08 Thread Ilya Leoshkevich

New submission from Ilya Leoshkevich :

Started with:

commit ea23e7820f02840368569db8082bd0ca4d59b62a
Author: Ruben Vorderman 
Date:   Thu Sep 2 17:02:59 2021 +0200

bpo-43613: Faster implementation of gzip.compress and gzip.decompress 
(GH-27941)

Co-authored-by: Łukasz Langa 

The fix is quite trivial:

--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -587,7 +587,8 @@ def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, 
mtime=None):
 header = _create_simple_gzip_header(compresslevel, mtime)
 trailer = struct.pack("

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

Eryk: I created GH-31214 which uses the user preferred locale if the current 
LC_TIME locale is "C" or "POSIX".

Moreover, it no longer gets the current locale when the class is created. If 
locale=locale is passed, just use the current LC_TIME (or the user preferred is 
the locale is "C" or "POSIX").

--

___
Python tracker 

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29384
pull_request: https://github.com/python/cpython/pull/31214

___
Python tracker 

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



Re: SQLAlchemy: When to initialise a session

2022-02-08 Thread Loris Bennett
"Loris Bennett"  writes:

> Hi,
>
> I am writing a fairly simple command-line application which will just
> add or delete an entry in a database and then generate a corresponding
> email.
>
> I am using SQLAlchemy to wrap a class around a database and have
>
>   class DatebaseWrapper():
>   """Encapsulation of the database"""
>
>   def __init__(self, url):
>   self.engine = create_engine(url)
>  
> Should I extend the initialisation to
>
>   def __init__(self, url):
>   self.engine = create_engine(url)
>   self.session = sessionmaker(self.engine)
>
> since each there will be only one session per call of the program?
>
> Or, since I am writing the database wrapper as its own module for
> possible reuse, should the program using the wrapper class
> initialise the session itself?

Turns out this is all explained here:

  
https://docs.sqlalchemy.org/en/14/orm/session_basics.html#session-frequently-asked-questions

Sorry for the noise.

-- 
This signature is currently under construction.
-- 
https://mail.python.org/mailman/listinfo/python-list


SQLAlchemy: When to initialise a session

2022-02-08 Thread Loris Bennett
Hi,

I am writing a fairly simple command-line application which will just
add or delete an entry in a database and then generate a corresponding
email.

I am using SQLAlchemy to wrap a class around a database and have

  class DatebaseWrapper():
  """Encapsulation of the database"""

  def __init__(self, url):
  self.engine = create_engine(url)
 
Should I extend the initialisation to

  def __init__(self, url):
  self.engine = create_engine(url)
  self.session = sessionmaker(self.engine)

since each there will be only one session per call of the program?

Or, since I am writing the database wrapper as its own module for
possible reuse, should the program using the wrapper class
initialise the session itself?

Cheers,

Loris
 
-- 
This signature is currently under construction.
-- 
https://mail.python.org/mailman/listinfo/python-list


How do you log in your projects?

2022-02-08 Thread Lars Liedtke

Hello,

inspired by this thread 
https://mail.python.org/pipermail/python-list/2022-February/905167.html 
I finally came around to send in this question.


I know how to use python logging generally. Being on the DevOps-Side of 
things at the moment, I naturally began liking to run tools, which not 
only have logging, but also have different levels of logging 
configurable, because often when you run a couple of different services 
and software projects, logging is often the first help you turn to, and 
sometimes it is the only way to know what is going on. Not that the code 
of most (FLOSS) software is not available, but you simply do not have 
the time to read into the code of every piece of software you run.


So of course I want to write software on my own, if I have to or wpuld 
like to, that has got a decent amount of logging. But how often to 
actually log things? Of course the obvious answer is "it depends".


So how do you do your logging?
- On a line per line basis? on a function/method basis?
- Do you use decorators to mark beginnings and ends of methods/functions 
in log files?
- Which kind of variable contents do you write into your logfiles? Of 
course you shouldn't leak secrets...

- How do you decide, which kind of log message goes into which level?
- How do you prevent logging cluttering your actual code?

Maybe there are some questions I forgot, so please feel free to add 
whatever you think might help finding the best way of logging (tm)


Cheers

Lars

--
punkt.de GmbH
Lars Liedtke
.infrastructure

Kaiserallee 13a 
76133 Karlsruhe

Tel. +49 721 9109 500
https://infrastructure.punkt.de
i...@punkt.de

AG Mannheim 108285
Geschäftsführer: Jürgen Egeling, Daniel Lienert, Fabian Stein

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


[issue46680] file calls itself

2022-02-08 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

https://stackoverflow.com/ or https://discuss.python.org/c/users/ are better 
places for this question.

--
nosy: +Dennis Sweeney
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



[issue46680] file calls itself

2022-02-08 Thread renzo


New submission from renzo :

good morning
I created a file called prova.py

inside I put 3 lines
import test
a = 2
print (a)

d questions
why does a file have to call itself .. is it intended?
  how come it prints the value of a twice and does not enter the loop?

--
components: Build
messages: 412840
nosy: lallo
priority: normal
severity: normal
status: open
title: file calls itself
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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-08 Thread Dong-hee Na


Dong-hee Na  added the comment:

@hydroflask

All patches are merged!
Thanks for all your suggestions :)

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



[issue46282] return value of builtins is not clearly indicated

2022-02-08 Thread Irit Katriel


Irit Katriel  added the comment:

I should have said "redundant information" rather than "obvious". 

I consider it redundant to specify that the default behavior applies to some 
specific case. If I read redundant information I may pause to think why it was 
necessary to explicitly state it, and whether I am misunderstanding something.

(Let's not make my bad choice of word turn this into a discussion about "what 
is obvious". The issue will probably never be closed if we do that.)

--

___
Python tracker 

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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-08 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset b5527688aae11d0b5af58176267a9943576e71e5 by Dong-hee Na in branch 
'main':
bpo-46323: Use PyObject_Vectorcall while calling ctypes callback function 
(GH-31138)
https://github.com/python/cpython/commit/b5527688aae11d0b5af58176267a9943576e71e5


--

___
Python tracker 

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



[issue46282] return value of builtins is not clearly indicated

2022-02-08 Thread Ned Batchelder


Ned Batchelder  added the comment:

What we're debating here is a micro-cosm of the broader "documentation 
philosophy" questions that I'm hoping the Documentation WG can iron out.  

What is "obvious"? Is it obvious that print returns None when file.write does 
not? Why does "exec" explicitly say it returns None, and no beginners were 
harmed, but having "print" say it returns None would be bad?

--

___
Python tracker 

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



[issue46657] Add mimalloc memory allocator

2022-02-08 Thread Christian Heimes


Christian Heimes  added the comment:

New benchmark:

| Benchmark   | 2022-02-08_11-54-master-69e10976b2e7 | 
2022-02-08_11-57-master-d6f5f010b586 |
|-|::|::|
| mako| 8.85 ms  | 7.83 ms: 
1.13x faster|
| hexiom  | 6.04 ms  | 5.54 ms: 
1.09x faster|
| spectral_norm   | 81.4 ms  | 75.2 ms: 
1.08x faster|
| pyflate | 380 ms   | 352 ms: 
1.08x faster |
| scimark_sparse_mat_mult | 4.05 ms  | 3.76 ms: 
1.08x faster|
| pickle_pure_python  | 312 us   | 290 us: 
1.07x faster |
| unpickle_pure_python| 238 us   | 222 us: 
1.07x faster |
| float   | 63.1 ms  | 59.5 ms: 
1.06x faster|
| tornado_http| 90.3 ms  | 86.0 ms: 
1.05x faster|
| html5lib| 62.8 ms  | 60.2 ms: 
1.04x faster|
| regex_compile   | 121 ms   | 116 ms: 
1.04x faster |
| scimark_lu  | 106 ms   | 102 ms: 
1.04x faster |
| nqueens | 70.9 ms  | 68.4 ms: 
1.04x faster|
| crypto_pyaes| 70.1 ms  | 67.8 ms: 
1.03x faster|
| logging_silent  | 97.5 ns  | 94.4 ns: 
1.03x faster|
| sympy_integrate | 17.2 ms  | 16.7 ms: 
1.03x faster|
| sympy_str   | 260 ms   | 252 ms: 
1.03x faster |
| sympy_expand| 441 ms   | 427 ms: 
1.03x faster |
| pathlib | 14.1 ms  | 13.7 ms: 
1.03x faster|
| regex_dna   | 164 ms   | 159 ms: 
1.03x faster |
| regex_v8| 21.1 ms  | 20.6 ms: 
1.02x faster|
| sympy_sum   | 138 ms   | 136 ms: 
1.02x faster |
| scimark_fft | 286 ms   | 281 ms: 
1.02x faster |
| pickle  | 9.34 us  | 9.19 us: 
1.02x faster|
| xml_etree_parse | 126 ms   | 124 ms: 
1.01x faster |
| richards| 43.0 ms  | 42.4 ms: 
1.01x faster|
| xml_etree_generate  | 71.2 ms  | 70.5 ms: 
1.01x faster|
| scimark_monte_carlo | 58.8 ms  | 58.3 ms: 
1.01x faster|
| deltablue   | 3.60 ms  | 3.58 ms: 
1.01x faster|
| chaos   | 64.6 ms  | 64.3 ms: 
1.01x faster|
| 2to3| 216 ms   | 215 ms: 
1.00x faster |
| pidigits| 155 ms   | 154 ms: 
1.00x faster |
| nbody   | 76.4 ms  | 77.0 ms: 
1.01x slower|
| python_startup_no_site  | 3.96 ms  | 3.99 ms: 
1.01x slower|
| xml_etree_iterparse | 82.5 ms  | 83.1 ms: 
1.01x slower|
| scimark_sor | 103 ms   | 104 ms: 
1.01x slower |
| unpickle| 11.3 us  | 11.4 us: 
1.01x slower|
| telco   | 5.53 ms  | 5.58 ms: 
1.01x slower|
| python_startup  | 5.56 ms  | 5.62 ms: 
1.01x slower|
| json_loads  | 20.6 us  | 20.8 us: 
1.01x slower|
| json_dumps  | 9.61 ms  | 9.77 ms: 
1.02x slower|
| dulwich_log | 60.9 ms  | 62.1 ms: 
1.02x slower|
| logging_format  | 5.47 us  | 5.62 us: 
1.03x slower|
| pickle_list | 3.06 us  | 3.15 us: 
1.03x slower|
| django_template 

Kind Remainder: How do Practitioners Approach towards Requirements Engineering?

2022-02-08 Thread ETEM ÇETİN TOPTANİ
Dear Sir or Madam,


We prepared a short survey to understand practitioners’ perspectives
towards the requirements engineering. Our survey basically aims to clarify
on many aspects of the requirements engineering applied in industry, including
(i) requirements gathering and specifications, (ii) requirements
modifications, (iii) requirements analysis, and (iv) requirements
transformation. We will use the results to publish a journal paper on the
practitioners' perspectives towards requirements engineering


The survey takes about 2-7 minutes to participate. We will be so grateful
if you can separate just a few minutes of you. Also, please circulate the
email to anyone who may be interested.


The survey link: https://forms.gle/DhLqr15GXVhJhzzy6


All the best,

Etem Çetin Toptani

-- 
*Bu mesajı yazdırmadan önce çevreye verebileceğiniz zararları bir kez daha 
düşününüz. *
*Think of the environment once more before printing out this 
message.*

-- 
*Bu mesajı yazdırmadan önce çevreye verebileceğiniz zararları bir kez daha 
düşününüz. *
*Think of the environment once more before printing out this 
message.*
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Openning Python program

2022-02-08 Thread Cecil Westerhof via Python-list
Chris Angelico  writes:

> On Tue, 8 Feb 2022 at 06:51, Cecil Westerhof via Python-list
>  wrote:
>>
>> Chris Angelico  writes:
>>
>> >> > How difficult would it be to get people to read those lines, though?
>> >>
>> >> That does remind me about a system administrator who wanted to make a
>> >> point. He changed something on the server so all the Windows computers
>> >> started up and gave a message:
>> >> If you want to continue: click Cancel
>> >>
>> >> The help-desk became flooded with calls. I think he did a great job of
>> >> showing a vulnerability. But it was not appreciated and he was fired.
>> >> :'-(
>> >>
>> >
>> > First image in this collection:
>> >
>> > https://thedailywtf.com/articles/How-Do-I-Use-This
>> >
>> > For those who can't click on links, it's a screenshot of a
>> > confirmation dialogue. The user asked to cancel all the current
>> > transfers, and the system wanted to check that the user really wanted
>> > to do that; if you do indeed want to cancel those transfers, click
>> > "Cancel", but if you actually don't want to, click "Cancel" instead.
>>
>> His dialog was crystal clear. The problem was that most users just
>> click OK without reading the message. And that was what his little
>> experiment showed.
>>
>
> Ah. Yes, that... that sounds like a very familiar and serious vulnerability.

I really think that always clicking on OK without ever checking what
is going to happen is a problem. It at least shows that 'user
friendly' software can be counter productive.

>From long ago:
 Are you sure that you want to take this action?

 Yes.


 Are you really sure that you want to take this action?

 Yes.


 Are you really, really sure that you want to take this action.

 Yes. (With a curse under the breath.)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-08 Thread Alan Bawden
And I missed one that was just published last month:

https://datatracker.ietf.org/doc/html/rfc9171

Unlike RFC 5050, this version of the protocol actually claims to be a
"Proposed Standard".

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


Re: Best way to check if there is internet?

2022-02-08 Thread Alan Bawden
Greg Ewing  writes:

   On 8/02/22 8:51 am, Chris Angelico wrote:
   > Some day, we'll have people on Mars. They won't have TCP connections -
   > at least, not unless servers start supporting connection timeouts
   > measured in minutes or hours - but it wouldn't surprise me if some
   > sort of caching proxy system is deployed.

   Or the internet acquires a new protocol that's designed
   for very-long-latency connections.

Very much a hot topic:

https://www.nasa.gov/directorates/heo/scan/engineering/technology/disruption_tolerant_networking_overview
https://en.wikipedia.org/wiki/Delay-tolerant_networking
https://datatracker.ietf.org/doc/html/rfc4838
https://datatracker.ietf.org/doc/html/rfc5050

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


[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2022-02-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



  1   2   >