Re: URLError:

2022-02-12 Thread Gisle Vanem

Shaozhong SHI wrote:


The following is used in a loop to get response code for each url.

print (urllib.request.urlopen(url).getcode())

However, error message says: URLError: 

11001 == WSAHOST_NOT_FOUND.

Look in any 'winsock.h' header:
  #define WSAHOST_NOT_FOUND (WSABASEERR+1001)

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


[issue34890] Support functools.partial in inspect.is*function() checks

2022-02-12 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

See https://bugs.python.org/issue46722 for a concern about this change.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread miss-islington


miss-islington  added the comment:


New changeset 44666c3285a52c2a4632f89aeeddd7ca7d02c8df by Miss Islington (bot) 
in branch '3.10':
bpo-45447: Add entry to What's new 3.10 (GH-31304)
https://github.com/python/cpython/commit/44666c3285a52c2a4632f89aeeddd7ca7d02c8df


--

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread miss-islington


miss-islington  added the comment:


New changeset ebe73e6095fc019fd1e31c9f41bc67d56ee003b6 by Miss Islington (bot) 
in branch '3.9':
bpo-45447: Add entry to What's new 3.9 (GH-31305)
https://github.com/python/cpython/commit/ebe73e6095fc019fd1e31c9f41bc67d56ee003b6


--

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread miss-islington


miss-islington  added the comment:


New changeset 5698e0be8e77bd4d7a1fda88005662f0b239dec8 by Miss Islington (bot) 
in branch '3.10':
bpo-45447: Add entry to What's new 3.9 (GH-31305)
https://github.com/python/cpython/commit/5698e0be8e77bd4d7a1fda88005662f0b239dec8


--

___
Python tracker 

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



[issue35228] Index search in CHM help crashes viewer

2022-02-12 Thread 胡丹

胡丹  added the comment:

I found another workaround to alleviate this problem.

My envrionments: Win 10 Pro 2004, Python 3.9.6, cp936 locale

When I open the Python CHM help file, e.g. double click, Win10 actually uses 
the command: 
"C:\Windows\hh.exe" D:/Python/Python39/Doc/python396.chm
But when I try "C:\Windows\SysWOW64\hh.exe" 
D:/Python/Python39/Doc/python396.chm 
Magic happens, crash problem just vanished :)

--
nosy: +danny1221

___
Python tracker 

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



