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

2022-02-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Should it? Annotated wraps types, and P.args/P.kwargs are not types.

If make Annotated accepting P.args/P.kwargs (and possible other non-types, e.g. 
P), it is a new feature which should be publicly discussed first and 
documented. I do not thing it requires a PEP.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46676] ParamSpec args and kwargs are not equal to themselves.

2022-02-07 Thread Gregory Beauregard


Change by Gregory Beauregard :


--
pull_requests: +29380
pull_request: https://github.com/python/cpython/pull/31210

___
Python tracker 

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



[issue46676] ParamSpec args and kwargs are not equal to themselves.

2022-02-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c8b62bbe46e20d4b6dd556f2fa85960d1269aa45 by Gregory Beauregard in 
branch 'main':
bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203)
https://github.com/python/cpython/commit/c8b62bbe46e20d4b6dd556f2fa85960d1269aa45


--
nosy: +serhiy.storchaka

___
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-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Extension Modules
nosy: +serhiy.storchaka
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8

___
Python tracker 

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



[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Round division would be useful not less than ceil division, if not more. In the 
stdlib it would be used in:

1. The datetime module.
2. Fraction.__round__.

--

___
Python tracker 

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



Aw: Re: Best way to check if there is internet?

2022-02-07 Thread Karsten Hilbert
> Or the internet acquires a new protocol that's designed
> for very-long-latency connections.

That's being worked on already

https://en.wikipedia.org/wiki/NASA_Deep_Space_Network

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


[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Tim Peters


Tim Peters  added the comment:

The `decimal` module intends to be a faithful implementation of external 
standards. The identity

x == (x // y) * y + x % y

isn't a minor detail, it's the dog on which all else is but a tail ;-)

It's why Guido picked -7 // 4 = -2 in Python[1]. That's really not all that 
useful on its own, and does surprise people. But it's necessary so that the 
identity implies -7 % 4 = 1, and _that's_ what drove it all, the desire that 
doing mod wrt a positive int always give a non-negative result.

The identity also implies that, under truncating division, mod returns a result 
with the sign of the dividend rather than of the divisor.

`decimal` implements what the external standards demand integer division do, 
and also integer modulus. The decimal context `divmod()` method returns both at 
once.

The behavior of int div and mod are linked by all standards I'm aware of, 
including by C89 (which didn't define what integer division did in all cases, 
but did demand that - whatever it did - % had to work in a way consistent with 
the named identity).

[1] 
http://python-history.blogspot.com/2010/08/why-pythons-integer-division-floors.html

--

___
Python tracker 

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



[issue46669] Add types.Self

2022-02-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Your suggested signature looks like it's trying to support
> the second invariant, but it doesn't quite: if the types 
> don't match, the type checker will just set T to the 
> common base type of the two arguments.

Is there a way to write the second invariant correctly?

--

___
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-07 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset e959dd9f5c1d8865d4e10c49eb30ee0a4fe2735d by Dong-hee Na in branch 
'main':
bpo-46323 Fix ref leak if ctypes.CFuncPtr raises an error. (GH-31209)
https://github.com/python/cpython/commit/e959dd9f5c1d8865d4e10c49eb30ee0a4fe2735d


--

___
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-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> New learners coming to Python don't know the same things
> as people with experience.

IMO, new learners will be worse off by adding "returns None" to all of the 
builtins.  At best it a distractor.

I work with new learners almost every day.  The issue never arises.  No one 
writes "x = print('hello world')" and they would be worse off if shown such a 
possibility.

One other consideration is that MyPy and the tools that use it (such as 
PyCharm) reject the idea of None as return value.  Their view is that no value 
is returned all.  We don't want the docs to contradict that world view.

  $ cat hello.py
  x = print('hello world')
  $ mypy hello.py
  hello.py:1: error: "print" does not return a value
  Found 1 error in 1 file (checked 1 source file)

--
nosy: +rhettinger

___
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-07 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstinner

PR 31209 is for fixing the leak.

--

___
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-07 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +29379
pull_request: https://github.com/python/cpython/pull/31209

___
Python tracker 

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



[issue46647] `test_functools` unexpected failures when C `_functoolsmodule` is missing

2022-02-07 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

> Or maybe you have other cases to show the functools module will missing 
> unexpectly?

No, I can't think of any :)

Your argument about code churn also makes sense.
But, if we ever are going to refactor this test module, this is something to 
remember of.

Thanks everyone!

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



[issue46159] Segfault when using trace functions in 3.11a3

2022-02-07 Thread Alex Gaynor


Alex Gaynor  added the comment:

It seems to no longer be crashing with alpha5. Hopefully it's actually fixed 
and not merely having a more subtle failure mode.

--

___
Python tracker 

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



[issue46662] Lib/sqlite3/dbapi2.py: convert_timestamp function failed to correctly parse timestamp

2022-02-07 Thread Ned Deily


Change by Ned Deily :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue34191] argparse: Missing subparser error message should be more clear

2022-02-07 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> argparse fails with required subparsers, un-named dest, and 
empty argv

___
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-07 Thread Ned Deily


Change by Ned Deily :


--
nosy: +eli.bendersky, scoder

___
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-07 Thread Dong-hee Na


Dong-hee Na  added the comment:

No leak after if I revert PR 31188 on my local

--

___
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-07 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstinner

PR 31188 cause reference leak, please check

Raised RLIMIT_NOFILE: 256 -> 1024
0:00:00 load avg: 5.38 Run tests sequentially
0:00:00 load avg: 5.38 [1/1] test_ctypes
beginning 6 repetitions
123456
..
test_ctypes leaked [1028, 1026, 1028] references, sum=3082
test_ctypes leaked [2, 1, 3] memory blocks, sum=6
test_ctypes failed (reference leak)

== Tests result: FAILURE ==

1 test failed:
test_ctypes

Total duration: 3.2 sec
Tests result: FAILURE

--

___
Python tracker 

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



[issue45413] Add install scheme for virtual environments

2022-02-07 Thread Filipe Laíns

Filipe Laíns  added the comment:

I agree.

--

___
Python tracker 

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



[issue46543] Add sys._getfunc

2022-02-07 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

> Usually the calling function object should be enough.

I want to at least provide some historical context on why sys._getframe() 
exists.  I originally wrote that to support PEP 292 and internationalization in 
Mailman.  This has since been extracted into the flufl.i18n package.  Here is 
the use of sys._getframe() in that library:

https://gitlab.com/warsaw/flufl.i18n/-/blob/main/src/flufl/i18n/_translator.py#L65

You can see that the reason this exists is to dig out the local and globals of 
the context in which the _() function is invoked.  This greatly reduces the 
need to repeat yourself in i18n call sites.

https://flufli18n.readthedocs.io/en/stable/using.html#substitutions-and-placeholders

I'm not saying sys._getfunc() is or isn't useful, but it won't change original 
need for sys._getframe().

--
nosy: +barry

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 12:20, Ethan Furman  wrote:
>
> On 2/7/22 4:27 PM, Greg Ewing wrote:
>  > 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.
>
> RocketNet -- a massive store-and-forward protocol.  ;-)
>

