[issue11838] IDLE: make interactive code savable as a runnable script

2021-09-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
priority: normal -> high

___
Python tracker 

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



[issue11838] IDLE: make interactive code savable as a runnable script

2021-09-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This should be easier to do with the new shell with indents fixed.

--
nosy:  -roger.serwy, tlesher
versions: +Python 3.11 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue41271] Add support for io_uring to cpython

2021-09-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -terry.reedy

___
Python tracker 

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



[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



Re: Why does SMTP.send_message() do from mangling?

2021-09-26 Thread Grant Edwards
On 2021-09-27, Grant Edwards  wrote:

> Why does SMTP.send_message(msg) do from mangling even though msg's
> policy has mangle_from_ set to False?

I've concluded this is a bug in SMTP.send_message()

https://bugs.python.org/issue45299

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


[issue45299] SMTP.send_message() does from mangling when it should not

2021-09-26 Thread Grant Edwards


New submission from Grant Edwards :

SMTP.send_message() does from mangling even when the message's policy
has that disabled. The problem is in the send_messsage() function
shown below:


   912  def send_message(self, msg, from_addr=None, to_addrs=None,
   913   mail_options=(), rcpt_options=()):
   914  """Converts message to a bytestring and passes it to sendmail.
   ...
   963  # Make a local copy so we can delete the bcc headers.
   964  msg_copy = copy.copy(msg)
   ...
   977  with io.BytesIO() as bytesmsg:
   978  if international:
   979  g = email.generator.BytesGenerator(
   980  bytesmsg, policy=msg.policy.clone(utf8=True))
   981  mail_options = (*mail_options, 'SMTPUTF8', 
'BODY=8BITMIME')
   982  else:
   983  g = email.generator.BytesGenerator(bytesmsg)
   984  g.flatten(msg_copy, linesep='\r\n')
   985  flatmsg = bytesmsg.getvalue()

If 'international' is True, then the BytesGenerator is passed
msg.policy with utf8 added, and from mangling is only done if the
message's policy has from mangling enabled. This is correct behavior.

If 'international' is False, then the generator always does from
mangling regardless of the message'spolicy. From mangling is only used
when writing message to mbox format files. When sending a message via
SMTP It is wrong to do it when the message's policy says not to.

This needs to be fixed by passing the message's policy to BytesGenerator()
in the 'else' clause also.  I would suggest changing

   983  g = email.generator.BytesGenerator(bytesmsg)
to

   983  g = email.generator.BytesGenerator(bytesmsg, 
policy=msg.policy)


The problem is that if neither mangle_from_ nor policy arguments are
passed to email.generator.BytesGenerator(), then mangle_from_ defaults
to True, and the mangle_from_ setting in the message is ignored. This is
not really documented:

  
https://docs.python.org/3/library/email.generator.html#email.generator.BytesGenerator

If optional mangle_from_ is True, put a > character in front of
any line in the body that starts with the exact string "From ",
that is From followed by a space at the beginning of a
line. mangle_from_ defaults to the value of the mangle_from_
setting of the policy.
   
Where "the policy" refers to the one passed to BytesGenerator(). Note
that this section does _not_ state what happens if neither
mangle_from_ nor policy are passed to BytesGenerator(). What actually
happens is that in that case mangle_from_ defaults to True. (Not a
good choice for default, since that's only useful for the one case
where you're writing to an mbox file.)

However, there is also a misleading sentence later in that same
section:

If policy is None (the default), use the policy associated with
the Message or EmailMessage object passed to flatten to control
the message generation.

That's only partially true. If you don't pass a policy to
BytesGenerator(), only _some_ of the settings from the message's
policy will be used. Some policy settings (e.g. mangle_from_) are
obeyed when passed to BytesGenerator(), but ignored in the message's
policy even if there was no policy passed to BytesGenerator().

The documentation needs to be changed to state that mangle_from_
defaults to True if neitehr mangle_from_ nor policy are passed to
BytesGenerator(), and that last sentence needs to be changed to state
that when no policy is passed to BytesGenerator() only _some_ of the
fields in the message's policy are used to control the message
generation. (An actual list of policy fields are obeyed from the
message's policy would be nice.)

--
components: Library (Lib)
messages: 402690
nosy: grant.b.edwards
priority: normal
severity: normal
status: open
title: SMTP.send_message() does from mangling when it should not
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



[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Tal, Paine: should be use exactly the raw REPL message or something that might 
be clearer to beginners, like 'Ctrl-D (end-of-file)'?

--
nosy: +epaine, taleinat

___
Python tracker 

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



[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee:  -> terry.reedy
components: +IDLE
type:  -> behavior
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



Re: Bug in email.generator.BytesGenerator() [was: Why does SMTP.send_message() do from mangling?]

2021-09-26 Thread Grant Edwards
On 2021-09-27, Grant Edwards  wrote:

> According to
> https://docs.python.org/3/library/email.generator.html#email.generator.BytesGenerator
> the default from mangling behavior is _supposed_ to obey the message
> policy if no policy or mangle_from_ value was
> provided to the call to BytesGenerator().

Nope, I think both the author of smtplib.py and I were misled by the
documentation for email.generator.BytesGenerator. After rereading it,
it does say in one place that if no mangle_from_, value is passed to
BytesGenerator(), it is supposed to default to the mangle_from_
setting in the policy **passed to BytesGenerator()**:

If optional mangle_from_ is True, put a > character in front of
any line in the body that starts with the exact string "From ",
that is From followed by a space at the beginning of a
line. mangle_from_ defaults to the value of the mangle_from_
setting of the policy.

Where "the policy" refers to the one passed to BytesGenerator().

However, later on it also says

If policy is None (the default), use the policy associated with
the Message or EmailMessage object passed to flatten to control
the message generation.

That's misleading and only partially true. If you don't pass a policy
to BytesGenerator(), only _some_ of the settings from the message's
policy will be used. Some policy settings (e.g. mangle_from_) are
obeyed when passed to BytesGenerator(), but ignored in the message's
policy even if there was no policy passed to BytesGenerator().  I
think that last sentence above needs to be changed, and smtplib.py
needs to be fixed as shown in my previous post.

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


Bug in email.generator.BytesGenerator() [was: Why does SMTP.send_message() do from mangling?]

2021-09-26 Thread Grant Edwards
On 2021-09-27, Grant Edwards  wrote:
> Why does SMTP.send_message(msg) do from mangling even though msg's
> policy has mangle_from_ set to False? The msg policy is
> email.policy.SMTP which has mangle_from_ disabled.
>
> One might expect that SMTP.send_message(msg) would use either msg's
> policy or email.policy.SMTP to send the message, but it does neither.

I've been looking at the smtplib.py sources, and the problem appears
to be in this section of send_message():


   912  def send_message(self, msg, from_addr=None, to_addrs=None,
   913   mail_options=(), rcpt_options=()):
   914  """Converts message to a bytestring and passes it to sendmail.
   ...
   963  # Make a local copy so we can delete the bcc headers.
   964  msg_copy = copy.copy(msg)
   ...
   977  with io.BytesIO() as bytesmsg:
   978  if international:
   979  g = email.generator.BytesGenerator(
   980  bytesmsg, policy=msg.policy.clone(utf8=True))
   981  mail_options = (*mail_options, 'SMTPUTF8', 
'BODY=8BITMIME')
   982  else:
   983  g = email.generator.BytesGenerator(bytesmsg)
   984  g.flatten(msg_copy, linesep='\r\n')
   985  flatmsg = bytesmsg.getvalue()

If 'international' is Frue, then the BytesGenerator uses msg.policy
with utf8 added, and I don't get the bogus from mangling: the
generator only does from mangling if the message policy has it
enabled.

If 'international' is False, then the generator always does from
mangling regardless of the message's policy.

According to
https://docs.python.org/3/library/email.generator.html#email.generator.BytesGenerator
the default from mangling behavior is _supposed_ to obey the message
policy if (as seen at 983) no policy or mangle_from_ value was
provided to the call to BytesGenerator(). In my tests, it doesn't
actually seem to work that way. AFAICT, the default behavior when no
policy or mangle_from_ value is passed to BytesGenerator() is to
enable from mangling regardless of the message's policy. I belive that
is a bug.

This can be worked around by changing

   983  g = email.generator.BytesGenerator(bytesmsg)
to

   983  g = email.generator.BytesGenerator(bytesmsg, 
policy=msg.policy)


Or BytesGenerator() could be fixed...

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


[issue41994] Refcount issues in import

2021-09-26 Thread Gregory Szorc


Gregory Szorc  added the comment:

While testing 3.10.0rc2, I noticed that commit 
4db8988420e0a122d617df741381b0c385af032c removed 
_PyImport_FindExtensionObject() from libpython. This breaks both PyOxidizer and 
py2exe, which rely on this function for a custom implementation of 
Loader.create_module() to enable loading Windows DLLs from memory.

It can probably be worked around. But I wanted to note it here in case it was 
an unwanted regression.

--
nosy: +indygreg

___
Python tracker 

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



Why does SMTP.send_message() do from mangling?

2021-09-26 Thread Grant Edwards
Why does SMTP.send_message(msg) do from mangling even though msg's
policy has mangle_from_ set to False? The msg policy is
email.policy.SMTP which has mangle_from_ disabled.

One might expect that SMTP.send_message(msg) would use either msg's
policy or email.policy.SMTP to send the message, but it does neither.

Don't you think that email.policy.SMTP would be the policy that ought
to be used to serialize a message for sending via SMTP?

None of the other SMTP clients I've checked do from mangling.

AFAICT, in order to send message without from mangling, I have to do
something like this:

   s.sendmail(msg['From'], msg['To'], msg.as_bytes())

Instead of

   s.send_message(msg)

For simple cases, it doesn't matter much, but if you have multiple
recipients, bcc, and cc, it's a pain that send_message() can't be
used.

What is the purpose of from mangling in an SMTP context?

I understand why it's done when writing messages to mbox files, but
what does that have to do with SMTP.send_message()?

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


Re: Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread 2QdxY4RzWzUUiLuE
On 2021-09-26 at 17:40:18 -0700,
Grant Edwards  wrote:

> On 2021-09-26, Mats Wichmann  wrote:
> > On 9/26/21 10:38, 2qdxy4rzwzuui...@potatochowder.com wrote:
> >> On 2021-09-26 at 11:21:08 -0500,
> >
> >> No.  I use mbsync (formerly isync) to synchronize my gmail account with
> >> a local maildir folder, and while mbsync does send the app password
> >> (over TLS) to google every few minutes, it doesn't need the second
> >> factor.  Or at least it hasn't so far (it's been a couple of years).  I
> >> do get periodic nags from google because I'm using a "less secure"
> >> method than their web page to access my mail, but I ignore them.
> 
> Are you using an app-specific password?