[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-12 Thread Tim Peters


Tim Peters  added the comment:

While bundling the lock.release() into C makes that bulletproof, is there a 
bulletproof way to guarantee that `self._stop()` gets called if the 
acquire_and_release() succeeds? Offhand, I don't see a reason for why that 
isn't just as vulnerable to getting skipped due to an unfortunate signal.

Indeed, huge mounds of threading.py can leave things in insane states in the 
presence of by-magic exceptions. Even if code is very careful to put crucial 
cleanup code in `finally` blocks so it gets executed "no matter what", there's 
nothing to stop code in `finally` blocks from getting skipped over due to 
by-magic exceptions too.

It's an eternal marvel that anything ever works at all ;-)

--

___
Python tracker 

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



[issue46716] regrtest didn't respect the timeout when running test_subprocess on AMD64 Windows11 3.x

2022-02-12 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

I've been able locally to reproduce the test_subprocess hang.  The responsible 
function is subprocess.run().  The test case, test_timeout(), uses a small 
timeout value (0.0001), which, when given enough load, can cause the run() call 
to hang.

A judicious use of prints in subprocess.py, reveals that the timeout passed to 
wait() ends up being negative.  That value, once cast to a DWORD, ultimately 
causes a very long wait (0xfff2, in my testing).

It does seem that only the Windows Popen._wait() cannot handle negative timeout 
values, so the fix should be as simple as coercing the timeout values to >= 0.

--
Added file: https://bugs.python.org/file50623/process.py

___
Python tracker 

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



[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-12 Thread Tim Peters


Tim Peters  added the comment:

> Maybe add an `acquire_and_release()` method

Bingo - that should do the trick, in an "obviously correct" way. Of course it's 
of limited applicability, but fine by me.

Will you open a PR with this code?

--

___
Python tracker 

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



[issue39805] Copying functions doesn't actually copy them

2022-02-12 Thread Numerlor


Numerlor  added the comment:

Ran into this myself today; do you have any plans on implementing the proposed 
change?

--
nosy: +Numerlor

___
Python tracker 

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



[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-12 Thread Eryk Sun


Eryk Sun  added the comment:

> Wrap everything needed in a custom C function. 

Maybe add an `acquire_and_release()` method:

static PyObject *
lock_PyThread_acquire_and_release_lock(
lockobject *self, PyObject *args, PyObject *kwds)
{
_PyTime_t timeout;

if (lock_acquire_parse_args(args, kwds, ) < 0)
return NULL;

PyLockStatus r = acquire_timed(self->lock_lock, timeout);

if (r == PY_LOCK_INTR) {
return NULL;
}

if (r == PY_LOCK_ACQUIRED) {
PyThread_release_lock(self->lock_lock);
self->locked = 0;
}

return PyBool_FromLong(r == PY_LOCK_ACQUIRED);
}

--

___
Python tracker 

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



[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-12 Thread Alexander


Alexander  added the comment:

Added the PR. (I have signed the CLA, just haven't got the response yet, 
doesn't affect the discussion I guess)

--

___
Python tracker 

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



[issue46615] Use-after-free by mutating set during set operations

2022-02-12 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
pull_requests: +29473
pull_request: https://github.com/python/cpython/pull/31312

___
Python tracker 

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



[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-12 Thread Alexander


Change by Alexander :


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

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 6331c08d1c3248ff47a7b8e0045c9023c9af672c by Terry Jan Reedy in 
branch 'main':
bpo-45447: Fix entry in What's New 3.11 (GH-31307)
https://github.com/python/cpython/commit/6331c08d1c3248ff47a7b8e0045c9023c9af672c


--

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29470
pull_request: https://github.com/python/cpython/pull/31309

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29471
pull_request: https://github.com/python/cpython/pull/31310

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset cef91ca80c41749824eca1d4b2c99731e3d5f64c by Terry Jan Reedy in 
branch 'main':
bpo-45447: Add entry to What's new 3.9 (GH-31305)
https://github.com/python/cpython/commit/cef91ca80c41749824eca1d4b2c99731e3d5f64c


--

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 2d98433549be358d1c192e30e51b8d345d618cc7 by Terry Jan Reedy in 
branch 'main':
bpo-45447: Add entry to What's new 3.10 (GH-31304)
https://github.com/python/cpython/commit/2d98433549be358d1c192e30e51b8d345d618cc7


--

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29469
pull_request: https://github.com/python/cpython/pull/31308

___
Python tracker 

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



[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-12 Thread Tim Peters


Tim Peters  added the comment:

Na, we've been doing excruciatingly clever stuff to deal with thread shutdown 
for decades, and it always proves to be wrong in some way. Even if code like

except:
if lock.locked():
lock.release()
self._stop()
raise

did work as hoped for, it would still be broken, but in a different way: 
suppose we really did acquire the tstate lock because the thread actually ended 
while we were in acquire(). But then a signal dumped us into the `except` block 
before doing the release. Oops! There's nothing I can see to stop _another_ 
(say) KeyboardInterrupt preventing us from doing the "failsafe" release too. So 
the lock remains locked forever after (we hold the lock now, and missed our 
chances to release it). And I think that's pretty likely: if I don't see an 
instant response to Ctrl-C, I'm likely to do another very soon after.

So I don't think catching exceptions can be made to work for this. Or `finally` 
blocks either. Indeed, it appears that any way whatsoever of spelling 
`lock.release()` in Python can be defeated by an unfortunately timed signal.

Which isn't unique to this code, of course. The failure modes of this code just 
happen to be unusually visible ;-)

Two other approaches come to mind:

- Wrap everything needed in a custom C function. CPython can't interfere with 
its control flow.

- Add new sys gimmicks to suppress and re-enable raising Python level 
exceptions for signals. Then, e.g., something here like:

with sys.delay_signal_exceptions():
# Dead simple code, like _before_ we "fixed" it ;-)
# In particular, while Ctrl-C may terminate the `acquire()` call,
# KeyboardInterrupt will not be raised until the `with` block
# exits.
# Possibly intractable: arranging then for the traceback to
# point at the code where the exception would have been raised
# had temporary suspension not been enabled. Then again, since
# it's not _actually_ raised there at the Python level, maybe
# it's a Good Thing to ignore.
if lock.acquire(block, timeout):
lock.release()
self._stop()

The second way is more general, but would probably require a PEP.

--

___
Python tracker 

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



[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-12 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Go ahead and open a PR -- it makes it easier to discuss particular changes.

Regarding backwards-compatibility, error messages improvements are fair game 
for Python 3.11, we just shouldn't backport them to earlier versions.

We can also consider including the type of the relevant object in the error 
messages.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-12 Thread Neil Girdhar


Neil Girdhar  added the comment:

Thank you, this would have saved me a lot of time!

On Sat, Feb 12, 2022 at 8:37 PM Alexander  wrote:

>
> Alexander  added the comment:
>
> Indeed, the error message does not help to identify the problem. Moreover,
> it collides with similar errors in namedtuple and DynamicClassAttribute
> which may lead to even more confusion.
>
> I made a draft patch that could help with it (
> https://github.com/Alex-Blade/cpython/commit/06df3a72dfe462c8fe4eac60dce0ef059b1738f8),
> but I have a concern related to backwards compatibility (that's why no PR).
> I don't really understand if according to PEP 387 a change in an exception
> message should be considered compatibility breaking?
>
> --
> nosy: +Alex-Blade
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-12 Thread Alexander


Alexander  added the comment:

Indeed, the error message does not help to identify the problem. Moreover, it 
collides with similar errors in namedtuple and DynamicClassAttribute which may 
lead to even more confusion.

I made a draft patch that could help with it 
(https://github.com/Alex-Blade/cpython/commit/06df3a72dfe462c8fe4eac60dce0ef059b1738f8),
 but I have a concern related to backwards compatibility (that's why no PR). I 
don't really understand if according to PEP 387 a change in an exception 
message should be considered compatibility breaking?

--
nosy: +Alex-Blade

___
Python tracker 

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



[issue46735] gettext.translations crashes when locale is unset

2022-02-12 Thread unmellow the gamer


New submission from unmellow the gamer :

The issue listed below contains an example of this problem
I assume python programs crashing when an environment variable is unset
is unintended and thought after all this time i should probably bring it to 
your attention
https://github.com/k4yt3x/video2x/issues/349

--
components: Parser
messages: 413151
nosy: amazingminecrafter2015, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: gettext.translations crashes when locale is unset
type: crash
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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread miss-islington


miss-islington  added the comment:


New changeset 1d4d44c385414042cbdd2a1e9504cd8e9d69c0ae by Miss Islington (bot) 
in branch '3.9':
bpo-45447: Add syntax highlighting for `.pyi` files in IDLE (GH-28950)
https://github.com/python/cpython/commit/1d4d44c385414042cbdd2a1e9504cd8e9d69c0ae


--

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +29468
pull_request: https://github.com/python/cpython/pull/31307

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 9fabcfbe68ff81ef5f17f86a93daf9cce9d83876 by Terry Jan Reedy in 
branch '3.10':
bpo-45447: Add syntax highlighting for `.pyi` files in IDLE (GH-28950)
https://github.com/python/cpython/commit/9fabcfbe68ff81ef5f17f86a93daf9cce9d83876


--

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +29466
pull_request: https://github.com/python/cpython/pull/31305

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +29465
pull_request: https://github.com/python/cpython/pull/31304

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +29464
pull_request: https://github.com/python/cpython/pull/31303

___
Python tracker 

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



[issue45948] Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)

2022-02-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45948] Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)

2022-02-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset cc6d8f88289917d67237a10f7a0e2439fde7a573 by Jacob Walls in branch 
'3.9':
[3.9] bpo-45948: Remove constructor discrepancy in C version of 
ElementTree.XMLParser (GH-31152) (GH-31299)
https://github.com/python/cpython/commit/cc6d8f88289917d67237a10f7a0e2439fde7a573


--

___
Python tracker 

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



[issue45447] Make IDLE recognize .pyi stub files (and .pyw) as python source

2022-02-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 50cf4991c49e19f917305dd7b9c71085c11edddb by Alex Waygood in 
branch 'main':
bpo-45447: Add syntax highlighting for `.pyi` files in IDLE (GH-28950)
https://github.com/python/cpython/commit/50cf4991c49e19f917305dd7b9c71085c11edddb


--

___
Python tracker 

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



[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-12 Thread Eryk Sun


Eryk Sun  added the comment:

> If the acquire() in fact times out, but the store to the `acquired` 
> variable is interrupted, `if _WINDOWS and acquired is None` will
> succeed, despite that the lock is still locked

Yeah, my proposed workaround is no good, so we can't resolve this without a 
more fundamental solution. Are you looking into a way to prevent the STORE_FAST 
instruction from getting interrupted by an asynchronous exception?

--

___
Python tracker 

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



[issue46734] Add Maildir.get_flags() to access message flags without opening the file

2022-02-12 Thread Stephen Gildea


Change by Stephen Gildea :


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

___
Python tracker 

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



[issue46734] Add Maildir.get_flags() to access message flags without opening the file

2022-02-12 Thread Stephen Gildea


New submission from Stephen Gildea :

A message's flags are stored in its filename by Maildir, so the flags
are available without reading the message file itself.  The structured
message file name makes it efficient to scan a large mailbox to select
only messages that are, for example, not Trashed.

The mailbox.Maildir interface does not expose these flags, however.  The
only way to access the flags through the mailbox library is to create a
mailbox.MaildirMessage object, which has a get_flags() method.  But
creating a MaildirMessage requires opening the message file, which is slow.

I propose adding a parallel get_flags(key) method to mailbox.Maildir,
so that the flags are available without having to create a
MaildirMessage object.

In iterating through a mailbox with thousands of messages, I find that
this proposed Maildir.get_flags() method is 50 times faster than
MaildirMessage.get_flags().

--
components: Library (Lib)
messages: 413145
nosy: gildea
priority: normal
severity: normal
status: open
title: Add Maildir.get_flags() to access message flags without opening the file
type: enhancement
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



[issue22295] Clarify available commands for package installation

2022-02-12 Thread Ville Skyttä

Change by Ville Skyttä :


--
nosy: +scop
nosy_count: 4.0 -> 5.0
pull_requests: +29462
pull_request: https://github.com/python/cpython/pull/24003

___
Python tracker 

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



Re: URLError:

2022-02-12 Thread Chris Angelico
On Sun, 13 Feb 2022 at 07:17, Shaozhong SHI  wrote:
>
> The following is used in a loop to get response code for each url.
>
> print (urllib.request.urlopen(url).getcode())
>
> However, error message says: URLError:  getaddrinfo failed>
>
> Python 3.6.5 is being used to test whether url is live or not.
>
> Can anyone shed light on this?
>

What that's saying is that it couldn't look up the domain name to get
the corresponding address. Most likely, that means you either don't
have DNS available, or the DNS server said that it couldn't find that
server. (Whether that's true or not. It's always possible for the DNS
server to be wrong.) So, if you can fairly safely assume that you have
a fully-functioning internet connection (for instance, if other URLs
can be fetched successfully), the most reasonable interpretation of
this is that the URL is, in some way, broken.

I suspect that errno 11001 is a Winsock error, in which case it would
mean "Host not found". On my Linux system, I get a chained exception
that says "Name or service not found". Most likely, you can find this
information further up in the traceback.

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


[issue46733] pathlib.Path methods can raise NotImplementedError

2022-02-12 Thread Alex Waygood


Alex Waygood  added the comment:

I suppose it might also be worth considering moving `owner()` and `group()` to 
PosixPath. In practice, these unconditionally raise NotImplementedError on 
Windows, since the pwd and grp modules are not available on Windows. So, in an 
ideal world, they probably wouldn't exist on the common base class.

Again, though, that needs to be weighed against backwards-compatibility 
considerations.

--

___
Python tracker 

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



Re: URLError:

2022-02-12 Thread Peter J. Holzer
On 2022-02-12 20:15:43 +, Shaozhong SHI wrote:
> The following is used in a loop to get response code for each url.
> 
> print (urllib.request.urlopen(url).getcode())
> 
> However, error message says: URLError:  getaddrinfo failed>
> 
> Python 3.6.5 is being used to test whether url is live or not.
> 
> Can anyone shed light on this?

getaddrinfo is the function that resolves a domain name into an IP
address. If that fails, either the domain name doesn't exist or you have
a problem with your DNS setup.

Things to test:

* Can you resolve the domain name to an address (try «nslookup» or
  «host» or «dig» depending on your OS)?
* Can you access the whole URL with a different tool like «wget» or
  «curl»?

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46733] pathlib.Path methods can raise NotImplementedError

2022-02-12 Thread Alex Waygood


Alex Waygood  added the comment:

Here's my two cents, as a non-expert when it comes to pathlib:

I'm not really sure why `is_mount()` exists on WindowsPath objects, given that 
it unconditionally raises `NotImplementedError` on WindowsPath objects -- that 
seems *very* strange to me. It seems to me like it should probably be a method 
on the `PosixPath` class rather than on the `Path` class.

The other methods that raise NotImplementedError don't seem as egregious, 
because none of them *unconditionally* raise NotImplementedError. We could 
debate whether some of them would raise different errors in an ideal world, but 
changing them now might have implications for backwards compatibility, and it 
doesn't seem like a *major* issue to me.

--
nosy: +AlexWaygood

___
Python tracker 

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



Re: PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

2022-02-12 Thread Peter J. Holzer
On 2022-02-11 18:20:19 -0500, Dennis Lee Bieber wrote:
> On Fri, 11 Feb 2022 20:37:57 +0100, "Peter J. Holzer" 
> declaimed the following:
> 
> >Interestingly, Excel did have the ability for multiple users editing the
> >same file at some time (maybe early 2000s? Way before Google docs or
  ^^
> >Office 365). It had to be explicitely enabled and it didn't work very
   ^^
> >reliably (at least not with Samba as file servers), so we never really
> >used it but it is clear that somebody at MS thought that users needed or
> >at least wanted that ability.
> 
>   A quick Google does find mention of "shared workbooks":
> https://docs.microsoft.com/en-us/office/troubleshoot/excel/use-shared-workbook

| To make changes to a shared workbook that was created in Microsoft Excel 97
| or a later version of Excel, you must use Excel 97 or a later version of 
Excel.

So apparently that ability was added in Excel 97.


>   The preferred mode requires "Microsoft 365 subscription" and latest
> Office version:

Yes, these days you would use Office 365 for that kind of functionality,
but that didn't exist at that time (neither did cloud storage systems).

Network file systems like NFS or SMB did exist, though, and people
wanted (or at least MS thought they wanted) to collaborate on Excel
files. So Excel provided a way to do that.

That was sort of the point: That Excel was not *always* single-user.
There have been ways that multiple users could simultaneously edit the
same file for 25 years.


>   However -- the key feature is that these are Excel-Excel(-Excel...)
> operations

I'm pretty sure that that worked entirely through the file system. So
the only thing stopping you from implementing it in a different program
was the lack of documentation (as was typical for MS in the 1990's).

But again, this wasn't my point. My point was that Excel files are
designed to be used only by a single process isn't true.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


URLError:

2022-02-12 Thread Shaozhong SHI
The following is used in a loop to get response code for each url.

print (urllib.request.urlopen(url).getcode())

However, error message says: URLError: 

Python 3.6.5 is being used to test whether url is live or not.

Can anyone shed light on this?

Regards,

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


[issue46733] pathlib.Path methods can raise NotImplementedError

2022-02-12 Thread Alex Waygood


Change by Alex Waygood :


--
keywords:  -patch
stage: patch review -> 

___
Python tracker 

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



[issue46733] pathlib.Path methods can raise NotImplementedError

2022-02-12 Thread Alex Waygood


Change by Alex Waygood :


--
pull_requests:  -29461

___
Python tracker 

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



[issue46733] pathlib.Path methods can raise NotImplementedError

2022-02-12 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue46733] pathlib.Path methods can raise NotImplementedError

2022-02-12 Thread Barney Gale


New submission from Barney Gale :

The docs for NotImplementedError say:

> In user defined base classes, abstract methods should raise this exception 
> when they require derived classes to override the method, or while the class 
> is being developed to indicate that the real implementation still needs to be 
> added.

pathlib's use of NotImplementedError appears to be more broad. It can be raised 
in the following circumstances:

1. When attempting to construct a WindowsPath from a non-Windows system, and 
vice-versa. This is the only case where NotImplementedError is mentioned in the 
pathlib docs (in a repl example)
2. In glob() and rglob() when an absolute path is supplied as a pattern
3. In owner() if the pwd module isn't available
4. In group() if the grp module isn't available
5. In readlink() if os.readlink() isn't available
6. In symlink_to() if os.symlink() isn't available
7. In hardlink_to() if os.hardlink() isn't available
8. In WindowsPath.is_mount(), unconditionally

I suspect there are better choices for exception types in all these cases.

--
components: Library (Lib)
messages: 413142
nosy: barneygale
priority: normal
severity: normal
status: open
title: pathlib.Path methods can raise NotImplementedError
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



[issue46732] object.__bool__ docstring is wrong

2022-02-12 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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

___
Python tracker 

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



[issue46732] object.__bool__ docstring is wrong

2022-02-12 Thread Jelle Zijlstra


New submission from Jelle Zijlstra :

>>> None.__bool__.__doc__
'self != 0'

This isn't true, since None does not equal 0. I suggest rewording it to "True 
if self else False".

--
assignee: Jelle Zijlstra
components: Interpreter Core
messages: 413141
nosy: Jelle Zijlstra
priority: normal
severity: normal
status: open
title: object.__bool__ docstring is wrong
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



[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-12 Thread Tim Peters


Tim Peters  added the comment:

Eryk, I don't think that workaround is solid on Windows in all cases. For 
example, if .join() is called with a timeout, the same timeout is passed to 
lock.acquire(block, timeout). If the acquire() in fact times out, but the store 
to the `acquired` variable is interrupted, `if _WINDOWS and acquired is None` 
will succeed, despite that the lock is still locked. Then we go on to - again - 
incorrectly release the lock and call _stop().

But please don't "repair" that: platform-specific tricks aren't on a path to an 
actual solution ;-) If the latter requires some new C code, fine.

--
nosy: +tim.peters

___
Python tracker 

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



Re: Python LSTM forecast future values for time series

2022-02-12 Thread Cousin Stanley
Jorge Conforte wrote:

> 
> I'm starting run the LSTM to forecast future values for time serie data.
> 
> please can someone give me some information 
> on how i can predict future values 
​​> for my time series using LSTM. Thanks, Conrado

  I cannot personlly help but a google search
  using the following phrase seems promising  

lstm predict future values


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona

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


[issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior

2022-02-12 Thread Lincoln Auster


Lincoln Auster  added the comment:

> In my idea it would not be a list of things that you have to pass
> piecemeal to request specific behaviour, but another function or a new
> param (like `parse(string, universal=True)`) that implements universal
> parsing.

If I'm correct in my understanding of a universal parse function (a
function with all the SchemeClasses enabled unilaterally), some
parse_universal function would be a pretty trivial thing to add with the
API I've already got here (though it wouldn't address 22852 without some
extra work afaict). I do think keeping the 'piecemeal' options exposed
has some utility, though, especially since the uses_* lists already
treat them on such a granular level.

Do we think a parse_universal function would be helpful to add on top of
this, or just repetitive?

--

___
Python tracker 

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



[issue46729] Better str() for BaseExceptionGroup

2022-02-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

Should it show the number of immediate subexceptions (i.e., len(eg.exceptions)) 
or the number of leaf exceptions? I'd be happy with the former (since that's 
what EdgeDb's MultiError does), which would not require adding an extra field 
to the base exception group struct.

--
nosy: +gvanrossum, yselivanov

___
Python tracker 

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



[issue46731] posix._fcopyfile flags addition

2022-02-12 Thread David CARLIER


New submission from David CARLIER :

Exposing more flags for direct calls, shutil fastcopy still only using 
COPYFILE_DATA one.

--
components: Library (Lib)
messages: 413137
nosy: devnexen
priority: normal
pull_requests: 29459
severity: normal
status: open
title: posix._fcopyfile flags addition
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



[issue46700] wrong nomenclature (options vs. arguments) in argparse

2022-02-12 Thread mirabilos

mirabilos  added the comment:

Hm, the change helps indeed. I did this in my code:

p = argparse.ArgumentParser(description='…', add_help=False)
g = p.add_argument_group('Options')
g.add_argument('-h', action='help', help='show this help message and exit')
g.add_argument(………
g = p.add_argument_group('Arguments')
g.add_argument('file', ………
args = p.parse_args()

Maybe adjust the documentation to match? As it stands, 
https://docs.python.org/3/library/argparse.html is somewhat helpful, but 
https://docs.python.org/3/howto/argparse.html is totally confusing.

--

___
Python tracker 

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



[issue46700] wrong nomenclature (options vs. arguments) in argparse

2022-02-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Éric is correct.  There is not much that can be done about this.  The 
nomenclature is deeply baked into the code and the docs.

We did change the help output to list "options" rather than "optional 
arguments".  That helps the end users so that "optional" doesn't imply the 
opposite of "required".

--
nosy: +rhettinger
resolution:  -> wont fix
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



[issue45948] Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)

2022-02-12 Thread Jacob Walls


Change by Jacob Walls :


--
pull_requests: +29458
pull_request: https://github.com/python/cpython/pull/31299

___
Python tracker 

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



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

2022-02-12 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +29457
pull_request: https://github.com/python/cpython/pull/31298

___
Python tracker 

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



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

2022-02-12 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +29456
pull_request: https://github.com/python/cpython/pull/31297

___
Python tracker 

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



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

2022-02-12 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10
nosy_count: 4.0 -> 5.0
pull_requests: +29455
pull_request: https://github.com/python/cpython/pull/31296

___
Python tracker 

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



[issue46333] ForwardRef.__eq__ does not respect module parameter

2022-02-12 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset b70690bb37cc4bac695051484734eede0c1f9ada by aha79 in branch 
'main':
bpo-46333: include `module` in `ForwardRef.__repr__` (#31283)
https://github.com/python/cpython/commit/b70690bb37cc4bac695051484734eede0c1f9ada


--

___
Python tracker 

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



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

2022-02-12 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy:  -corona10
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



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

2022-02-12 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 8aaaf7e182e22026c3487a3b86d4d7d4f0f5f778 by Cyril Jouve in branch 
'main':
bpo-46400: Update libexpat from 2.4.1 to 2.4.4 (GH-31022)
https://github.com/python/cpython/commit/8aaaf7e182e22026c3487a3b86d4d7d4f0f5f778


--
nosy: +corona10

___
Python tracker 

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



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

2022-02-12 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +29454
pull_request: https://github.com/python/cpython/pull/31295

___
Python tracker 

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



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

2022-02-12 Thread sping


sping  added the comment:

Just to understand, why has Python 3.7 and 3.8 been dropped?  Neither seems to 
be end-of-life but affected.  Thank you!

--

___
Python tracker 

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



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

2022-02-12 Thread Dong-hee Na


Change by Dong-hee Na :


--
versions:  -Python 3.7, Python 3.8

___
Python tracker 

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



[issue46724] Odd Bytecode Generation in 3.10

2022-02-12 Thread Saul Shanabrook


Saul Shanabrook  added the comment:

Ah, I see that to represent a negative 4 byte signed integer as an arg, we 
actually do need the 4 instructions, since each is a byte, to get the most 
significant bit to a 1?

I wasn't able to find anything anywhere which says if the bytecode should or 
should not contain negative opargs, so I am not sure if this is a bug or 
intended behavior, to emit the three EXTENDED_ARGs in order to represent

--

___
Python tracker 

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



[issue46724] Odd Bytecode Generation in 3.10

2022-02-12 Thread Saul Shanabrook


Saul Shanabrook  added the comment:

I added a patch to make `dis` work with the overflow format.

I am looking into why the bytecode is emitted like this in the first place now. 

I see that currently, Python is trying to write a negative bytecode arg for the 
JUMP_ABSOLUTE and `instrsize` is saying this requires 4 args (which is not 
true, it only requires one). Is it intended behavior that the bytecode args 
will be negative? If so, then `instrsize` might have to be updated to handle 
this. It takes in an `unsigned int` but the oparg is actually a signed int.

--

___
Python tracker 

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



[issue46704] Parser API not checking for null-terminator

2022-02-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Closing as not a bug. Please, feel free to reopen if we missed something.

Thanks for the report!

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



[issue46722] Different behavior for functiools.partial between inspect.isfunction() and other inspect.is*function()

2022-02-12 Thread Iliya Zinoviev


Iliya Zinoviev  added the comment:

I suppose isgeneratorfunction,
iscoroutinefunction, isasyncgenfunction were modified to treat partial obj like 
regular function. But then without modifying isfunction as well, this approach 
won't work in full measure.

--

___
Python tracker 

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



[issue46722] Different behavior for functiools.partial between inspect.isfunction() and other inspect.is*function()

2022-02-12 Thread Iliya Zinoviev


Iliya Zinoviev  added the comment:

Kevin, thanks for answer!

In that case, I may conclude isgeneratorfunction,
iscoroutinefunction, isasyncgenfunction from python3.7 are more determinated, 
in my view, cause partial obj has `func` attr for interaction with these funcs 
anyway, so it isn't need of an alternative.

--

___
Python tracker 

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



[issue46700] wrong nomenclature (options vs. arguments) in argparse

2022-02-12 Thread Éric Araujo

Éric Araujo  added the comment:

I’m afraid this is a basic decision of argparse, and one of its reasons for 
existing as an rework of optparse.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue46646] `address` arg can be `bytes` for `ip_*` functions in `ipaddress` module

2022-02-12 Thread Éric Araujo

Éric Araujo  added the comment:

Can you dig more to find if the problem is in the code or in the doc?
The PEP to add ipaddress should specify this.

--
nosy: +eric.araujo, pmoody

___
Python tracker 

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



[issue22852] urllib.parse wrongly strips empty #fragment, ?query, //netloc

2022-02-12 Thread Éric Araujo

Éric Araujo  added the comment:

See also #46337

--
nosy: +eric.araujo
versions: +Python 3.11 -Python 3.5

___
Python tracker 

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



[issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior

2022-02-12 Thread Éric Araujo

Éric Araujo  added the comment:

In my idea it would not be a list of things that you have to pass piecemeal to 
request specific behaviour, but another function or a new param (like 
`parse(string, universal=True)`) that implements universal parsing.

We could even handle things like #22852 in that mode (although ironically, 
correct behaviour for that requires having a registry of schemes).

--

___
Python tracker 

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



[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-12 Thread Neil Girdhar


New submission from Neil Girdhar :

class C:
@property
def f(self) -> int:
return 2

class D(C):
pass

D().f = 2

Gives:

Traceback (most recent call last):
  File "/home/neil/src/cmm/a.py", line 10, in 
D().f = 2
AttributeError: can't set attribute 'f'

This can be a pain to debug when the property is buried in a base class.  Would 
it make sense to mention the reason why the attribute can't be set, namely that 
it's on a property without a setter?

--
components: Interpreter Core
messages: 413122
nosy: NeilGirdhar
priority: normal
severity: normal
status: open
title: Please consider mentioning property without setter when an attribute 
can't be set
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



[issue46718] Feature: itertools: add batches

2022-02-12 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue46729] Better str() for BaseExceptionGroup

2022-02-12 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue46729] Better str() for BaseExceptionGroup

2022-02-12 Thread Irit Katriel


New submission from Irit Katriel :

The str() of exception groups currently contains just the msg as passed to the 
constructor. This turned out to be confusing (see 
https://github.com/python/cpython/pull/31270#issuecomment-1036418346).

We should consider whether it is possible to design a more informative str().

Note that the str() is included in the standard traceback, which include the 
line:

f"{type(e)}: {str(e)}"

So str() should not repeat the type, and should not clutter this too much. 
Probably just the msg plus the number of contained leaf exceptions.

PEP 654 needs to be updated with what we do here, and the change needs to be 
approved by the SC.

--
components: Interpreter Core
keywords: 3.2regression
messages: 413121
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Better str() for BaseExceptionGroup
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



[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-12 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-12 Thread DongGeon Lee


Change by DongGeon Lee :


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

___
Python tracker 

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



[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-12 Thread DongGeon Lee


New submission from DongGeon Lee :

I've found that there is an unnecessary double quote. It lost its another pair. 
It needs to be removed.

And I would like to suggest changing its output format in docstring for 
consistency with similar kinds of other methods, if it was not intentional.

--
components: Argument Clinic
messages: 413120
nosy: LeeDongGeon1996, larry
priority: normal
severity: normal
status: open
title: Docstring of combinations_with_replacement for consistency
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



[issue45948] Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)

2022-02-12 Thread miss-islington


miss-islington  added the comment:


New changeset b7a65c939c93e7910abc8c9d4a129ff385714824 by Miss Islington (bot) 
in branch '3.10':
bpo-45948: Remove constructor discrepancy in C version of ElementTree.XMLParser 
(GH-31152)
https://github.com/python/cpython/commit/b7a65c939c93e7910abc8c9d4a129ff385714824


--

___
Python tracker 

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



[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-12 Thread Eryk Sun


Eryk Sun  added the comment:

> The race on := is much smaller than the original race 
> and I suspect in practice will be very hard to hit.

In Windows, the acquire() method of a lock can't be interrupted. Thus, in the 
main thread, an exception from Ctrl+C gets raised as soon as acquire() returns. 
This exception definitely will interrupt the assignment. Here's a workaround:

global scope:

_WINDOWS = _sys.platform == 'win32'

in _wait_for_tstate_lock():

acquired = None

try:
if acquired := lock.acquire(block, timeout):
lock.release()
self._stop()
except:
if _WINDOWS and acquired is None:
acquired = True
if acquired:
lock.release()
self._stop()
raise

This doesn't help in POSIX if the STORE_FAST instruction that assigns 
`acquired` gets interrupted. This can't be distinguished from acquire() itself 
getting interrupted. But at least the window for this is as small as possible.

--
nosy: +eryksun

___
Python tracker 

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



[issue45948] Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)

2022-02-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 168fd6453b5de15236116f9261d64601d92571ac by Jacob Walls in branch 
'main':
bpo-45948: Remove constructor discrepancy in C version of ElementTree.XMLParser 
(GH-31152)
https://github.com/python/cpython/commit/168fd6453b5de15236116f9261d64601d92571ac


--

___
Python tracker 

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



[issue45948] Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)

2022-02-12 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +pitrou

___
Python tracker 

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