Definitely possible. Though wouldn't a rocket scientist call it
"store-and-prograde"? :)

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


Re: Best way to check if there is internet?

2022-02-07 Thread Michael Torrie
On 2/7/22 12:51, 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.
> 
> On the other hand, it also wouldn't surprise me if we do everything at
> a high level instead - have a Martian PyPI mirror, Debian package
> mirror, etc, etc, etc - and then build a mirror synchronization
> protocol that uses UDP.
> 
> Either way, though: would a person on Mars "have the internet"? Yes,
> but not the internet as we know it...

Fun fact.  The team running the Ingenuity helicopter on mars has shell
access to Linux running on the copter.  Obviously not interactive in the
normal sense of course, but they can batch shell commands and pass them
through the communication network to the rover, which relays them to the
copter.  Standard out is relayed back to earth at the next opportunity.
 Currently they use this remote shell access to compress all the images
after each flight and use ffmpeg to create video sequences from stills
on the copter computer itself.  They also used it to do some hacks to
temporarily fix the watchdog timing issue they had initially.  One of
the Linux gurus on the project has given several interviews to the Linux
Unplugged podcast. Fastinating stuff!

It's likely they have a python interpreter onboard as well.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Decimal is a good question.

Why does floor division not do floor division on Decimal? The 
documentation says