Yes.  It was a hoop, but not a big one.  No, wait, I mean it wasn't a
small, flaming, poison spiked hoop; i.e., it was fairly simple to jump
through.

> > Just be aware, because It's Google, this will change again at some
> > point and you'll lose access.
> 
> Of course. That's half the fun of using Google's services. ;)

If it changes, I'll just forward incoming mail to my main (non-google)
account and not look back.  If I didn't need the account to access the
google store on my android phone, I'd would have abandoned it long ago.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45069] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i

2021-09-26 Thread Ned Deily


Change by Ned Deily :


--
status: open -> closed

___
Python tracker 

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



[issue45298] SIGSEGV when access a fork Event in a spawn Process

2021-09-26 Thread Keming


New submission from Keming :

Code to trigger this problem:

```python
import multiprocessing as mp
from time import sleep


def wait_for_event(event):
while not event.is_set():
sleep(0.1)


def trigger_segment_fault():
event = mp.get_context("fork").Event()
p = mp.get_context("spawn").Process(target=wait_for_event, args=(event,))
p.start()  # this will show the exitcode=-SIGSEGV
sleep(1)
print(p)
event.set()
p.terminate()


if __name__ == "__main__":
trigger_segment_fault()
```

Accessing this forked event in a spawned process will result in a segment fault.

I have found a related report: https://bugs.python.org/issue43832. But I think 
it's not well documented in the Python 3 multiprocessing doc.

Will it be better to explicit indicate that the event is related to the start 
method context in the documentation?

--
assignee: docs@python
components: Documentation
messages: 402687
nosy: docs@python, kemingy
priority: normal
severity: normal
status: open
title: SIGSEGV when access a fork Event in a spawn Process
type: crash

___
Python tracker 

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



Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-27, Grant Edwards  wrote:

>>From the list's POV, gmane.io is a "normal" email subscriber who just
> happens to archive all the articles it receives. I should never have
> mentioned that gmane.io does NNTP -- it just seems to have confused
> everybody.

Did SMTP.send_message() add that '>' escape when it saw a 'From' at
the beginning of the line?

--
Grant

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


Re: Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Mats Wichmann  wrote:
> On 9/26/21 10:38, 2qdxy4rzwzuui...@potatochowder.com wrote:
>> On 2021-09-26 at 11:21:08 -0500,
>
>> No.  I use mbsync (formerly isync) to synchronize my gmail account with
>> a local maildir folder, and while mbsync does send the app password
>> (over TLS) to google every few minutes, it doesn't need the second
>> factor.  Or at least it hasn't so far (it's been a couple of years).  I
>> do get periodic nags from google because I'm using a "less secure"
>> method than their web page to access my mail, but I ignore them.

Are you using an app-specific password?

> Just be aware, because It's Google, this will change again at some point 
> and you'll lose access.

Of course. That's half the fun of using Google's services. ;)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Ethan Furman  wrote:
> On 9/26/21 10:34 AM, Grant Edwards wrote:
> > On 2021-09-26, Ethan Furman  wrote:
>
>>> I am unaware of a change in the newsgroup <--> mailing list policy,
>>> and other newsgroup posts were coming through last week (it's been a
>>> light weekend).
>>
>> We're not talking about the usenet<-->list gateway.
>
>> My first _guess_ would be that Mailman started refusing emailed posts
>> from the gmane server to python-list, and that triggered the gmane server
>> to stop accepting posts for python-list.
>
> I readily admit I may not understand, or know, all the usenet
> jargon,

Once again, there is no Usenet involved. Gmane.io is an NNTP server,
and NNTP is _also_ used by Usenet servers, but Gmane isn't part of
Usenet and doesn't implement any of the Usenet peering "news"
protocols.

> but looking at the Mailman server for Python list I see it is still
> fully configured to talk with News.FU-Berlin.DE, newsgroup
> comp.lang.python.

This has nothing to do with Usenet servers or their connections to
python-list.

>From the list's POV, gmane.io is a "normal" email subscriber who just
happens to archive all the articles it receives. I should never have
mentioned that gmane.io does NNTP -- it just seems to have confused
everybody.

When a gmane.io user submits a post, the post arrives at python-list
by normal email channels having been sent via SMTP by the gmane.io
server "From:" the user (who, IIRC, has to be subscribed to the list).

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


Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Grant Edwards  wrote:
>
>> 2 Every message from the OP in this 'thread' (not others) has broken the
>> thread, which indicates a wider problem/change.
>
> And I apologize for that.  It's because I'm reading the list using an
> NNTP client (slrn) connected to an NNTP server at gmane.io and then
> posting via e-mail. Doing that doesn't include the correct References
> header.  Posting via gmane stopped working a few days ago (after
> having worked for 20 years). I'm working on a solution so that slrn
> can read using NNTP and post using email (including the proper
> headers), but it's going to take a few days.

It was easier than I thought. It only took about a half hour to write
my own 'inews' utility that I can tell slrn to use for posting
articles. It looks at the article and decides based on the destination
whether to use NNTP or SMTP to send it (and then sends it using the
appropriate protocol).

It's a total of 50 lines of Python (including logging stuff to
syslog).

This is my first "real" post using it, so hopefully this shows up with
proper headers.

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


[issue45297] Improve the IDLE shell save command

2021-09-26 Thread Steven D'Aprano


New submission from Steven D'Aprano :

See this question on Discuss:

https://discuss.python.org/t/what-is-this-syntax-i-dont-know-how-to-fix-it/10844