The integer division operator // behaves analogously, returning the 
integer part of the true quotient (truncating towards zero) rather 
than its floor, so as to preserve the usual identity 
x == (x // y) * y + x % y

but it's not clear why that identity is more important than floor 
division returning the floor.

I guess we could just document the difference and maybe add a 
Decimal ceildiv method, although that makes me sad :-(

Could we "fix" Decimal?

--

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-07 Thread Ethan Furman

On 2/7/22 4:27 PM, Greg Ewing wrote:
> 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.

RocketNet -- a massive store-and-forward protocol.  ;-)

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


Re: Best way to check if there is internet?

2022-02-07 Thread Greg Ewing

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.

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


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

2022-02-07 Thread miss-islington


miss-islington  added the comment:


New changeset da576e08296490e94924421af71001bcfbccb317 by Jason Wilkes in 
branch 'main':
bpo-46678: Fix Invalid cross device link in Lib/test/support/import_helper.py 
(GH-31204)
https://github.com/python/cpython/commit/da576e08296490e94924421af71001bcfbccb317


--

___
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-07 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +29378
pull_request: https://github.com/python/cpython/pull/31207

___
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-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29377
pull_request: https://github.com/python/cpython/pull/31206

___
Python tracker 

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



[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks you. I think it's reasonable to reject the feature request and instead 
update the docs, so let's do that.

--

___
Python tracker 

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



[issue43557] Deprecate getdefaultlocale(), getlocale() and normalize() functions

2022-02-07 Thread STINNER Victor


Change by STINNER Victor :


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

___
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-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7a0486eaa98083e0407ff491872db6d7a0da2635 by Victor Stinner in 
branch 'main':
bpo-46659: calendar uses locale.getlocale() (GH-31166)
https://github.com/python/cpython/commit/7a0486eaa98083e0407ff491872db6d7a0da2635


--

___
Python tracker 

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



[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Irit Katriel


Irit Katriel  added the comment:

To summarise the discussion so far:

The arguments in favour of changing exception matching to match on virtual base 
classes are:

1. It is confusing that it doesn't follow issubclass semantics.
2. Two use cases were presented as practical motivation.
   - one in msg135521, which can be solved with the pattern in msg200418
   - one in msg200829, which is typically done with
 except:
 if condition:
  handle
 raise

The arguments against the change are
1. safety - calling python code from the exception propagation code
2. possible performance impact


I am not too worried about the performance of exception handling. I am also not 
impressed by the use cases.

For me it's mostly between the safety issue and the aesthetic language 
consistency issue. 

The code path from when a RAISE opcode executes and until control passes to an 
except clause, is a very sensitive one and I have a lot of sympathy to the 
position that we should just change the documentation to say that matching is 
on non-virtual base classes.  It is much easier to implement this feature than 
to predict how it would behave in all cases.

If we do decide to implement this, then I don't think the patch is the way we 
should do it. If the IsSubclass call fails, this should result in a "goto 
error", like when the match type is invalid: 
https://github.com/python/cpython/blob/7ba1cc8049fbcb94ac039ab02522f78177130588/Python/ceval.c#L3831

This means that the failure to determine whether the exception is a match is 
the dominant error, rather than something we print to the ether via the 
unraisablehook and interpret as non-match.

--

___
Python tracker 

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



[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Michael McCoy


Michael McCoy  added the comment:

Checking my comment history here, a past me was terribly bad at linking the
correct PR on github.This is the correct link:
https://github.com/python/cpython/pull/6461

On Mon, Feb 7, 2022 at 10:12 AM Guido van Rossum 
wrote:

>
> Guido van Rossum  added the comment:
>
> Fixing the version field. Since it's a feature, this could not go into any
> version before 3.11.
>
> Maybe Irit can look through the discussion and patch and see if there's
> value to doing this? (Feel free to decline!)
>
> --
> nosy: +iritkatriel
> versions: +Python 3.11 -Python 3.4, Python 3.5, Python 3.6, Python 3.7,
> Python 3.8, Python 3.9
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



Re: Logging user activity

2022-02-07 Thread Cameron Simpson
On 06Feb2022 23:30, blessy carol  wrote:
>I have this task where I have to create log files to record user 
>activity whenever they make an entry or view something. Also, I have to 
>create Database log file whenever someone accessed or manipulated the 
>data in the database. The code is written python and used django 
>framework. I've connected django with oracle cloud database. So now I 
>want to if the basic logging details can be used to store the record of 
>these activities in the log file in the server. It  would be of great 
>help.

For the file, you can do that directly in the logging configuration - 
there's a FileHandler with a bunch of configuration options (like 
rolling over to a new file etc). Hook that to your logging setup.

For the db side, make a Djanog Model for your log table and write your 
own logging handler which makes new instance of the model containing log 
information. There might even by a prebuilt Django logging thing 
available for that - I haven't looked.

We had a "log everything!" requests for a project here.

I made a generic AuditLog Django model for this. It has a timestamp, a 
description, a log_type PositiveIntegerField, a user field (because we 
were tracking things by User, can be NULL for things not driven by a 
User eg app internals), a parent (ForeignKey to the AuditLog model so 
you can make hierarchical related log entries), and an:

entity = GenericForeignKey("entity_type", "entity_uuid")

which was a reference to some "primary" entity (Model instance) 
elsewhere where that was relevant, and a couple of JSON fields for state 
information.

This is massive overkill for your needs, but we only wanted to do this 
once, so needs like yours also use this model here.

Then you can write simple log calls which make model instances with what 
you need to log in them.

The only only real catch for us was transactions - if something fails 
and rolls back the transaction it also throws away the log entries 
because they're in the transaction. For your needs that is probably 
fine.

For us, we want to use it for error tracking/diagnosis too, so I've got 
a ticket to hand the logging to a distinct Thread (which magicly makes a 
distinct db connection, outside the transaction). That way the logging 
can survive a transaction rollback.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 09:31, <2qdxy4rzwzuui...@potatochowder.com> wrote:
>
> On 2022-02-08 at 06:51:20 +1100,
> Chris Angelico  wrote:
>
> > Either way, though: would a person on Mars "have the internet"? Yes,
> > but not the internet as we know it...
>
> By current definition, they *can't* have the internet as we know it.
>
> Wikipedia,¹ Mirrian-Webster,² and TechTerms.com³ (the first three that
> came up in my search engine, which is admittedly Earthbound for now) all
> use words like "global" and phrases like "across the world" or "around
> the world," all of which arguably exclude Mars, or at least a network
> that covers both Earth and Mars.
>

Yes, well, globally-unique IDs are probably going to be
universally-unique IDs too, but we're not hugely bothered by that.
Remember, you can get targeted advertising on the ISS too...

https://xkcd.com/713/

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


[issue46282] return value of builtins is not clearly indicated

2022-02-07 Thread Ned Batchelder


Ned Batchelder  added the comment:

> When you state the obvious...

Obvious to who? New learners coming to Python don't know the same things as 
people with experience.

--
nosy: +nedbat

___
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-07 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

My preference would be for --with-mimalloc=yes in an upcoming release. For 
platforms without the required stdatomic.h stuff, they can manually specify 
--with-mimalloc=no.  That will make them aware that a future release of Python 
might no longer build (if mimalloc is no longer optional).

A soft-landing for merging nogil is not a good enough reason to merge mimalloc, 
IMHO.  nogil may never be merged.  There should be some concrete and immediate 
advantage to switch to mimalloc.  The idea of using the "heap walking" to 
improve is cyclic GC is not concrete enough.  It's just an idea at this point.

I think the (small) performance win could be enough of a reason to merge.  This 
seems to be the most recent benchmark:

https://gist.github.com/pablogsal/8027937b71cd30f175ef7c885d3e

There is also the long-term maintenance issue.  So far, mimalloc upstream has 
been responsive.  The mimalloc code is not so huge or complicated that we 
couldn't maintain it (if for some reason it gets abandoned upstream).  However, 
I think we would prefer to maintain obmalloc rather than mimalloc, all else 
being equal.  Abandonment by the upstream seems fairly unlikely.  So, I'm not 
too concerned about maintenance.

--

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-07 Thread 2QdxY4RzWzUUiLuE
On 2022-02-08 at 06:51:20 +1100,
Chris Angelico  wrote:

> Either way, though: would a person on Mars "have the internet"? Yes,
> but not the internet as we know it...

By current definition, they *can't* have the internet as we know it.

Wikipedia,¹ Mirrian-Webster,² and TechTerms.com³ (the first three that
came up in my search engine, which is admittedly Earthbound for now) all
use words like "global" and phrases like "across the world" or "around
the world," all of which arguably exclude Mars, or at least a network
that covers both Earth and Mars.

IMO, Mars and its current and future living beings are better off
without the World Wide Web, too.

¹ https://en.wikipedia.org/wiki/Internet
² https://www.merriam-webster.com/dictionary/Internet
³ https://techterms.com/definition/internet
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Logging user activity

2022-02-07 Thread Peter J. Holzer
On 2022-02-06 23:30:41 -0800, blessy carol wrote:
> I have this task where I have to create log files to record user
> activity whenever they make an entry or view something. Also, I have
> to create Database log file whenever someone accessed or manipulated
> the data in the database. The code is written python and used django
> framework. I've connected django with oracle cloud database. So now I
> want to if the basic logging details can be used to store the record
> of these activities in the log file in the server.

There are three places where you can do that in a centralized manner:

1. In the database itself. AFAIK Oracle has an audit system, but I've
   never used it.
2. At the Django ORM layer. Django has the ability to log all database
   queries it makes
3. At the web request level. Your web server (probably) already logs
   every request but not necessarily the information you are interested
   in. But you could write a piece of middleware for your Django which
   extracts log-worthy information and logs that.

The first two options are probably too low-level, and especially the
second is really hard to interpret in an automated manner (which is what
you probably want to do - otherwise why log in the first place?)

So I'd try the third option. But it really depends a lot on the
structure of your application on whether it's feasible to extract all
the data you need at that point. It's possible that you will have to go
through all the views in your app, see what data they are requesting and
altering and craft appropriate log messages for each.

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


[issue46648] `test.test_urllib2.MiscTests.test_issue16464` flaky due to external connection

2022-02-07 Thread STINNER Victor


STINNER Victor  added the comment:

I close again the issue. The 3.8 backport is waiting for the Python 3.8 Release 
Manager approval.

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



[issue45413] Add install scheme for virtual environments

2022-02-07 Thread Steve Dower


Steve Dower  added the comment:

I think we want the scheme to be static and accessible on all platforms, like 
the others. So it probably should be 'nt_venv' and 'posix_venv' with 
additional/improved logic to help apps determine when they need each.

--
nosy: +steve.dower

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 08:30, Cameron Simpson  wrote:
>
> On 08Feb2022 06:51, 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.
>
> The TCP ESTABLISHED state has no timeouts at all (though intemediate
> stateful things can get bored).  The setup/teardown do though :-)

That's what I mean - not a lot of point trying to establish a TCP
socket if the other end will give up on you after a mere ninety
seconds. It's extremely convenient that an established connection
lasts forever until touched in some way (even across reconfigurations
of the network - which is how you can redo a server's network over
SSH), but first you have to get to that!

> But
> they can be proxied. Our previous satellite modem proxied TCP locally
> and ran a more-suitable-satellite protocol from the modem to the
> downstation, where it became TCP again and went on its way.

Yup. I'm not sure whether we'll proxy TCP, proxy HTTP, or have high
level mirrors, but one way or another, people on Mars will want their
internets plsthx.

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


Re: Best way to check if there is internet?

2022-02-07 Thread Cameron Simpson
On 08Feb2022 06:51, 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.

The TCP ESTABLISHED state has no timeouts at all (though intemediate 
stateful things can get bored).  The setup/teardown do though :-) But 
they can be proxied. Our previous satellite modem proxied TCP locally 
and ran a more-suitable-satellite protocol from the modem to the 
downstation, where it became TCP again and went on its way.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46679] test.support.wait_process ignores timeout argument

2022-02-07 Thread Jason Wilkes


Change by Jason Wilkes :


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

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-07 Thread Cameron Simpson
On 07Feb2022 11:40, Grant Edwards  wrote:
>Ah, c'mon... Every geek worth his salt knows a few real world IP
>addresses without relying on DNS. If you want to "ping Google", it's
> $ ping 8.8.8.8
> $ ping 8.8.4.4

And Cloudflare is 1.1.1.1. Speaking as someone who's seen his upstream 
provider have good G connectivity and degraded C connectiviy :-(

>If that doesn't work, then you ask 'route -n' for the IP address of
>the default gateway,

I tend to just check for the presence of the default route for services 
which should be "up" when there's internet. (Persistent ssh tunnels, in 
the main.) Not even a ping.

Some of those tunnels are further conditioned on a specific ping.

"ping -c 5 -q ip-addr-here" can be a simple Boolean test.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46679] test.support.wait_process ignores timeout argument

2022-02-07 Thread Jason Wilkes


New submission from Jason Wilkes :

The function wait_process in Lib/test/support/__init__.py ignores its timeout 
argument. This argument is useful, for example, in tests that need to determine 
whether a deadlock has been fixed (e.g., in PR-30310). Will submit a pull 
request to fix this.

--
components: Tests
messages: 412793
nosy: notarealdeveloper
priority: normal
severity: normal
status: open
title: test.support.wait_process ignores timeout argument
type: behavior
versions: Python 3.10, 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: Best way to check if there is internet?

2022-02-07 Thread Grant Edwards
On 2022-02-07, Dennis Lee Bieber  wrote:
> On Mon, 07 Feb 2022 11:40:24 -0800 (PST), Grant Edwards
> declaimed the following:
>
>>On 2022-02-07, Dennis Lee Bieber  wrote:
>>
>>> Also, for a machine freshly booted, with no cache, even pinging
>>> Google first requires making contact with a DNS server to ask for
>>> Google's IP address. With no network, the DNS look-up will fail
>>> before ping even tries to hit Google.
>>
>>Ah, c'mon... Every geek worth his salt knows a few real world IP
>>addresses without relying on DNS. If you want to "ping Google", it's
>>
>> $ ping 8.8.8.8
>>or
>> $ ping 8.8.4.4
>>
>
> Which happen to be Google's DNS servers -- not what most think of as
> "Google"

Right. So even asking "do you have Google" is too vague. :)

> Manipulates network routing tables.

Sorry, I didn't know that the Windows "route" command didn't recognize the
standard -n option.

--
Grant

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


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

2022-02-07 Thread Jason Wilkes


Change by Jason Wilkes :


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

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-07 Thread Dennis Lee Bieber
On Mon, 07 Feb 2022 11:40:24 -0800 (PST), Grant Edwards
 declaimed the following:

>On 2022-02-07, Dennis Lee Bieber  wrote:
>
>> Also, for a machine freshly booted, with no cache, even pinging
>> Google first requires making contact with a DNS server to ask for
>> Google's IP address. With no network, the DNS look-up will fail
>> before ping even tries to hit Google.
>
>Ah, c'mon... Every geek worth his salt knows a few real world IP
>addresses without relying on DNS. If you want to "ping Google", it's
>
> $ ping 8.8.8.8
>or
> $ ping 8.8.4.4
>

Which happen to be Google's DNS servers -- not what most think of as
"Google"

C:\Users\Wulfraed>ping www.google.com -4

Pinging www.google.com [142.251.45.36] with 32 bytes of data:
...


>:)
>
>If that doesn't work, then you ask 'route -n' for the IP address of
>the default gateway, and try pinging that. It's possible your default
>gateway is alive but configured to ignore ICMP ping requests, but I've
>never run into one like that.
>

No "route -n" here...

C:\Users\Wulfraed>route -n

Manipulates network routing tables.

ROUTE [-f] [-p] [-4|-6] command [destination]
  [MASK netmask]  [gateway] [METRIC metric]  [IF interface]

  -f   Clears the routing tables of all gateway entries.  If this
is
   used in conjunction with one of the commands, the tables are
   cleared prior to running the command.

  -p   When used with the ADD command, makes a route persistent
across
   boots of the system. By default, routes are not preserved
   when the system is restarted. Ignored for all other
commands,
   which always affect the appropriate persistent routes.

  -4   Force using IPv4.

  -6   Force using IPv6.

  command  One of these:
 PRINT Prints  a route
 ADD   Addsa route
 DELETEDeletes a route
 CHANGEModifies an existing route
  destination  Specifies the host.
  MASK Specifies that the next parameter is the 'netmask' value.
  netmask  Specifies a subnet mask value for this route entry.
   If not specified, it defaults to 255.255.255.255.
  gateway  Specifies gateway.
  interfacethe interface number for the specified route.
  METRIC   specifies the metric, ie. cost for the destination.
...


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46534] Implementing PEP 673 (Self type)

2022-02-07 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 7ba1cc8049fbcb94ac039ab02522f78177130588 by James Hilton-Balfe in 
branch 'main':
bpo-46534: Implement PEP 673 Self in typing.py (GH-30924)
https://github.com/python/cpython/commit/7ba1cc8049fbcb94ac039ab02522f78177130588


--

___
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-07 Thread Jason Wilkes


New submission from Jason Wilkes :

In Lib/test/support/import_helper.py, the function make_legacy_pyc makes a call 
to os.rename which can fail when the source and target live on different 
devices. This happens (for example) when PYTHONPYCACHEPREFIX is set to a 
directory on a different device from where temporary files are stored. 
Replacing os.rename with shutil.move fixes it. Will submit a PR.

--
components: Tests
messages: 412791
nosy: notarealdeveloper
priority: normal
severity: normal
status: open
title: Invalid cross device link in Lib/test/support/import_helper.py
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue46648] `test.test_urllib2.MiscTests.test_issue16464` flaky due to external connection

2022-02-07 Thread miss-islington


miss-islington  added the comment:


New changeset 9539400390494f4930c245b3f98453592f4a1a8c by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-46648: Rewrite test_urllib2.test_issue16464() with a local HTTP 
server (GH-31186) (GH-31189)
https://github.com/python/cpython/commit/9539400390494f4930c245b3f98453592f4a1a8c


--

___
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-07 Thread Éric Araujo

Éric Araujo  added the comment:

Using a substitution is necessary when we need code markup and a link.