It seems that IDLE allows you to save the shell output, complete with welcome 
message and prompts, as a .py file, and then reopen it and attempt to run it, 
which obviously fails. When it does fail, it is confusing.

Suggested enhancements:

- When saving the complete shell session, save it to a text file, not .py. That 
would be useful for anyone wanting a full record of the interpreter session.

- When saving the shell session as a .py file, strip out the welcome message, 
the prompts, and any output, leaving only what will hopefully be runnable code.

I don't know what sort of UI this should have. Two different menu commands? A 
checkbox in the Save dialog?

My thoughts are that the heuristic to reconstruct runnable code from the 
interpreter session may not be foolproof, but better than nothing. Something 
like the doctest rules might work reasonably well.

- strip the welcome message;

- any line (or block) starting with the prompt >>> that is followed by a 
traceback should be thrown out;

- any other text not starting with the prompt >>> is interpreter output and 
should be thrown out;

- you should be left with just blocks starting with the prompt, so remove the 
prompt, adjust the indents, and hopefully you're left with valid runnable code.

--
assignee: terry.reedy
components: IDLE
messages: 402686
nosy: steven.daprano, terry.reedy
priority: normal
severity: normal
status: open
title: Improve the IDLE shell save command
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



[issue43914] Highlight invalid ranges in SyntaxErrors

2021-09-26 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +26959
pull_request: https://github.com/python/cpython/pull/28576

___
Python tracker 

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



[issue45069] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i

2021-09-26 Thread Ned Deily


Change by Ned Deily :


--
stage:  -> resolved
status: pending -> open

___
Python tracker 

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



[issue45249] Update doctect SyntaxErrors for location range

2021-09-26 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +26958
pull_request: https://github.com/python/cpython/pull/28575

___
Python tracker 

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



[issue44933] python3.9-intel64 hardened runtime not enabled

2021-09-26 Thread Ned Deily


Ned Deily  added the comment:

> the "reliable way to run under rosetta" is using "arch -x86_64 python3". I 
> don't particularly like having another executable to accomplish the same goal.

Unfortunately, using "arch" is *not* a reliable way in general. It works fine 
for the initial invocation of the interpreter but things fall apart when a 
Python program tries to invoke another Python interpreter in a subprocess. The 
standard idiom for finding the location of the running interpreter is to use 
the contents of sys.executable. But that merely contains the name of the 
interpreter file, thus the additional "arch" arguments are lost and the 
interpreter will launch in the subprocess using the default arch, which may 
result in a failure (if you are lucky) or, worse, will silently run under the 
wrong architecture potentially giving misleading results. The most notable 
example of this is while running the python test suite. We ran into this same 
issue years ago with the "intel" universal-arch build option which is why we 
added a "python3-32" executable to provide a reliable way to force 32-bit 
execution on a 64-bit-capable Mac. The need for "python3-intel64" will 
eventually go a
 way once Rosetta2 is no longer supported.

--

___
Python tracker 

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



[issue44493] Missing terminated NUL in the length of sockaddr_un

2021-09-26 Thread Ned Deily


Change by Ned Deily :


--
resolution: fixed -> 
versions: +Python 3.11 -Python 3.6

___
Python tracker 

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



[issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful

2021-09-26 Thread Jeremy Maitin-Shepard


Jeremy Maitin-Shepard  added the comment:

Yes, I would agree that the new APIs are a useful addition regardless of the 
PyThread_exit_thread change.

As far as the proposed `Py_SetThreadExitCallback` that seems like a fine thing 
for applications to use, as long as it doesn't impact how extensions need to be 
written to be safe from crashes/memory corruption.  So for example if the 
default is to hang, then changing it to log and then hang, or optionally log 
and terminate the program, would be fine, since extensions aren't affected 
either way.

Conversely, if one of the possible behaviors may be `_endthreadex` or 
`pthread_exit`, then libraries must be written to be safe under that behavior 
anyway, which is unfortunate.  Furthermore, say for a library that only 
supports POSIX, maybe it is written to be safe under `pthread_exit` because it 
uses destructors to do cleanup, but then it will cause deadlock if the callback 
chooses to hang the thread instead.  Thus, I think allowing the callback to 
change the behavior in a way that could impact extensions is not a great idea.

The callback also doesn't seem like a very good mechanism for an extension that 
is incompatible with `pthread_exit` or `_endthreadex`, such as one using 
pybind11, to try to mitigate that problem, since an individual library 
shouldn't be changing application-wide behavior unless the library is 
specifically being used by the application for that purpose.

--

___
Python tracker 

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



[issue44958] [sqlite3] only reset statements when needed

2021-09-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 7b88f63e1dd4006b1a08b9c9f087dd13449ecc76 by Erlend Egeberg 
Aasland in branch 'main':
bpo-44958: Revert GH-27844 (GH-28574)
https://github.com/python/cpython/commit/7b88f63e1dd4006b1a08b9c9f087dd13449ecc76


--

___
Python tracker 

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



[issue36717] Allow retrieval of return value from the target of a threading.Thread

2021-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

Storing the result of Thread.run() can keep Python objects alive longer than 
expected and it may require a lock on it. I don't think that the additional 
complexity is worth it. I suggest to reorganize your code to pass the result 
differently to the caller thread. You can use a queue, a variable, whatever 
works.

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



[issue27978] concurrent.futures.threading: Add a timeout to Executor shutdown() method

2021-09-26 Thread STINNER Victor


Change by STINNER Victor :


--
title: [threading] Executor#shutdown with timeout -> 
concurrent.futures.threading: Add a timeout to Executor shutdown() method

___
Python tracker 

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



[issue1736792] dict reentrant/threading request

2021-09-26 Thread STINNER Victor


STINNER Victor  added the comment:

> As I first mentioned in my post[1] on comp.lang.python, it seems possible to 
> modify a dict while a lookup is ongoing, without causing the lookup to 
> restart.

That's a bad practice. Python dict raises an exception in some cases: 
RuntimeError("dict mutated during update").

Detecting any change during a lookup would slow down, whereas dict performance 
is key in Python performance in general, since dict is used everywhere for 
Python namespaces.

I close the issue as "wont fix".

--
nosy: +vstinner
resolution:  -> wont fix
stage: test needed -> 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



[issue45292] Implement PEP 654: Exception Groups

2021-09-26 Thread STINNER Victor


Change by STINNER Victor :


--
title: Implement PEP 654 -> Implement PEP 654: Exception Groups

___
Python tracker 

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



Re: Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread Mats Wichmann

On 9/26/21 10:38, 2qdxy4rzwzuui...@potatochowder.com wrote:

On 2021-09-26 at 11:21:08 -0500,



No.  I use mbsync (formerly isync) to synchronize my gmail account with
a local maildir folder, and while mbsync does send the app password
(over TLS) to google every few minutes, it doesn't need the second
factor.  Or at least it hasn't so far (it's been a couple of years).  I
do get periodic nags from google because I'm using a "less secure"
method than their web page to access my mail, but I ignore them.


Just be aware, because It's Google, this will change again at some point 
and you'll lose access.  I had a working setup that started triggering 
the less-secure warnings, but was able to ignore it after setting the 
account to allow such "insecure" access (several times, because it kept 
"forgetting" that setting, probably quite intentionally). And then after 
a while, there was no way around it, and now if my infrequently used 
setup gets triggered to sync with gmail I get "critical security alert" 
messages and nothing goes through. And it's unchangeable. I'm going to 
have to go clean it out, just been too lazy to do so.

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


Re: Posts from gmane no longer allowed?

2021-09-26 Thread Ethan Furman

On 9/26/21 10:34 AM, Grant Edwards wrote:
> On 2021-09-26, Ethan Furman  wrote:

>> I am unaware of a change in the newsgroup <--> mailing list policy,
>> and other newsgroup posts were coming through last week (it's been a
>> light weekend).
>
> We're not talking about the usenet<-->list gateway.

> My first _guess_ would be that Mailman started refusing emailed posts
> from the gmane server to python-list, and that triggered the gmane server
> to stop accepting posts for python-list.