For this bug, the simple ~ markup will be enough.

--

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 06:41, Grant Edwards  wrote:
> But, as has been pointed out previously "if there is internet" is too
> vague a question to have an answer.
>
> If all you have is proxied access to outside HTTPS servers, then I
> would consider the answer to be "no", but most people would say "yes"
> they have internet.

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.

On the other hand, it also wouldn't surprise me if we do everything at
a high level instead - have a Martian PyPI mirror, Debian package
mirror, etc, etc, etc - and then build a mirror synchronization
protocol that uses UDP.

Either way, though: would a person on Mars "have the internet"? Yes,
but not the internet as we know it...

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


Re: Openning Python program

2022-02-07 Thread Chris Angelico
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.

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


Re: Openning Python program

2022-02-07 Thread Cecil Westerhof via Python-list
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.

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


[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Irit Katriel

Irit Katriel  added the comment:

Fine, I’ll reopen it for 3.9. However, realistically the release managers are 
unlikely to investigate how this bug got fixed between 3.9 and 3.11 so if you 
think this is important you might want to do that work.

--
resolution: out of date -> 
status: closed -> open
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue46669] Add types.Self

2022-02-07 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

The conventional way is to write

def __exit__(
self,
__typ: type[BaseException] | None,
__exc: BaseException | None,
__tb: types.TracebackType | None,
) -> None: ...

But there are two invariants about how __exit__ works in practice that this 
doesn't capture:
1. The arguments are either all None, or none of them are
2. If they are not None, then the typ argument is the type of the exception 
passed to the exc argument

I believe these invariants are always true in 3.11 thanks to Irit's work, but 
previously there could be rare circumstances where they didn't hold. You 
probably know the details better than I do.

We could support the first invariant by using two overloads, one where the 
arguments are all None and one where they aren't. I don't think that's 
generally worth doing though: it's a lot of verbose code and doesn't fix many 
real problems.

Your suggested signature looks like it's trying to support the second 
invariant, but it doesn't quite: if the types don't match, the type checker 
will just set T to the common base type of the two arguments.

--

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-07 Thread Grant Edwards
On 2022-02-07, Dennis Lee Bieber  wrote:

> Also, for a machine freshly booted, with no cache, even pinging
> Google first requires making contact with a DNS server to ask for
> Google's IP address. With no network, the DNS look-up will fail
> before ping even tries to hit Google.

Ah, c'mon... Every geek worth his salt knows a few real world IP
addresses without relying on DNS. If you want to "ping Google", it's

 $ ping 8.8.8.8
or
 $ ping 8.8.4.4

:)

If that doesn't work, then you ask 'route -n' for the IP address of
the default gateway, and try pinging that. It's possible your default
gateway is alive but configured to ignore ICMP ping requests, but I've
never run into one like that.

But, as has been pointed out previously "if there is internet" is too
vague a question to have an answer.

If all you have is proxied access to outside HTTPS servers, then I
would consider the answer to be "no", but most people would say "yes"
they have internet.

If all you have is NAT'ed outbound TCP connections, even more people
would say "yes they have internet", but I would still answer "partially".

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


[issue20779] Add pathlib.chown method

2022-02-07 Thread Jaspar S.


Jaspar S.  added the comment:

I would love to use chown for a pathlib Path, too.

It may not be used often, but if anyone want's to change all the os references 
from a file, it would be cool to have it on pathlib!

--
nosy: +y0urself

___
Python tracker 

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



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

2022-02-07 Thread Christian Gollwitzer

Hi all,

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?


Most resources I found for distutils describe either building an 
extension or pure python modules. Currently I have a structure like this:


ABCD/__init__.py
ABCD/main.py
ccode/some.c
ccode/some.h
ccode/Makefile

The Makefile compiles the C code and creates ABCD/some.so, which 
"main.py" then imports. This works, but not e.g. on Windows and it's not 
integrated into pip, of course.


We're soon going to publish the package as open source code and it would 
be great to do "pip install ABCD" ultimately. Is there a simple example 
out there how to achieve this?


Additionally, we use OpenMP in the C code for parallelism. This is easy 
in the Makefile, one has to pass "-fopenmp" to gcc and "/openmp" to 
msvc. Is there a way to set this flag automatically depending on the 
compiler?


Best regards,

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


[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Andy S


Andy S  added the comment:

Then maybe those RMs (for 3.9 and 3.10) should decide on their own? That should 
mean the bug should be reopened for them to get assigned to.

--

___
Python tracker 

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



[issue46677] TypedDict docs are incomplete

2022-02-07 Thread Jelle Zijlstra


New submission from Jelle Zijlstra :

https://docs.python.org/3.10/library/typing.html#typing.TypedDict

It says:

> To allow using this feature with older versions of Python that do not support 
> PEP 526, TypedDict supports two additional equivalent syntactic forms

But there is another reason to use the equivalent forms: if your keys aren't 
valid Python names. There's an example in typeshed that uses "in" (a keyword) 
as a TypedDict key, and I've seen others with keys that have hyphens in them.

Also:

- The docs mention attributes like `__required_keys__`, but don't clearly say 
what is in these attributes. We should document them explicitly with the 
standard syntax for attributes.
- There is no mention of one TypedDict inheriting from another.

--
assignee: docs@python
components: Documentation
messages: 412784
nosy: 97littleleaf11, AlexWaygood, Jelle Zijlstra, docs@python, sobolevn
priority: normal
severity: normal
status: open
title: TypedDict docs are incomplete
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Irit Katriel


Irit Katriel  added the comment:

It depends how risky the 3.9 release manager would consider the fix to be. The 
first step would be to find out which commit(s) fixed it.

--

___
Python tracker 

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



[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Andy S


Andy S  added the comment:

Can reproduce this on 3.9. Is the fact 3.9 is in `bugfix` status enough to 
backport any fixing changes from 3.11 (if that's true and the bug was fixed)?

--

___
Python tracker 

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



[issue46676] ParamSpec args and kwargs are not equal to themselves.

2022-02-07 Thread Gregory Beauregard


Change by Gregory Beauregard :


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

___
Python tracker 

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



[issue46676] ParamSpec args and kwargs are not equal to themselves.

2022-02-07 Thread Gregory Beauregard


New submission from Gregory Beauregard :

from typing import ParamSpec
P = ParamSpec("P")
print(P.args == P.args)  # False
print(P.kwargs == P.kwargs)  # False

ParamSpec args and kwargs are not equal to themselves; this can cause problems 
for unit tests and type introspection w/ e.g. `get_type_hints`.

I will fix this by adding an __eq__ method like other places in typing.py

--
components: Library (Lib)
messages: 412781
nosy: GBeauregard, Jelle Zijlstra
priority: normal
severity: normal
status: open
title: ParamSpec args and kwargs are not equal to themselves.
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Couldn't math.ceildiv(x, y) be implemented as -(-x//y) in a type-agnostic 
> fashion?

Ah, good point. Yes, that could work.

We'd have to decide what to do about Decimal if we took this approach, since 
the -(-x//y) trick doesn't work there. (Document the issue? Try to make things 
work for Decimal?)

--

___
Python tracker 

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



[issue46667] SequenceMatcher & autojunk - false negative

2022-02-07 Thread Tim Peters


Tim Peters  added the comment:

We can't change defaults without superb reason - Python has millions of users, 
and changing the output of code "that works" is almost always a non-starter.

Improvements to the docs are welcome.

In your example, try running this code after using autojunk=True:

pending = ""
for ch in first:
if ch in sm.bpopular:
if pending:
print(repr(pending))
pending = ""
else:
pending += ch
print(repr(pending))

That shows how `first` is effectively broken into tiny pieces given that the 
"popular" chaaracters act like walls. Here's the start of the output:

'\nUN'
'QUESTR'
'NG\nL'
'x'
'f'
'.'
'L'
'b'
"'"
'x'
'v'
'1500'
','

and on & on. `QUESTER' is the longest common contiguous substring remaining.

--

___
Python tracker 

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



[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Guido van Rossum


Guido van Rossum  added the comment:

Fixing the version field. Since it's a feature, this could not go into any 
version before 3.11.

Maybe Irit can look through the discussion and patch and see if there's value 
to doing this? (Feel free to decline!)

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 
3.8, Python 3.9

___
Python tracker 

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



[issue46669] Add types.Self

2022-02-07 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Implementing PEP 673 (Self type)

___
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-07 Thread Eryk Sun


Eryk Sun  added the comment:

> I don't think that this fallback is needed anymore. Which Windows
> code page can be used as ANSI code page which is not already 
> implemented as a Python codec?

Python has full coverage of the ANSI and OEM code pages in the standard Windows 
locales, but I don't have any experience with custom (i.e. supplemental or 
replacement) locales.

https://docs.microsoft.com/en-us/windows/win32/intl/custom-locales 

Here's a simple script to check the standard locales.

import codecs
import ctypes
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)

LOCALE_ALL = 0
LOCALE_WINDOWS = 1
LOCALE_IDEFAULTANSICODEPAGE = 0x1004
LOCALE_IDEFAULTCODEPAGE = 0x000B # OEM

EnumSystemLocalesEx = kernel32.EnumSystemLocalesEx
GetLocaleInfoEx = kernel32.GetLocaleInfoEx
GetCPInfoExW = kernel32.GetCPInfoExW

EnumLocalesProcEx = ctypes.WINFUNCTYPE(ctypes.c_int,
ctypes.c_wchar_p, ctypes.c_ulong, ctypes.c_void_p)

class CPINFOEXW(ctypes.Structure):
 _fields_ = (('MaxCharSize', ctypes.c_uint),
 ('DefaultChar', ctypes.c_ubyte * 2),
 ('LeadByte', ctypes.c_ubyte * 12),
 ('UnicodeDefaultChar', ctypes.c_wchar),
 ('CodePage', ctypes.c_uint),
 ('CodePageName', ctypes.c_wchar * 260))

def get_all_locale_code_pages():
result = []
seen = set()
info = (ctypes.c_wchar * 100)()

@EnumLocalesProcEx
def callback(locale, flags, param):
for lctype in (LOCALE_IDEFAULTANSICODEPAGE, 
LOCALE_IDEFAULTCODEPAGE):
if (GetLocaleInfoEx(locale, lctype, info, len(info)) and
  info.value not in ('0', '1')):
cp = int(info.value)
if cp in seen:
continue
seen.add(cp)
cp_info = CPINFOEXW()
if not GetCPInfoExW(cp, 0, ctypes.byref(cp_info)):
cp_info.CodePage = cp
cp_info.CodePageName = str(cp)
result.append(cp_info)
return True

if not EnumSystemLocalesEx(callback, LOCALE_WINDOWS, None, None):
raise ctypes.WinError(ctypes.get_last_error())

result.sort(key=lambda x: x.CodePage)
return result

supported = []
unsupported = []
for cp_info in get_all_locale_code_pages():
cp = cp_info.CodePage
try:
codecs.lookup(f'cp{cp}')
except LookupError:
unsupported.append(cp_info)
else:
supported.append(cp_info)

if unsupported:
print('Unsupported:\n')
for cp_info in unsupported:
print(cp_info.CodePageName)
print('\nSupported:\n')
else:
print('All Supported:\n')
for cp_info in supported:
print(cp_info.CodePageName)


Output:

All Supported:

437   (OEM - United States)
720   (Arabic - Transparent ASMO)
737   (OEM - Greek 437G)
775   (OEM - Baltic)
850   (OEM - Multilingual Latin I)
852   (OEM - Latin II)
855   (OEM - Cyrillic)
857   (OEM - Turkish)
862   (OEM - Hebrew)
866   (OEM - Russian)
874   (ANSI/OEM - Thai)
932   (ANSI/OEM - Japanese Shift-JIS)
936   (ANSI/OEM - Simplified Chinese GBK)
949   (ANSI/OEM - Korean)
950   (ANSI/OEM - Traditional Chinese Big5)
1250  (ANSI - Central Europe)
1251  (ANSI - Cyrillic)
1252  (ANSI - Latin I)
1253  (ANSI - Greek)
1254  (ANSI - Turkish)
1255  (ANSI - Hebrew)
1256  (ANSI - Arabic)
1257  (ANSI - Baltic)
1258  (ANSI/OEM - Viet Nam)

Some locales are Unicode only (e.g. Hindi-India) or have no OEM code page, 
which the above code skips by checking for "0" or "1" as the code page value. 
Windows 10+ allows setting the system locale to a Unicode-only locale, for 
which it uses UTF-8 (65001) for ANSI and OEM.

The OEM code page matters because the console input and output code pages 
default to OEM, e.g. for os.device_encoding(). The console's I/O code pages are 
used in Python by low-level os.read() and os.write(). Note that the console 
doesn't properly implement using UTF-8 (65001) as the input code page. In this 
case, input read from the console via ReadFile() or ReadConsoleA() has a null 
byte in place of each non-ASCII character.

--

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2022-02-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29372
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/31201

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2022-02-07 Thread rdb


Change by rdb :


--
nosy: +rdb

___
Python tracker 

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



[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Václav Dvořák

Change by Václav Dvořák :


--
versions: +Python 3.9

___
Python tracker 

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



Re: Openning Python program

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 04:30, Cecil Westerhof via Python-list
 wrote:
>
> Chris Angelico  writes:
>
> > On Tue, 8 Feb 2022 at 02:53, Grant Edwards  
> > wrote:
> >>
> >> On 2022-02-06, Dennis Lee Bieber  wrote:
> >> > On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
> >> > declaimed the following:
> >> >
> >> >>   I cannot open python after downloading it keeps going to 
> >> >> modify/uninstall
> >> >>   ?? please help
> >> >
> >> > Stop clicking on the INSTALLER. What you downloaded is just the program
> >> > that installs and configures Python on your system. Stuff it away 
> >> > someplace
> >> > safe should you need to modify the current installation, but otherwise 
> >> > just
> >> > forget that it exists.
> >>
> >> This is _still_ a problem after all these years and countless
> >> identical complaints?
> >>
> >> How difficult would it be to add a few lines of text to the installer
> >> welcome screen explaining that you've just started the Python
> >> INSTALLER, and if you've already done the installation and want to
> >> "run Python" try ?
> >>
> >
> > 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.

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


[issue45459] Limited API support for Py_buffer

2022-02-07 Thread STINNER Victor


STINNER Victor  added the comment:

> There's some side effects with "buffer.h" inclusion in Panda3D when building 
> againt 3.11a5, project manager concerns are here 
> https://github.com/python/cpython/pull/29991#issuecomment-1031731100

Copy of rdb's message:
"""
This change broke our project build because when cpython/object.h is including 
buffer.h it is forcing it to resolve along the search path, and the compiler is 
hitting the buffer.h in our project rather than the one in the Python include 
directory.

Should it not be using a relative include, ie. #include "../buffer.h" ? I think 
otherwise this change will cause breakage for many projects given how common 
the header name "buffer.h" may be.
"""

In Python.h, buffer.h is included before object.h. But object.h includes 
buffer.h. I suggest to include buffer.h before object.h and remove #include 
"buffer.h" from Include/cpython/buffer.h.

Also, I agree that renaming buffer.h to pybuffer.h would reduce issues like 
that. Moreover, this header file exposes the "Py_buffer" API, so "pybuffer.h" 
sounds like a better name ;-)

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



[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset 76b072717a160c44cb8d54be3d5e878bc31f2c38 by Miss Islington (bot) 
in branch '3.9':
bpo-46638: Makes registry virtualisation setting stable when building MSIX 
packages (GH-31130)
https://github.com/python/cpython/commit/76b072717a160c44cb8d54be3d5e878bc31f2c38


--

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2022-02-07 Thread pmp-p


pmp-p  added the comment:

There's some side effects with "buffer.h" inclusion in Panda3D when building 
againt 3.11a5, project manager concerns are here 
https://github.com/python/cpython/pull/29991#issuecomment-1031731100

--

___
Python tracker 

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



[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread miss-islington


miss-islington  added the comment:


New changeset 9c45390208df712126c59f7c2b6f8d2b4e19ccf7 by Miss Islington (bot) 
in branch '3.10':
bpo-46638: Makes registry virtualisation setting stable when building MSIX 
packages (GH-31130)
https://github.com/python/cpython/commit/9c45390208df712126c59f7c2b6f8d2b4e19ccf7


--

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-07 Thread Dennis Lee Bieber
On Mon, 7 Feb 2022 13:33:54 +0400, Abdur-Rahmaan Janhangeer
 declaimed the following:

>Popular browsers tell: No internet connection detected. A function that
>goes in the same sense. Unless they too are pinging Google.com to check ...
>

Ah, but WHEN do those browsers report that? When attempting to connect
to whatever the default "home" page has been set to? (Mine is configured to
use https://www.google.com as the default page -- if my router is down,
obviously the browser will time-out waiting for a response from Google, and
report "no network").

Pretty much any discovery of "no network" occurs when the application
attempts to make a normal connection to some target -- using whatever
protocol is normal for that application -- and fails to get a response.
ping is not a solution -- it is possible for firewalls to be configured to
drop with no response specific packets. A firewall configured to DROP
rather than REJECT results in a machine that just "isn't there" to outside
poking. That doesn't mean that the network is down -- only that the machine
you tried to poke is ignoring you.

Also, for a machine freshly booted, with no cache, even pinging Google
first requires making contact with a DNS server to ask for Google's IP
address. With no network, the DNS look-up will fail before ping even tries
to hit Google.

Consider that UDP is often used in a "fire and forget" mode -- packets
get sent to the network interface for forwarding, but there is no
expectation that the transport system will return success/failure packets.
For UDP, any such has to be built into the application level protocol(s).
TCP, OTOH, /is/ a "connected" protocol expecting to receive ACK/NAK packets
for each one it sends out. If it doesn't receive either it will, after some
time-out period, declare a broken connection.


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Václav Dvořák

Change by Václav Dvořák :


--
nosy: +Václav Dvořák

___
Python tracker 

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



Logging user activity

2022-02-07 Thread blessy carol
Hi,

I have this task where I have to create log files to record user activity 
whenever they make an entry or view something. Also, I have to create Database 
log file whenever someone accessed or manipulated the data in the database. The 
code is written python and used django framework. I've connected django with 
oracle cloud database. So now I want to if the basic logging details can be 
used to store the record of these activities in the log file in the server. It  
would be of great help. 

Thanks & Regards,
Blessy.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Openning Python program

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

> On Tue, 8 Feb 2022 at 02:53, Grant Edwards  wrote:
>>
>> On 2022-02-06, Dennis Lee Bieber  wrote:
>> > On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
>> > declaimed the following:
>> >
>> >>   I cannot open python after downloading it keeps going to 
>> >> modify/uninstall
>> >>   ?? please help
>> >
>> > Stop clicking on the INSTALLER. What you downloaded is just the program
>> > that installs and configures Python on your system. Stuff it away someplace
>> > safe should you need to modify the current installation, but otherwise just
>> > forget that it exists.
>>
>> This is _still_ a problem after all these years and countless
>> identical complaints?
>>
>> How difficult would it be to add a few lines of text to the installer
>> welcome screen explaining that you've just started the Python
>> INSTALLER, and if you've already done the installation and want to
>> "run Python" try ?
>>
>
> 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.
:'-(

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


[issue46669] Add types.Self

2022-02-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

On a related note, is this the correct way to annotate __exit__?


Exc = TypeVar('Exc', bound=Exception)

def __exit__(self, exctype: Optional[Type[Exc]], excinst: Optional[Exc], exctb: 
Any) -> None:

--

___
Python tracker 

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



[issue41021] ctypes callback with structure crashes in Python 3.8 on Windows x86

2022-02-07 Thread Steve Dower


Steve Dower  added the comment:

Only by following the link I posted and searching for issues that sound like 
this one.

Which I just did for you: https://github.com/libffi/libffi/issues/367

There may be more, though. I just grabbed the first one that looked like a 
match.

--

___
Python tracker 

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



[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset 3a5afc14e16370c1f4f72d43cb553298ad9a1fa4 by Steve Dower in branch 
'main':
bpo-46638: Makes registry virtualisation setting stable when building MSIX 
packages (GH-31130)
https://github.com/python/cpython/commit/3a5afc14e16370c1f4f72d43cb553298ad9a1fa4


--

___
Python tracker 

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



[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29371
pull_request: https://github.com/python/cpython/pull/31200

___
Python tracker 

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



[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +29370
pull_request: https://github.com/python/cpython/pull/31199

___
Python tracker 

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



[issue46072] Unify handling of stats in the CPython VM

2022-02-07 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 9c979d7afd839abbb080028bdfeb73727e5cf633 by Mark Shannon in 
branch 'main':
bpo-46072: Merge dxpairs into py_stats. (GH-31197)
https://github.com/python/cpython/commit/9c979d7afd839abbb080028bdfeb73727e5cf633


--

___
Python tracker 

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



Re: Openning Python program

2022-02-07 Thread Grant Edwards
On 2022-02-07, Barry  wrote:
>> On 7 Feb 2022, at 15:55, Grant Edwards  wrote:
>> On 2022-02-06, Dennis Lee Bieber  wrote:
>>> On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
>>>  declaimed the following:
>>> 
  I cannot open python after downloading it keeps going to modify/uninstall
  ?? please help
[...]
>> This is _still_ a problem after all these years and countless
>> identical complaints?
>> 
>> How difficult would it be to add a few lines of text to the installer
>> welcome screen explaining that you've just started the Python
>> INSTALLER, and if you've already done the installation and want to
>> "run Python" try ?
>
> Better yet include the word setup in the installer .exe name.
> Just like almost every other installer does.

That's also been suggested repeatedly over the years also.

--
Grant


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


Re: Openning Python program

2022-02-07 Thread Grant Edwards
On 2022-02-07, Chris Angelico  wrote:
> On Tue, 8 Feb 2022 at 02:53, Grant Edwards  wrote:
>>
>>On 2022-02-06, Dennis Lee Bieber  wrote:
>>> On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
>>> declaimed the following:
>>>
   I cannot open python after downloading it keeps going to
   modify/uninstall ?? please help
>
>> This is _still_ a problem after all these years and countless
>> identical complaints?
>
>> How difficult would it be to add a few lines of text to the
>> installer welcome screen explaining that you've just started the
>> Python INSTALLER, and if you've already done the installation and
>> want to "run Python" try ?
>
> How difficult would it be to get people to read those lines, though?

There is that...

It's been ages since I installed Python on Windows, so maybe that info
has already been added and I've put my foot in it?

--
Grant


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


[issue46166] [C API] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a89772c79183e3e62bf61b92077a04f6ebcc4a2b by Victor Stinner in 
branch 'main':
bpo-46166: Fix compiler warnings in What's New in Python 3.11 (GH-31198)
https://github.com/python/cpython/commit/a89772c79183e3e62bf61b92077a04f6ebcc4a2b


--

___
Python tracker 

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



[issue46647] `test_functools` unexpected failures when C `_functoolsmodule` is missing

2022-02-07 Thread Hai Shi


Hai Shi  added the comment:

> _functoolsmodule is a core bootstrap module and defined in 
> Modules/Setup.bootstrap. It has no external dependencies. There is no reason 
> and no point to disable the module.

+1. 

> Cristian, in this case - is there a reason to keep `skipUnless(c_functools)` 
> around? 
> If we are sure that it is always available - then it should be always tested. 

Hm. Personally, I suggest to keep the `skipUnless` to aovid the code churn.
Or maybe you have other cases to show the functools module will missing 
unexpectly?

--

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2022-02-07 Thread pmp-p


Change by pmp-p :


--
nosy: +pmpp

___
Python tracker 

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



Re: Openning Python program

2022-02-07 Thread Barry


> On 7 Feb 2022, at 15:55, Grant Edwards  wrote:
> 
> On 2022-02-06, Dennis Lee Bieber  wrote:
>> On Sun, 6 Feb 2022 13:44:07 +0530, "createkmontalb...@gmail.com"
>>  declaimed the following:
>> 
>>>  I cannot open python after downloading it keeps going to modify/uninstall
>>>  ?? please help
>> 
>> Stop clicking on the INSTALLER. What you downloaded is just the program
>> that installs and configures Python on your system. Stuff it away someplace
>> safe should you need to modify the current installation, but otherwise just
>> forget that it exists.
> 
> This is _still_ a problem after all these years and countless
> identical complaints?
> 
> How difficult would it be to add a few lines of text to the installer
> welcome screen explaining that you've just started the Python
> INSTALLER, and if you've already done the installation and want to
> "run Python" try ?

Better yet include the word setup in the installer .exe name.
Just like almost every other installer does.

Barry

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

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


[issue46655] typing.TypeAlias is not in the list of allowed plain _SpecialForm typeforms

2022-02-07 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset e2eeffefed32bb8c47c09bdd94e27a4e949894ef by Gregory Beauregard in 
branch '3.10':
[3.10] bpo-46655: allow stringized TypeAlias with get_type_hints (GH-31156). 
(#31175)
https://github.com/python/cpython/commit/e2eeffefed32bb8c47c09bdd94e27a4e949894ef


--

___
Python tracker 

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



[issue46166] [C API] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread STINNER Victor


Change by STINNER Victor :


--
title: Get "self" args or non-null co_varnames from frame object with C-API -> 
[C API] Get "self" args or non-null co_varnames from frame object with C-API

___
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-07 Thread hydroflask


hydroflask  added the comment:

Just to clarify further, the original benchmark by corona10 did indeed lead to 
`_CallPythonObject` being invoked but it was not quite the normal use-case. In 
the original benchmark it invoked the generated ctypes thunk via Python so as 
vstinner said it was doing this:

Python -> converters -> thunk-> _CallPythonObject -> converters-> Python

Namely using `PyCFuncPtr_call` to invoke the thunk generated by 
`_ctypes_alloc_callback`. Normally when invoking C functions via 
`PyCFuncPtr_call` it looks like this:

Python -> converters -> C_function

In the original benchmark setup no significant reduction in runtime was 
observed by this patch.  I noticed that it was not a typical use of 
`_CallPythonObject`, where instead it would be a top-level C function calling 
back into Python. Something like this:

C -> thunk -> _CallPythonObject() -> Python

The benchmark I provided exercises that use case and the >=10% reduction in 
runtime was observed. Thanks to both corona10 and vstinner, I appreciate their 
effort in this issue.

--

___
Python tracker 

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



  1   2   >