I readily admit I may not understand, or know, all the usenet jargon, but looking at the Mailman server for Python list 
I see it is still fully configured to talk with News.FU-Berlin.DE, newsgroup comp.lang.python.


I'll forward the problem to the maintainers -- hopefully they'll have some 
insight.

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


[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Given that there isn't an actual bug here, please move this discussion to 
python-ideas.

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



[issue45293] List inplace addition different from normal addition

2021-09-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Kapil, this behavior was intentional (not a bug), but later regarded as a 
design mistake.  GvR has said that if he had to do it over again list.__iadd__ 
would only accept other lists.  The problem arises when people write "somelist 
+= 'hello'" and expect it to add a single string with one word rather than five 
one letter strings.  That said, the current behavior is guaranteed, people rely 
on it, and we cannot change it.

As Karthikeyan points out, this is documented.  However since the docs have 
grown so voluminous, it is often difficult to find any one particular fact.

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



Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards


On 2021-09-26, dn via Python-list  wrote:
> On 27/09/2021 06.34, Grant Edwards wrote:
>> On 2021-09-26, Ethan Furman  wrote:
>>> On 9/26/21 9:21 AM, Grant Edwards wrote:
 On 2021-09-26, Chris Angelico  wrote:
>>>
> I'm not sure whether the policy change happened on python-list,
> or at gmane. From the look of the error message you got, it may
> have actually been gmane's decision. Haven't heard anything from
> the list admins here about it, either way, so I have no idea.
> ...
>
>> My first _guess_ would be that Mailman started refusing emailed
>> posts from the gmane server to python-list, and that triggered the
>> gmane server to stop accepting posts for python-list.
>> 
>
>
> 1 Google are not the most reliable when it comes to maintaining
> policy/services, nor for advising their decision to make changes. CI/CD
> breakage doesn't 'count' when you're big-enough not to care...

I'm not really sure what Google has to do with it other than me
wanting to post using my GMail address, since that's the one that
everybody knows. I could be using any other e-mail address, and it
wouldn't make any difference.

> 2 Every message from the OP in this 'thread' (not others) has broken the
> thread, which indicates a wider problem/change.

And I apologize for that.  It's because I'm reading the list using an
NNTP client (slrn) connected to an NNTP server at gmane.io and then
posting via e-mail. Doing that doesn't include the correct References
header.  Posting via gmane stopped working a few days ago (after
having worked for 20 years). I'm working on a solution so that slrn
can read using NNTP and post using email (including the proper
headers), but it's going to take a few days.

In the meanwhile, I'll try to manually insert the proper References:
header when I post.

> I'm ignorant of such things. Why not subscribe directly to this list
> with your dedicated/public-facing gmail address?

I find that following mailing lists using a news reader is far, far
more efficient than using an e-mail program.  Efficiently sifting
through thousands and thousands of posts in dozens of groups/lists is
want newsreaders are designed to do, and they're very good at it. One
of the big advantages of slrn is that I can create a "score file" so I
always see things I want to see, and not see things I don't want to
see. I can also search through decades of articles almost instantly
without having to have any of them stored locally.

--
Grant

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


[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-26 Thread Terry J. Reedy


New submission from Terry J. Reedy :

On Windows:
>>> exit
'Use exit() or Ctrl-Z plus Return to exit'
>>> quit
'Use quit() or Ctrl-Z plus Return to exit'
>>> exit.eof
'Ctrl-Z plus Return'

On *nix, 'Ctrl-Z plus Return' is 'Ctrl-D (i.e, EOF)'
IDLE uses the latter even on Windows, and Ctrl-Z does not work.

Both exit and quit are instances of _sitebuiltins.Quitter
https://github.com/python/cpython/blob/e14d5ae5447ae28fc4828a9cee8e9007f9c30700/Lib/_sitebuiltins.py#L13-L26
class Quitter(object):
def __init__(self, name, eof):
self.name = name
self.eof = eof
def __repr__(self):
return 'Use %s() or %s to exit' % (self.name, self.eof)
def __call__ [not relevant here]

We just need to replace current exit/quit.eof as indicated above on startup.

--
messages: 402678
nosy: terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Change Ctrl-Z note in exit/quit repr on Windows

___
Python tracker 

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



[issue44958] [sqlite3] only reset statements when needed

2021-09-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +26956
pull_request: https://github.com/python/cpython/pull/28574

___
Python tracker 

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



Re: Posts from gmane no longer allowed?

2021-09-26 Thread dn via Python-list
On 27/09/2021 06.34, Grant Edwards wrote:
> On 2021-09-26, Ethan Furman  wrote:
>> On 9/26/21 9:21 AM, Grant Edwards wrote:
>>> On 2021-09-26, Chris Angelico  wrote:
>>
 I'm not sure whether the policy change happened on python-list, or at
 gmane. From the look of the error message you got, it may have
 actually been gmane's decision. Haven't heard anything from the list
 admins here about it, either way, so I have no idea.
...
> My first _guess_ would be that Mailman started refusing emailed posts
> from the gmane server to python-list, and that triggered the gmane server
> to stop accepting posts for python-list.
> 


1 Google are not the most reliable when it comes to maintaining
policy/services, nor for advising their decision to make changes. CI/CD
breakage doesn't 'count' when you're big-enough not to care...

2 Every message from the OP in this 'thread' (not others) has broken the
thread, which indicates a wider problem/change.

I'm ignorant of such things. Why not subscribe directly to this list
with your dedicated/public-facing gmail address?
(if the concern relates to having too many email addresses 'open to the
world', is Google the best 'gatekeeper' and privacy guard?)
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44958] [sqlite3] only reset statements when needed

2021-09-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I'll revert PR 27844 for now (except the tests).

Since SQLite works better when we keep the number of non-reset statements to a 
minimum, we need to ensure that we reset statements when we're done with them 
(sqlite3_step() returns SQLITE_DONE or an error). Before doing such a change, 
we should clean up _pysqlite_query_execute() so we don't need to sprinkle that 
function with pysqlite_statement_reset's. I plan to do this before attempting 
to clean up reset usage again.

--

___
Python tracker 

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



io.TextIOWrapper and io.RawIOBase

2021-09-26 Thread Iwan Aucamp
Documentation for `io.TextIOWrapper` [[1]] suggests that the buffer
supplied to the constructor should be of `io.BufferedIOBase` type:

> A buffered text stream over a `BufferedIOBase` binary stream.

Looking at the implementation of `io.TextIOWrapper` in both
`Modules/_io/textio.c` [[2]] and `Lib/_pyio.py` [[3]], it seems like
`io.TextIOWrapper` will only use the following attributes and functions
on the supplied `buffer` object:

```python
buffer.closed
buffer.close()
buffer._dealloc_warn()
# ^ only from Modules/_io/textio.c, looks like failures will be ignored
buffer.fileno()
buffer.flush()
buffer.isatty()
buffer.name
# ^ only when TextIOWrapper.buffer is accessed
buffer.raw()
# ^ only if buffer is instance of BufferedReader, BufferedWriter
# or BufferedRandom, also only from Modules/_io/textio.c
buffer.read()
buffer.read1() # only if buffer has a read1 method
buffer.readable()
buffer.seek()
buffer.seekable()
buffer.tell()
buffer.truncate()
buffer.writable()
buffer.write()
```

More specifically, `io.TextIOWrapper` looks like it will work fine with
`buffer` objects that does not have any of the following attributes and
methods that only exists in `io.BufferedIOBase`, but not in
`io.RawIOBase`:

```python
buffer.raw
# ^ this is only called if buffer is an instance of
# explicit subclasses of `io.BufferedIOBase`
buffer.detatch() # this is never called
buffer.read1() # this is only used if it exists
buffer.readinto() # this is never called
buffer.readinto1() # this is never called
```

Or stated differently, it looks like `io.TextIOWrapper` will work
equally well with buffer objects that are either `io.RawIOBase` or
`io.BufferedIOBase` types.

So the question is, if my assessment is correct, should the
documentation not be updated to clearly state that the `buffer` can be
either a `io.RawIOBase` or `io.BufferedIOBase` object?

(text written for python 3.7.12)

[1]: https://docs.python.org/3.7/library/io.html#io.TextIOWrapper
[2]: https://github.com/python/cpython/blob/v3.7.12/Modules/_io/textio.c
[3]: https://github.com/python/cpython/blob/v3.7.12/Lib/_pyio.py
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-09-26 Thread Hai Shi


Change by Hai Shi :


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

___
Python tracker 

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



Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Ethan Furman  wrote:
> On 9/26/21 9:21 AM, Grant Edwards wrote:
> > On 2021-09-26, Chris Angelico  wrote:
>
> >> I'm not sure whether the policy change happened on python-list, or at
> >> gmane. From the look of the error message you got, it may have
> >> actually been gmane's decision. Haven't heard anything from the list
> >> admins here about it, either way, so I have no idea.
> >
> > I'm just guessing, but I can't imagine that gmane's owner would have
> > done that unless python-list itself started to refuse posts (or the
> > python-list admins requested that gmane stop sending posts).
>
> I am unaware of a change in the newsgroup <--> mailing list policy,
> and other newsgroup posts were coming through last week (it's been a
> light weekend).

We're not talking about the usenet<-->list gateway.

Gmane.io is a server that subscribes to and archives many thousands of
email lists. It provides NNTP access to that archive. It submits
postings made by NNTP clients via e-mail. It stopped allowing posting
a few days ago for python-list.

At least one other gmane user has also reported being no longer able
to post to python-list.

Posting to other lists via gmane still works fine.

My first _guess_ would be that Mailman started refusing emailed posts
from the gmane server to python-list, and that triggered the gmane server
to stop accepting posts for python-list.

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


[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-26 Thread Cristobal Riaga


Cristobal Riaga  added the comment:

So there is no way to get members in the order you defined them?

--

___
Python tracker 

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



[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-26 Thread Cristobal Riaga


Cristobal Riaga  added the comment:

So there is no way to get the members in order?

--

___
Python tracker 

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



[issue45280] Empty typing.NamedTuple creation is not tested

2021-09-26 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Nikita! ✨  ✨

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



[issue45280] Empty typing.NamedTuple creation is not tested

2021-09-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset d452b2963ba91d6bce29bb96733ed8bd1c0448b0 by Miss Islington (bot) 
in branch '3.10':
bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559) 
(GH-28571)
https://github.com/python/cpython/commit/d452b2963ba91d6bce29bb96733ed8bd1c0448b0


--

___
Python tracker 

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



[issue45280] Empty typing.NamedTuple creation is not tested

2021-09-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 08e387ab82331230d7f6608e949723d8a8e09229 by Miss Islington (bot) 
in branch '3.9':
bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559) 
(GH-28570)
https://github.com/python/cpython/commit/08e387ab82331230d7f6608e949723d8a8e09229


--

___
Python tracker 

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



[issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()`

2021-09-26 Thread Łukasz Langa

Łukasz Langa  added the comment:

> Is it an official position?

No, we need to decide what will happen to PEP 563 and PEP 649 in Python 3.11.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45249] Update doctect SyntaxErrors for location range

2021-09-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

One important thing is that "traceback.print_exception" should correctly print 
syntax errors .

--

___
Python tracker 

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



Re: Free OCR package in Python and selecting appropriate widget for the GUI

2021-09-26 Thread Mohsen Owzar
Mohsen Owzar schrieb am Donnerstag, 23. September 2021 um 08:53:15 UTC+2:
> DFS schrieb am Mittwoch, 22. September 2021 um 09:41:42 UTC+2: 
> > On 9/22/2021 1:54 AM, Mohsen Owzar wrote: 
> > > DFS schrieb am Mittwoch, 22. September 2021 um 05:10:30 UTC+2: 
> > >> On 9/21/2021 10:38 PM, Mohsen Owzar wrote: 
> > >>> DFS schrieb am Dienstag, 21. September 2021 um 15:45:38 UTC+2: 
> >  On 9/21/2021 4:36 AM, Mohsen Owzar wrote: 
> > > Hi Guys 
> > > Long time ago I've written a program in Malab a GUI for solving 
> > > Sudoku puzzles, which worked not so bad. 
> > > Now I try to write this GUI with Python with PyQt5 or TKinter. 
> > > First question is: 
> > > Is there any free OCR software, packages or code in Python, which I 
> > > can use to recognize the given digits and their positions in the 
> > > puzzle square. 
> > > Second: 
> > > Because, I can not attach a picture to this post, I try to describe 
> > > my picture of my GUI. 
> >  Draw your GUI in PyQt designer or other graphics tool, then upload a 
> >  screenshot of it to imgur, then post the link to the picture. 
> > >>> Thanks, for your answer. Hi
> > >>> But, what is "imgur"? 
> > >>> I'm not so familiar with handling of pictures in this group. 
> > >>> How can I call "imgur" or how can I get there? 
> > >>> 
> > >>> Regards 
> > >>> Mohsen 
> > >> www.imgur.com 
> > >> 
> > >> It's a website you can upload image files or screenshots to. Then you 
> > >> can copy a link to your picture and post the link here. 
> > > I have already posted the link, but I can not see it anywhere. 
> > > Now, I post it again: 
> > > https://imgur.com/a/Vh8P2TE 
> > > I hope that you can see my two images. 
> > > Regards 
> > > Mohsen 
> > Got it. 
> > 
> > I haven't used tkinter. In PyQt5 designer I think you should use one 
> > QTextEdit control for each square. 
> > 
> > 
> > Each square with the small black font can be initially populated with 
> > 
> > 1 2 3 
> > 4 5 6 
> > 7 8 9 
> > 
> > 
> > 
> > https://imgur.com/lTcEiML 
> > 
> > 
> > 
> > some starter python code (maybe save as sudoku.py) 
> > 
> > = 
> > from PyQt5 import Qt, QtCore, QtGui, QtWidgets, uic 
> > from PyQt5.Qt import * 
> > from PyQt5.QtCore import * 
> > from PyQt5.QtGui import * 
> > from PyQt5.QtWidgets import * 
> > 
> > #objects 
> > app = QtWidgets.QApplication([]) 
> > frm = uic.loadUi("sudoku.ui") 
> > 
> > 
> > #grid = a collection of squares 
> > grids = 1 
> > 
> > #squares = number of squares per grid 
> > squares = 9 
> > 
> > #fill the squares with 1-9 
> > def populateSquares(): 
> > for i in range(grids,grids+1): 
> > for j in range(1,squares+1): 
> > widget = frm.findChild(QtWidgets.QTextEdit, "txt{}_{}".format(i,j)) 
> > widget.setText("1 2 3 4 5 6 7 8 9") 
> > 
> > #read data from squares 
> > def readSquares(): 
> > for i in range(grids,grids+1): 
> > for j in range(1,squares+1): 
> > print("txt%d_%d contains: %s" % 
> > (i,j,frm.findChild(QtWidgets.QTextEdit, 
> > "txt{}_{}".format(i,j)).toPlainText())) 
> > 
> > 
> > #connect pushbuttons to code 
> > frm.btnPopulate.clicked.connect(populateSquares) 
> > frm.btnReadContents.clicked.connect(readSquares) 
> > 
> > #show main form 
> > frm.show() 
> > 
> > #initiate application 
> > app.exec() 
> > = 
> > 
> > 
> > 
> > 
> > 
> > .ui file (ie save as sudoku.ui) 
> > = 
> > 
> >  
> >  
> > MainWindow 
> >  
> >  
> >  
> > 0 
> > 0 
> > 325 
> > 288 
> >  
> >  
> >  
> > Sudoku 
> >  
> >  
> >  
> >  
> >  
> > 32 
> > 22 
> > 83 
> > 65 
> >  
> >  
> >  
> >  
> > Courier 
> > 12 
> > 50 
> > false 
> >  
> >  
> >  
> > false 
> >  
> >  
> > color: rgb(0, 0, 127); 
> > background-color: rgb(255, 255, 127); 
> >  
> >  
> > QFrame::StyledPanel 
> >  
> >  
> > QFrame::Sunken 
> >  
> >  
> > Qt::ScrollBarAlwaysOff 
> >  
> >  
> > true 
> >  
> >  
> >  
> >  
> >  
> > 114 
> > 22 
> > 83 
> > 65 
> >  
> >  
> >  
> >  
> > Courier 
> > 12 
> > 50 
> > false 
> >  
> >  
> >  
> > false 
> >  
> >  
> > color: rgb(0, 0, 127); 
> > background-color: rgb(255, 255, 127); 
> >  
> >  
> > QFrame::StyledPanel 
> >  
> >  
> > QFrame::Sunken 
> >  
> >  
> > Qt::ScrollBarAlwaysOff 
> >  
> >  
> > true 
> >  
> >  
> >  
> >  
> >  
> > 196 
> > 22 
> > 83 
> > 65 
> >  
> >  
> >  
> >  
> > Courier 
> > 12 
> > 50 
> > false 
> >  
> >  
> >  
> > false 
> >  
> >  
> > color: rgb(0, 0, 127); 
> > background-color: rgb(255, 255, 127); 
> >  
> >  
> > QFrame::StyledPanel 
> >  
> >  
> > QFrame::Sunken 
> >  
> >  
> > Qt::ScrollBarAlwaysOff 
> >  
> >  
> > true 
> >  
> >  
> >  
> >  
> >  
> > 32 
> > 86 
> > 83 
> > 65 
> >  
> >  
> >  
> >  
> > Courier 
> > 12 
> > 50 
> > false 
> >  
> >  
> >  
> > false 
> >  
> >  
> > color: rgb(0, 0, 127); 
> > 

Re: Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread Ethan Furman

On 9/26/21 9:21 AM, Grant Edwards wrote:
> On 2021-09-26, Chris Angelico  wrote:

>> I'm not sure whether the policy change happened on python-list, or at
>> gmane. From the look of the error message you got, it may have
>> actually been gmane's decision. Haven't heard anything from the list
>> admins here about it, either way, so I have no idea.
>
> I'm just guessing, but I can't imagine that gmane's owner would have
> done that unless python-list itself started to refuse posts (or the
> python-list admins requested that gmane stop sending posts).

I am unaware of a change in the newsgroup <--> mailing list policy, and other newsgroup posts were coming through last 
week (it's been a light weekend).


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


Re: Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread 2QdxY4RzWzUUiLuE
On 2021-09-26 at 11:21:08 -0500,
Grant Edwards  wrote:

> [...] Do you need the 2nd factor every time you connect to GMail via a
> browser or Android Gmail app? Or just the first time for each
> browser/device?  A bit of studying seems to be in order no matter
> what. :)

No.  I use mbsync (formerly isync) to synchronize my gmail account with
a local maildir folder, and while mbsync does send the app password
(over TLS) to google every few minutes, it doesn't need the second
factor.  Or at least it hasn't so far (it's been a couple of years).  I
do get periodic nags from google because I'm using a "less secure"
method than their web page to access my mail, but I ignore them.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45280] Empty typing.NamedTuple creation is not tested

2021-09-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26954
pull_request: https://github.com/python/cpython/pull/28571

___
Python tracker 

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



[issue45280] Empty typing.NamedTuple creation is not tested

2021-09-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26953
pull_request: https://github.com/python/cpython/pull/28570

___
Python tracker 

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



[issue45280] Empty typing.NamedTuple creation is not tested

2021-09-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f56268a2cd38b3fe2be1e4361d3d8b581e73559b by Nikita Sobolev in 
branch 'main':
bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559)
https://github.com/python/cpython/commit/f56268a2cd38b3fe2be1e4361d3d8b581e73559b


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45295] _PyObject_GetMethod/LOAD_METHOD for C classmethods

2021-09-26 Thread Ken Jin


New submission from Ken Jin :

LOAD_METHOD + CALL_METHOD currently doesn't work for Python @classmethod and C 
classmethod (METH_CLASS). They still create bound classmethods which are fairly 
expensive.

I propose supporting classmethods. I have an implementation for C classmethods. 
It passes most of the test suite, and I've also got it to play along with PEP 
659 specialization.

Some numbers from Windows release build (PGO build will likely be less 
favorable):

python.exe -m timeit "int.from_bytes(b'')"
Main:
200 loops, best of 5: 107 nsec per loop
Patched:
500 loops, best of 5: 72.4 nsec per loop

Funnily enough, `(1).from_bytes()` still needs a bound classmethod, but I think 
people usually use the other form.

A toy PR will be up for review. I will then split the change into two parts 
(one for _PyObject_GetMethod changes, another for PEP 659 specialization) to 
help decide if the maintenance-perf ratio is worth it.

--
components: Interpreter Core
messages: 402668
nosy: kj
priority: normal
severity: normal
status: open
title: _PyObject_GetMethod/LOAD_METHOD for C classmethods
type: performance
versions: Python 3.11

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-09-26 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> That is true, but there are a couple setups where that doesn't work 
> (those keypresses are consumed by something else). I may not be a good 
> data point though.

Can you give an example of a setup where Ctrl-D is consumed but "import 
sys ENTER sys.exit() ENTER" is not?

--

___
Python tracker 

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



Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Chris Angelico  wrote:

Thanks for the tips on registering an application for oauth2
credentials. It sounds like I should be able to do that if I practice
my hoop-jumping a bit more.

> (But I'd still recommend an app password. Much easier.)

Yes, I really should go with the 2FA and app-password option. Do you
need the 2nd factor every time you connect to GMail via a browser or
Android Gmail app? Or just the first time for each browser/device?  A
bit of studying seems to be in order no matter what. :)

I had initially thought that oauth2 was going to be the easier row to
hoe, but it had a lot more roots and rocks than I thought.

>> I could continue to read the list with slrn, but post using something
>> like Thunderbird, but do I really want to set up a whole new MUA just
>> for one mailing list? [The other 20+ mailing lists I follow are all
>> happy with posts from gmane.]
>
> I'm not sure whether the policy change happened on python-list, or at
> gmane. From the look of the error message you got, it may have
> actually been gmane's decision. Haven't heard anything from the list
> admins here about it, either way, so I have no idea.

I'm just guessing, but I can't imagine that gmane's owner would have
done that unless python-list itself started to refuse posts (or the
python-list admins requested that gmane stop sending posts).


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


[issue45294] Conditional import fails and produce UnboundLocalError, if a variable machting import name is used before

2021-09-26 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

In the future, please remember that this is not a help desk for getting help 
with your code, it is for reporting bugs. There are many forums that are happy 
to help you understand why your code is not working as you expect (if you are a 
beginner to Python, the answer is *almost never* "a bug in Python").

You can find help at Reddit's r/learnpython, or at the forums and mailing lists 
here:

https://www.python.org/community/forums/

https://www.python.org/community/lists/

--

___
Python tracker 

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



[issue45294] Conditional import fails and produce UnboundLocalError, if a variable machting import name is used before

2021-09-26 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This is not a bug, you are trying to print the value of the local variable 
DiaObjectFactoryHelper before you have defined the variable.

UnboundLocalError is a subclass of NameError that is used when the undefined 
name is a local variable instead of a global.

--
nosy: +steven.daprano
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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-09-26 Thread Filipe Laíns

Filipe Laíns  added the comment:

> Without disagreeing with the general sentiment, just note that you can always 
> do Ctrl-D.

That is true, but there are a couple setups where that doesn't work (those 
keypresses are consumed by something else). I may not be a good data point 
though.

> Running the REPL with -S is unusual, so having to use sys.exit() or `raise 
> SystemExit` in that case shouldn't be an issue. 

Yes, it is unusual, however I have found myself asking people to do that when 
debugging, and I always have to tell people "oh, btw, exit() doesn't work, you 
have to do ...", which is not nice.

> Even if you are running the REPL without the site module (so that exit 
and quit are not available) the import sys solution is surely the worst 
of the lot, UX-wise.

Two of the solutions you gave (exit and quit) don't work with -S, and 
Ctrl-D/Ctrl-Z doesn't work in all setups. raise SystemExit is the only real 
alternative I would consider when I am explaining things to people and want to 
avoid issues. I standardized in `import sys; sys.exit()` as it's generally 
easier for people starting out, even though it's 5 more keypresses.

---

Anyway, my point is simply that exiting on python -S does not have a great UX, 
something that I think should be considered when looking at this proposal. If 
you think the use-case is relevant enough to not warrant a change like this, 
that is a valid opinion.

My personal opinion is that we should optimize the UX for the people who are 
not that knowledgeable, as those are the ones that will have most trouble, 
while keeping it usable for the rest of users.
I think this change is a net positive considering those parameters, and I think 
the arguments against this proposal have not properly taken them into account.

FWIW, I consider myself a reasonably knowledgeable user, but still end up 
making this mistake myself a staggering amount of times.

$ rg 'exit\(\)$' ~/.python_history | wc -l
553
$ rg 'exit$' ~/.python_history | wc -l
132

--

___
Python tracker 

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



Re: Posts from gmane no longer allowed?

2021-09-26 Thread Chris Angelico
On Mon, Sep 27, 2021 at 1:10 AM Grant Edwards  wrote:
>
> On 2021-09-26, Chris Angelico  wrote:
>
> > Not sure what the significance of the "application" is - Google has
> > different services for where you're using it with your own domain, but
> > that shouldn't be relevant. If you want to use Gmail with mutt, you
> > should be able to do that, regardless. (Or you can just use some other
> > email address to post from, that would also work.)
>
> I have other addresses from which I could post, but I don't want them
> visible on the list.
>
> There are three ways to use mutt (or any other IMAP/SMTP) client with
> GMail.
>
>  1. Plain old username/password authentication: This requires you to
> enable the "less secure apps" option on your Gmail account. I used
> to use that, and it worked. But, it's frowned upon, and I wouldn't
> be surprised if it went away soon. It requires you to either put
> your password in a plaintext config file or enter it every time
> your connect to Gmail.

Agreed, I wouldn't recommend that.

>  2. Application-specific password: Creates a unique 16-digit
> application password that allows access to selected
> capabilities. This requires that you have two-factor
> authentication enabled on your Google account. I probably should
> do that, but I haven't figured out a convenient way to do so.

That would normally be the most convenient for personal usage like
this. It should be possible to use a simple TOTP tool, maybe even one
written in Python, like this:

https://github.com/Rosuav/shed/blob/master/2fa

>  3. OAUTH2: This requires that you "register an application" with
> Google. That application is then issued revokable credentials. The
> application uses those credentials to send an access request to
> Google. The account's owner then goes to a specified URL to
> autorize that access. The application is then issued revokable
> access and refresh tokens. The access token allows access to
> specific APIs for a short period of time (maybe an hour). After
> the access token expires, the refresh token can be used to obtain
> a new access token.

This is primarily aimed at third-party tools, where the user owning
the account isn't the same person as the creator of the tool. That's
why there's all the extra layers. It can certainly be used in a more
personal setup, but you'll probably need to do some
otherwise-unnecessary work. Google in particular is a bit of a hassle
for OAuth (compared to other OAuth providers), due to the wide variety
of services that they provide, some of which cost money. So there are
extra steps to choose which services to activate.

> The "register an application" step is where I got stuck. Other mutt
> users seem to have been able to go to their GMail account's cloud
> services page, create a project, create/register an application, and
> then download OAUTH2 credentials which they then use (via an external
> utility) with programs like mutt and msmtp.
>
> When I tried to "register an application" it demanded support and
> privacy policy URLs for my application. Those URLs had to be using
> domains that had bee pre-registered with Google. The only domain where
> I have a web page is at panix.com, and that domain isn't pre-
> registered with Google. I don't own that domain, so I'm not going to
> try to pre-register it with Google.

The most important address is the redirect URL. If you set that to
something on localhost, Google will know that you're building an
internal-only tool, and won't require anything much for the support
and privacy policy URLs (you could probably just set them to
http://localhost/support and http://localhost/privacy, or maybe even
leave them blank).

(But I'd still recommend an app password. Much easier.)

> I could continue to read the list with slrn, but post using something
> like Thunderbird, but do I really want to set up a whole new MUA just
> for one mailing list? [The other 20+ mailing lists I follow are all
> happy with posts from gmane.]
>

I'm not sure whether the policy change happened on python-list, or at
gmane. From the look of the error message you got, it may have
actually been gmane's decision. Haven't heard anything from the list
admins here about it, either way, so I have no idea.

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


[issue45294] Conditional import fails and produce UnboundLocalError, if a variable machting import name is used before

2021-09-26 Thread arts stars


New submission from arts stars :

Hello,

I have this situation:

def test():

if True :
print("Exception"+DiaObjectFactoryHelper)
else:
from . import DiaObjectFactoryHelper
pass

test()
---
it generates instead of (like the the line 'from . import' is commented) : 
"NameError: name 'DiaObjectFactoryHelper' is not defined"
this:
UnboundLocalError: local variable 'DiaObjectFactoryHelper' referenced before 
assignment


PS: The github authentificatiion did not work, did not manage to grab email 
even if set public

--
messages: 402663
nosy: stars-of-stras
priority: normal
severity: normal
status: open
title: Conditional import fails and produce UnboundLocalError, if a variable 
machting import name is used before
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: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Chris Angelico  wrote:

> Not sure what the significance of the "application" is - Google has
> different services for where you're using it with your own domain, but
> that shouldn't be relevant. If you want to use Gmail with mutt, you
> should be able to do that, regardless. (Or you can just use some other
> email address to post from, that would also work.)

I have other addresses from which I could post, but I don't want them
visible on the list.

There are three ways to use mutt (or any other IMAP/SMTP) client with
GMail.

 1. Plain old username/password authentication: This requires you to
enable the "less secure apps" option on your Gmail account. I used
to use that, and it worked. But, it's frowned upon, and I wouldn't
be surprised if it went away soon. It requires you to either put
your password in a plaintext config file or enter it every time
your connect to Gmail.

 2. Application-specific password: Creates a unique 16-digit
application password that allows access to selected
capabilities. This requires that you have two-factor
authentication enabled on your Google account. I probably should
do that, but I haven't figured out a convenient way to do so.

 3. OAUTH2: This requires that you "register an application" with
Google. That application is then issued revokable credentials. The
application uses those credentials to send an access request to
Google. The account's owner then goes to a specified URL to
autorize that access. The application is then issued revokable
access and refresh tokens. The access token allows access to
specific APIs for a short period of time (maybe an hour). After
the access token expires, the refresh token can be used to obtain
a new access token.

The "register an application" step is where I got stuck. Other mutt
users seem to have been able to go to their GMail account's cloud
services page, create a project, create/register an application, and
then download OAUTH2 credentials which they then use (via an external
utility) with programs like mutt and msmtp.

When I tried to "register an application" it demanded support and
privacy policy URLs for my application. Those URLs had to be using
domains that had bee pre-registered with Google. The only domain where
I have a web page is at panix.com, and that domain isn't pre-
registered with Google. I don't own that domain, so I'm not going to
try to pre-register it with Google.

I could continue to read the list with slrn, but post using something
like Thunderbird, but do I really want to set up a whole new MUA just
for one mailing list? [The other 20+ mailing lists I follow are all
happy with posts from gmane.]

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


Re: Flush / update GUIs in PyQt5 during debugging in PyCharm

2021-09-26 Thread Mohsen Owzar
DFS schrieb am Freitag, 24. September 2021 um 14:52:41 UTC+2:
> On 9/24/2021 12:46 AM, Mohsen Owzar wrote: 
> > Hi Guys 
> > I've written a GUI using PyQt5 and in there I use StyleSheets (css) for the 
> > buttons and labels to change their background- and foreground-colors and 
> > their states as well. 
> > Because my program doesn't function correctly, I try to debug it in my IDE 
> > (PyCharm). 
> > The problem is that during debugging, when I change some attributes of a 
> > button or label, let say its background-color, I can not see this 
> > modification of the color until the whole method or function is completed. 
> > I believe that I have seen somewhere during my searches and googling that 
> > one can flush or update the GUI after each step/action is done. 
> > But until now I couldn't manage it and I don't know where I have to invoke 
> > flush/update command in PyCharm. 
> > If anyone has done this before and knows about it, I would very appreciate 
> > seeing his solution. 
> > 
> > Regards 
> > Mohsen
> screen: 
> form.repaint() 
> 
> individual widgets: 
> form.widget.repaint()

@DFS
Hi 
I tried to use your suggestion in my code, to see changes in the 
background-color of the widgets (buttons and labels).
Below is the link of two screenshots of my GUI:
https://imgur.com/a/5LIefN7
They show the start phase and after clicking the “All Active” button.
As I wrote before, I use Stylesheets for configuring widgets.
Here is the code snipped of the relevant part:
::
if state == 'All Active':
. . . 
. . .
for i in range(7):
for j in range(6):
self.buttons_active[j].setText('Inactive')
self.buttons_active[j].setEnabled(True)
self.buttons_active[j].setChecked(True)
self.buttons_active[j].setStyleSheet(css_pushButton())
##

self.buttons_reset[j].setChecked(True)
self.buttons_reset[j].setEnabled(False)
self.buttons_reset[j].setStyleSheet(css_pushButton())
 
#

if i > 0 and j < 6:

self.labels[i, j].setProperty('orange', True)
# self.labels[i, j].repaint()
#  = 4
else:

self.labels[i, j].setProperty('yellow', True)
# self.labels[i, j].repaint()
#  = 4

self.labels[i, j].setStyleSheet(css_Label())
self.labels[i, j].repaint()
aaa = 4
#

else:
. . .
. . .
for i in range(7):
for j in range(6):
self.buttons_active[j].setText('Active')
self.buttons_active[j].setEnabled(True)
self.buttons_active[j].setStyleSheet(css_pushButton())
##

##
self.buttons_reset[j].setChecked(False)
self.buttons_reset[j].setEnabled(True)
self.buttons_reset[j].setStyleSheet(css_pushButton())
##

if i > 0:
##
self.labels[i, j].setProperty('gray', True)
# self.labels[i, j].repaint()
#  = 4
else:
self.labels[i, j].setProperty('yellow', True)
# self.labels[i, j].repaint()
#  = 4

self.labels[i, j].setStyleSheet(css_Label())
self.labels[i, j].repaint()
aaa = 4
::
As you can see, the if-else part has to change the background-color of the gray 
labels (at the start) and the buttons “Active”, “Reset”, “All Active” and 
“Exit” to orange.
The problem is, after clicking on the “All Active” button all “Resets” and the 
gray labels change their background-color to orange as desired.
But when I afterwards click again on this button (Now its name is “All 
Inactive”), the “Resets” and “Exit” buttons change their color and not the 36 
labels. They remain in orange.
Therefore I wanted to debug the 

[issue45249] Update doctect SyntaxErrors for location range

2021-09-26 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Terry: please take a look - https://github.com/python/cpython/pull/28567/files .

--

___
Python tracker 

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



[issue45292] Implement PEP 654

2021-09-26 Thread Irit Katriel


New submission from Irit Katriel :

We will implement Exception Groups and except* in a series of PRs:

1. Add the ExceptionGroup and BaseExceptionGroup classes
2. Update traceback rendering code (python and C) for exception groups.
3. Implement except*
4. Write documentation sections.

--

___
Python tracker 

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



[issue45292] Implement PEP 654

2021-09-26 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue45249] Update doctect SyntaxErrors for location range

2021-09-26 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
pull_requests: +26951
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/28567

___
Python tracker 

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



Re: Posts from gmane no longer allowed?

2021-09-26 Thread Chris Angelico
On Sun, Sep 26, 2021 at 11:37 PM Grant Edwards
 wrote:
>
> I've been trying to figure out how to set up mutt with oauth2 for
> gmail, but have run into a wall there too: Google doesn't want to let
> me create an "application" unless I have my own domain pre-registered
> with Google.
>
> Perhaps after 20+ years participating here, it's time to call it
> quits.
>

Not sure what the significance of the "application" is - Google has
different services for where you're using it with your own domain, but
that shouldn't be relevant. If you want to use Gmail with mutt, you
should be able to do that, regardless. (Or you can just use some other
email address to post from, that would also work.)

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


Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-25, Grant Edwards  wrote:

> I've been reading (and posting to) this list for many years by
> pointing an NNTP client at
> news://gmane.comp.python.general. Sometime in the past few days
> posts started being refused:
>
> You have tried posting to gmane.comp.python.general, which is a
> unidirectional mailing list. Gmane can therefore not send this
> message to that mailing list.
>
> Was this a change made by the mailing list admins?
>
> If so, is it permanent?
>
> [Trying to send a plaintext e-mail via Gmail, but not sure if it's
> working.]

When composing plaintext, Gmail really should switch to a fixed font.
I'll try writing the post in slrn (which calls emacs in mail-mode) and
then inserting that file into gmail. What a colossal PITA.

Another gmane user posted a reply to my message, and I see it got
rejected also.

Were posts from gmane causing problems?

I've been trying to figure out how to set up mutt with oauth2 for
gmail, but have run into a wall there too: Google doesn't want to let
me create an "application" unless I have my own domain pre-registered
with Google.

Perhaps after 20+ years participating here, it's time to call it
quits.

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


[issue45293] List inplace addition different from normal addition

2021-09-26 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

https://docs.python.org/3/faq/programming.html#faq-augmented-assignment-tuple-error

> for lists, __iadd__ is equivalent to calling extend on the list and returning 
> the list. That’s why we say that for lists, += is a “shorthand” for 
> list.extend

This example is calling extend on list of strings with another string as 
argument. Hence the target string is iterated and each character is added as an 
element. __add__ is different compared __iadd__. For += __iadd__ is called if 
defined and falls back to __add__

--
nosy: +xtreak

___
Python tracker 

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



[issue45293] List inplace addition different from normal addition

2021-09-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

For those not in front of a computer, the error is:

>>> l = l + 'de'
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can only concatenate list (not "str") to list

--
nosy: +eric.smith

___
Python tracker 

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



[issue45293] List inplace addition different from normal addition

2021-09-26 Thread Kapil Bansal


New submission from Kapil Bansal :

Hi,

I tried addition and in-place addition on a list.

>>> l = ['a', 'b', 'c']

>>> l = l + 'de' (raises an error)

>>> l += 'de'
>>> print(l)
['a', 'b' , 'c', 'd', 'e']

I want to ask why the behaviour of both these are different?? If it is done 
intentionally, then it should be there in the documentation but I am not able 
to find any reference.

--
messages: 402658
nosy: KapilBansal320
priority: normal
severity: normal
status: open
title: List inplace addition different from normal addition
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue45292] Implement PEP 654

2021-09-26 Thread Irit Katriel


Change by Irit Katriel :


--
assignee: iritkatriel
components: Documentation, Interpreter Core, Library (Lib)
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Implement PEP 654
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



[issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7

2021-09-26 Thread Yiyang Zhan


Change by Yiyang Zhan :


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

___
Python tracker 

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



[issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7

2021-09-26 Thread Yiyang Zhan


New submission from Yiyang Zhan :

The instructions in "Custom OpenSSL" section of "Using Python on Unix 
platforms" do not work on CentOS 7: 
https://github.com/python/cpython/blob/v3.10.0rc2/Doc/using/unix.rst#custom-openssl.

CPython's ./configure script assumes the OpenSSL's library resides in 
"$ssldir/lib". This isn't guaranteed with the current instruction, because 
OpenSSL might create for example lib64 for the .so files. See 
https://github.com/openssl/openssl/blob/openssl-3.0.0/INSTALL.md#libdir:

> Some build targets have a multilib postfix set in the build configuration. 
> For these targets the default libdir is lib. Please use 
> --libdir=lib to override the libdir if adding the postfix is undesirable.

Therefore it's better to explicitly set --libdir=lib.

--
assignee: docs@python
components: Documentation
messages: 402657
nosy: docs@python, zhanpon
priority: normal
severity: normal
status: open
title: Some instructions in the "Using Python on Unix platforms" document do no 
work on CentOS 7
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue41271] Add support for io_uring to cpython

2021-09-26 Thread Dima Tisnek


Dima Tisnek  added the comment:

Would now, a year later, be a good time to consider io_uring?

--
nosy: +Dima.Tisnek

___
Python tracker 

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