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

2021-01-01 Thread Ken Jin


Ken Jin  added the comment:

I have just one more PR - one that converts genericalias nested lists to
tuples by default. It'll simplify the code a little bit and prepare 3.9.x
for PEP 612.

--

___
Python tracker 

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



[issue42807] smtplib send_message should gives more clear exception if the msg is None

2021-01-01 Thread oon arfiandwi


New submission from oon arfiandwi :

I want to enhance the error message on the send_message method of class SMTP, 
in module smtplib.

One of the parameters on send_message is msg which is email.message.Message 
object, this is a required argument. If the msg is None, currently it will 
raise "AttributeError: 'NoneType' object has no attribute 'get_all'".
This message is not straight forward and a bit hard to debug.

As the easy fix with additional check if msg is None in send_message method.

I want to add PR on this, also with the additional test(s). This is my first 
issue, appreciate any feedback. thank you.

--
components: Library (Lib)
messages: 384216
nosy: oon
priority: normal
severity: normal
status: open
title: smtplib send_message should gives more clear exception if the msg is None
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na

Dong-hee Na  added the comment:

Thanks, Ross Rhodes for the fix!
And thanks, Wüstengecko for the report!

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 69120613c071e9327a9dc6e4b1ff21b2e94d885e by Ross in branch '3.9':
[3.9] bpo-42756: Configure LMTP Unix-domain socket to use global default 
timeout when timeout not provided (GH-23969) (GH-24050)
https://github.com/python/cpython/commit/69120613c071e9327a9dc6e4b1ff21b2e94d885e


--

___
Python tracker 

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



[issue7946] Convoy effect with I/O bound threads and New GIL

2021-01-01 Thread David Beazley


Change by David Beazley :


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



[issue16894] Function attribute access doesn't invoke methods in dict subclasses

2021-01-01 Thread David Beazley


Change by David Beazley :


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



[issue24844] Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4

2021-01-01 Thread David Beazley


Change by David Beazley :


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



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2021-01-01 Thread David Beazley


Change by David Beazley :


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



[issue27436] Strange code in selectors.KqueueSelector

2021-01-01 Thread David Beazley


Change by David Beazley :


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



[issue16132] ctypes incorrectly encodes .format attribute of memory views

2021-01-01 Thread David Beazley


Change by David Beazley :


--
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: A random word from one of two lists

2021-01-01 Thread Bischoop
On 2021-01-02, Python  wrote:
>
> >>> from random import choice
> >>> choice(words[choice(list(words.keys()))])
> 'apple'
> >>> choice(words[choice(list(words.keys()))])
> 'kangaroo'
> >>> choice(words[choice(list(words.keys()))])
> 'koala'
> >>> choice(words[choice(list(words.keys()))])
> 'apple'
> >>> choice(words[choice(list(words.keys()))])
> 'kangaroo'
>
> or this?
>
> >>> randstuff = lambda: choice(words[choice(list(words.keys()))])
> >>> randstuff()
> 'kangaroo'
> >>> randstuff()
> 'kangaroo'
> >>> randstuff()
> 'apple'
> >>> randstuff()
> 'kangaroo'
> >>> randstuff()
> 'koala'
> >>> randstuff()
> 'banana'

that lambada method is good.


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


Re: A random word from one of two lists

2021-01-01 Thread Bischoop
On 2021-01-01, Cameron Simpson  wrote:
>
> kinds = list(words.keys())
>

Yes, solved it with that exeactly.

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


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

2021-01-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Looks like we can close this now, right? You can open a separate issue in the 
python/typing repo to update typing_extensions.

--

___
Python tracker 

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



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

2021-01-01 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 11276cd9c49faea66ce7760f26a238d1edbf6421 by Ken Jin in branch 
'master':
bpo-41559: Documentation for PEP 612 (GH-24000)
https://github.com/python/cpython/commit/11276cd9c49faea66ce7760f26a238d1edbf6421


--

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-01 Thread Anthony Sottile


Anthony Sottile  added the comment:

I didn't initially, but now I have and it has the same bug in the current 
master: 3bf05327c2b25d42b92795d9d280288c22a0963d

--

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Did you check this with master?

--

___
Python tracker 

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



[issue30044] shutil.copystat should (allow to) copy ownership, and other attributes

2021-01-01 Thread Rahul Jha


Change by Rahul Jha :


--
nosy: +RJ722

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-01 Thread Anthony Sottile


Anthony Sottile  added the comment:

+peg parser individuals to nosy

--
nosy: +gvanrossum, lys.nikolaou, pablogsal

___
Python tracker 

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



[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2021-01-01 Thread Rahul Jha


Change by Rahul Jha :


--
nosy: +RJ722

___
Python tracker 

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



Re: Control stript which is runing in background.

2021-01-01 Thread Alan Bawden
jak  writes:

   Il 01/01/2021 06:23, Alan Bawden ha scritto:
   > jak  writes:
   >
   > Running the command:
   >
   > $ cat bible.txt > cmdpipe & cat bible.txt > cmdpipe & cat bible.txt > 
cmdpipe
   >
   > the three texts do not mix
   >
   > The three texts do not mix as long at the contents of bible.txt is short
   > enough (and provided `cat' only calls `write' once).  In the POSIX
   > specification, the manual page for the `write' system call describes
   > writing to a pipe or FIFO as follows:
   >
   >Write requests of {PIPE_BUF} bytes or less shall not be interleaved
   >with data from other processes doing writes on the same pipe.  Writes
   >of greater than {PIPE_BUF} bytes may have data interleaved, on
   >arbitrary boundaries, with writes by other processes, whether or not
   >the O_NONBLOCK flag of the file status flags is set.
   >
   Ok. And...
...Running the command:

$ cat bible.txt > cmdpipe & cat bible.txt > cmdpipe & cat bible.txt > 
cmdpipe

the three texts do not mix

Saying it again doesn't make it any more true.  If bible.txt is large
enough, they most definitely DO mix!  Just to make sure I wasn't missing
something, I tested your exact command before I sent my previous reply.
They mixed.

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


[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-01 Thread Anthony Sottile


New submission from Anthony Sottile :

here's a sample file.  this is distilled down from an example which broke a 
code formatter here: https://github.com/asottile/add-trailing-comma/issues/106

def f():
x = (
'PERL_MM_OPT', (
f'INSTALL-BASE={shlex.quote(venv)} '
f'wat'
),
)


A diff from astpretty (https://github.com/asottile/astpretty) between the old 
and new parser:

```console
$ diff -u <(.tox/py39/bin/python -X oldparser -m astpretty perl.py) 
<(.tox/py39/bin/python -m astpretty perl.py)
--- /dev/fd/63  2021-01-01 15:58:09.108060968 -0800
+++ /dev/fd/62  2021-01-01 15:58:09.108060968 -0800
@@ -35,19 +35,19 @@
 end_col_offset=22,
 value=Call(
 lineno=4,
-col_offset=32,
+col_offset=16,
 end_lineno=4,
-end_col_offset=49,
+end_col_offset=33,
 func=Attribute(
 lineno=4,
-col_offset=32,
+col_offset=16,
 end_lineno=4,
-end_col_offset=43,
-value=Name(lineno=4, 
col_offset=32, end_lineno=4, end_col_offset=37, id='shlex', ctx=Load()),
+end_col_offset=27,
+value=Name(lineno=4, 
col_offset=16, end_lineno=4, end_col_offset=21, id='shlex', ctx=Load()),
 attr='quote',
 ctx=Load(),
 ),
-args=[Name(lineno=4, 
col_offset=44, end_lineno=4, end_col_offset=48, id='venv', ctx=Load())],
+args=[Name(lineno=4, 
col_offset=28, end_lineno=4, end_col_offset=32, id='venv', ctx=Load())],
 keywords=[],
 ),
 conversion=-1,
```

the old parser is correct here, and the new parser is wrong

notably it thinks that the call inside the f-string substitution is positioned 
at column 16 which is the position of the f-string start

this bug is also present in 3.10:

```console
$ venv/bin/python3.10 --version
Python 3.10.0a3
$ diff -u <(.tox/py39/bin/python -X oldparser -m astpretty perl.py) 
<(venv/bin/python3.10 -m astpretty perl.py)
--- /dev/fd/63  2021-01-01 15:59:54.59968 -0800
+++ /dev/fd/62  2021-01-01 15:59:54.59968 -0800
@@ -35,19 +35,19 @@
 end_col_offset=22,
 value=Call(
 lineno=4,
-col_offset=32,
+col_offset=16,
 end_lineno=4,
-end_col_offset=49,
+end_col_offset=33,
 func=Attribute(
 lineno=4,
-col_offset=32,
+col_offset=16,
 end_lineno=4,
-end_col_offset=43,
-value=Name(lineno=4, 
col_offset=32, end_lineno=4, end_col_offset=37, id='shlex', ctx=Load()),
+end_col_offset=27,
+value=Name(lineno=4, 
col_offset=16, end_lineno=4, end_col_offset=21, id='shlex', ctx=Load()),
 attr='quote',
 ctx=Load(),
 ),
-args=[Name(lineno=4, 
col_offset=44, end_lineno=4, end_col_offset=48, id='venv', ctx=Load())],
+args=[Name(lineno=4, 
col_offset=28, end_lineno=4, end_col_offset=32, id='venv', ctx=Load())],
 keywords=[],
 ),
 conversion=-1,
```

--
components: Interpreter Core
messages: 384208
nosy: Anthony Sottile
priority: normal
severity: normal
status: open

[issue42805] broken pygame integration into wxpython

2021-01-01 Thread monchy


monchy  added the comment:

The only thing I changed was the version of python I was using, which means
that whatever caused the problem was python itself
if something was changed in how the interpreter operates the environmental
variables or something then that might do it
PYTHON broke MY software, so this and this alone is the appropriate bug
tracker

On Fri, 1 Jan 2021 at 15:54, Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka  added the comment:
>
> Pygame and wxpython are not parts of the stdlib. Please use an appropriate
> bug tracker.
>
> --
> nosy: +serhiy.storchaka
> resolution:  -> third party
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



Re: A random word from one of two lists

2021-01-01 Thread Marco Sulla
Try this:

>>> animal = ['koala', 'kangaroo']
>>> fruit = ['banana', 'apple']
>>> words = {'animals': animal, 'fruits': fruit}
>>> kinds = tuple(words.keys())
>>> kind = random.choice(kinds)
>>> kind
'animals'
>>> word = random.choice(words[kind])
>>> word
'koala'
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A random word from one of two lists

2021-01-01 Thread Cameron Simpson
On 01Jan2021 22:58, Bischoop  wrote:
>I have two lists *animal* and *fruit* and I try to get a random variable
>animal or fruit and then random word from that list.
>I thought that dictionary(*words*) could help me but no succes, the only way 
>I've
>done partially what was with list *kinds* and by using two times
>random.choice. However print(kind) return me a list not a variable:
>animal or fruit so now I'm kinda confuse if I can achieve that.
>
>import random
>animal = ['koala', 'kangaroo']
>fruit = ['banana', 'apple']

This is fine.

>kinds = [animal,fruit]

This probably isn't what you intend. Print out kinds:

print(repr(kinds))

>words = {'animals': animal, 'fruits': fruit}

I suspect you want, after this line:

kinds = list(words.keys())

which gets you a list of the dictionary keys. Print that, too, to see 
the difference.

>kind = random.choice(kinds)
>print(kind)

When the earlier stuff works, this should be a string.

>word = random.choice(kind)

This picks a random character from the string. Probably not what you 
want. You want to pick from the list of animals or fruits. Since you 
(will) have the word "animals" or "fruits" in "kind", how do you 
reference the appropriate list?

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


Re: A random word from one of two lists

2021-01-01 Thread Richard Damon
On 1/1/21 5:58 PM, Bischoop wrote:
> I have two lists *animal* and *fruit* and I try to get a random variable
> animal or fruit and then random word from that list.
> I thought that dictionary(*words*) could help me but no succes, the only way 
> I've
> done partially what was with list *kinds* and by using two times
> random.choice. However print(kind) return me a list not a variable:
> animal or fruit so now I'm kinda confuse if I can achieve that.
>
>
>
> import random
> animal = ['koala', 'kangaroo']
> fruit = ['banana', 'apple']
> kinds = [animal,fruit]
> words = {'animals': animal, 'fruits': fruit}
>
>
> kind = random.choice(kinds)
> print(kind)
> word = random.choice(kind)
> print(word)
> #output:
> ['kolala', 'kangaroo']
> kangaroo
>
> --
> Thanks

random.choice doesn't return 'a variable' but an object. Which is the
same object that one of the variables that you used.

IF you wanted to use words, then you could have made kinds = {'animals',
'fruits'} and then looked up the list in words, but that is really just
more work (unless you want to know which list it came from)

Note that 'animals' isn't a variable, but a string value.

-- 
Richard Damon

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


Re: Control stript which is runing in background.

2021-01-01 Thread 2QdxY4RzWzUUiLuE
On 2021-01-01 at 21:41:24 +0100,
jak  wrote:

> Sorry if I made you argumentative ...

And I didn't mean to be argumentative.  :-)

We both offered alternatives, and we both argued for them (in the sense
of claiming that our own ideas were good).  Each solution is better,
depending on certain details of the OP's requirements.

> ... Furthermore, the OP will have already made its choice by now ...

We don't know that.

> ... Just one last comment: I understand your point of view but I
> disagree because the difficulty in providing assistance as the
> customer wishes depends on how you have designed the product and not
> on how you develop the pieces that compose it ...

I agree:  most companies have no more customer service.  :-)

Our business was emergency communications equipment; if we didn't
provide such assistance, or the equipment didn't do certain things,
there was a distinct possibility that someome could die.

When a police officer presses the button, he or she has to talk to the
dispatcher in 250ms or less.  Same for an emergency medical technician
in an ambulance.  A 60-second TCP timeout or an HTTP 503 error is not
okay.  You can't tell people in a burning building to wait until the
dispatch center has finished their upgrades, and you can't take the
whole fire department off line to upgrade the radios in all the trucks
at once.  It's not a matter of what's easiest to develop, or the easiest
to support.

I think I'm coming off gruffly again, but I don't mean to.

> ... One more thing: you probably don't care anymore, but people have
> taught me that if you give a customer something, you can't sell it to
> him anymore.

Please don't tell me what I do or don't care about.  :-)

I agree:  once you give something away for free, it's very difficult to
charge money for it later.  Believe me, we didn't give our
communications equipment (or the subsequent software upgrades, unless
there was a serious bug) away for free.  :-)
-- 
https://mail.python.org/mailman/listinfo/python-list


A random word from one of two lists

2021-01-01 Thread Bischoop
I have two lists *animal* and *fruit* and I try to get a random variable
animal or fruit and then random word from that list.
I thought that dictionary(*words*) could help me but no succes, the only way 
I've
done partially what was with list *kinds* and by using two times
random.choice. However print(kind) return me a list not a variable:
animal or fruit so now I'm kinda confuse if I can achieve that.



import random
animal = ['koala', 'kangaroo']
fruit = ['banana', 'apple']
kinds = [animal,fruit]
words = {'animals': animal, 'fruits': fruit}


kind = random.choice(kinds)
print(kind)
word = random.choice(kind)
print(word)
#output:
['kolala', 'kangaroo']
kangaroo

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


Re: Funny error message

2021-01-01 Thread Bob van der Poel
> Assuming Python is maintained only at the system-level (cf --user or
> > venv) then it may be possible that installing some application that
> runs
> > 'on' Python added the local-library (as a "dependency"). Alternately,
> > many beginners following installation instructions on a
> paint-by-numbers
> > basis, may type/copy-paste commands without retaining any memory of
> > same.
> > [observation, not personal criticism]
> >
> > Python has been designed to offer flexibility. One of which is the
> > ability to have multiple, co-resident, versions of Python and/or
> > libraries. Of course, this also produces exactly the type of 'gotcha'
> > illustrated (detected, and solved) here.
> >
> > Someone more familiar with Python-packaging may improve/correct...
> >
> >
> > On a thematically-related, but OT-note:
> > I decided to install a 'fresh' version of Fedora 33 on this machine,
> > rather than performing a version-update. (required one hour from
> > start-to-finish - try that MS-Win users!) The Python-relevance was to
> > ensure there was no legacy-Python2 left 'lying-around'. However, the
> > GIMP (popular graphics package) still uses (and has some sort of
> > 'exemption' to use) Python2. Stymied! Not quite - there's a Flatpak
> > option - which will enable my Python3-only objective by ring-fencing
> the
> > GIMP and its dependencies. However... now I have a system package
> > manager (dnf (~apt)) installing most system-software and 'other
> stuff'
> > under a different method (I took the same approach with the Chromium
> > browser) - how long will it be before such 'cleverness' is
> > forgotten/trips me up?
> >
> >
> > I have installed a few packages using pip. I "try" to do so as root
> > (this is basically a one user machine) ... but I may have installed as
> > user. Still, it should not have brought in a complete py set of
> > libraries. I'm going with the idea that some other package, either via
> > apt or flatpak (which I really don't trust) decided to be nice. But it
> > was a mess to have python distros in /usr/lib, /usr/local/lib and
> > ./local ... I am going to really try in the future to have everything in
> > one spot!
>
> I'm not sure if you mean that you intend moving files from the directory
> where they were loaded to somewhere else - I would hesitate!
>
>
> As before, there is a tradeoff between 'tidiness' and 'flexibility'.
> Perhaps do some reading to ensure a grasp of Python's library/directory
> structures and system/virtual environments, first?
>
> What me? Read? Actually a good suggestion ... I'll make note of the
recommended reading list. Thanks.


> Suggestions:
> sys.path https://docs.python.org/3/using/cmdline.html
> 2.3. Python-related paths and files
> https://docs.python.org/3/using/unix.html#python-related-paths-and-files
> PEP 370 -- Per user site-packages directory
> https://www.python.org/dev/peps/pep-0370/
> and to really dive 'under the covers'
> https://www.python.org/dev/peps/pep-0587/
> - with plenty more, both on-site and externally.
>
> It quickly becomes apparent that there are risks in assuming that what
> 'should be done' for one project/application will 'always' be OK. Sadly,
> such may have an (undesirable) impact on another/others. Thus, the
> virtue of project-dedicated venvs (alternately OpSys-level containers)!
>
>
> > Speaking of "one spot" I also see that some functions do not create the
> > .pyc versions. Running as a user, the compressed version can't be
> > created in /usr/lib/. I assume the installer is supposed to do that, but
> > it does appear that it's not 100%.
>
> There are multiple reasons for this, but the first time that code is
> run, a .pyc will (presumably) be created - and we're back to
> considerations of Python environments, Python cf C, perhaps even
>
>
Oh no! Not these damned dragons again :)

But, seriously. No, I have no idea of moving installed stuff around between
/usr /.local and /usr/local. There lies no dragons but madness :) I meant
that I will pay more attention as to what the installer(s) are doing.

Thanks for the input.


-- 

 Listen to my FREE CD at http://www.mellowood.ca/music/cedars 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW:   http://www.mellowood.ca
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Funny error message

2021-01-01 Thread DL Neil via Python-list
On 1/2/21 9:39 AM, Bob van der Poel wrote:
> 
> 
> On Fri, Jan 1, 2021 at 12:17 PM DL Neil via Python-list
> mailto:python-list@python.org>> wrote:
> 
> On 1/2/21 6:35 AM, Bob van der Poel wrote:
> > Found it!
> 
> Well done!
> 
> 
> >>     I had the proper urllib3 installed. But, in my .local/lib/ a
> previous
> >>     version was installed. Removing .local/lib/python3.8 has
> resolved the
> >>     problem.
> >>
> >>     Anyone hazard a guess as to why I had a .local tree (nope, I did
> >>     not create
> >>     it ... I don't think!).
> >>
> >
> >     That is where "python3.8 -m pip install --user" puts the packages
> >     you install.
> >
> >     Barry
> >
> >
> >
> > Okay ... I'll take your word for it. But, I really don't think I've
> > every run that command :)
> 
> Assuming Python is maintained only at the system-level (cf --user or
> venv) then it may be possible that installing some application that runs
> 'on' Python added the local-library (as a "dependency"). Alternately,
> many beginners following installation instructions on a paint-by-numbers
> basis, may type/copy-paste commands without retaining any memory of
> same.
> [observation, not personal criticism]
> 
> Python has been designed to offer flexibility. One of which is the
> ability to have multiple, co-resident, versions of Python and/or
> libraries. Of course, this also produces exactly the type of 'gotcha'
> illustrated (detected, and solved) here.
> 
> Someone more familiar with Python-packaging may improve/correct...
> 
> 
> On a thematically-related, but OT-note:
> I decided to install a 'fresh' version of Fedora 33 on this machine,
> rather than performing a version-update. (required one hour from
> start-to-finish - try that MS-Win users!) The Python-relevance was to
> ensure there was no legacy-Python2 left 'lying-around'. However, the
> GIMP (popular graphics package) still uses (and has some sort of
> 'exemption' to use) Python2. Stymied! Not quite - there's a Flatpak
> option - which will enable my Python3-only objective by ring-fencing the
> GIMP and its dependencies. However... now I have a system package
> manager (dnf (~apt)) installing most system-software and 'other stuff'
> under a different method (I took the same approach with the Chromium
> browser) - how long will it be before such 'cleverness' is
> forgotten/trips me up?
> 
> 
> I have installed a few packages using pip. I "try" to do so as root
> (this is basically a one user machine) ... but I may have installed as
> user. Still, it should not have brought in a complete py set of
> libraries. I'm going with the idea that some other package, either via
> apt or flatpak (which I really don't trust) decided to be nice. But it
> was a mess to have python distros in /usr/lib, /usr/local/lib and
> ./local ... I am going to really try in the future to have everything in
> one spot!

I'm not sure if you mean that you intend moving files from the directory
where they were loaded to somewhere else - I would hesitate!


As before, there is a tradeoff between 'tidiness' and 'flexibility'.
Perhaps do some reading to ensure a grasp of Python's library/directory
structures and system/virtual environments, first?

Suggestions:
sys.path https://docs.python.org/3/using/cmdline.html
2.3. Python-related paths and files
https://docs.python.org/3/using/unix.html#python-related-paths-and-files
PEP 370 -- Per user site-packages directory
https://www.python.org/dev/peps/pep-0370/
and to really dive 'under the covers'
https://www.python.org/dev/peps/pep-0587/
- with plenty more, both on-site and externally.

It quickly becomes apparent that there are risks in assuming that what
'should be done' for one project/application will 'always' be OK. Sadly,
such may have an (undesirable) impact on another/others. Thus, the
virtue of project-dedicated venvs (alternately OpSys-level containers)!


> Speaking of "one spot" I also see that some functions do not create the
> .pyc versions. Running as a user, the compressed version can't be
> created in /usr/lib/. I assume the installer is supposed to do that, but
> it does appear that it's not 100%.

There are multiple reasons for this, but the first time that code is
run, a .pyc will (presumably) be created - and we're back to
considerations of Python environments, Python cf C, perhaps even
differences between OpSys - certainly and once-again, 'here be dragons'...
-- 
Regards =dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Control stript which is runing in background.

2021-01-01 Thread Cameron Simpson
On 01Jan2021 03:43, jak  wrote:
>Maybe the fact that I'm not English and I don't know the language well
>doesn't allow me to express myself clearly. Try it one more time:
>The OP would like to give some command to a script that is running. How?
>With a script that sends commands to it. One of the ways, as mentioned,
>is by using a mini socket server. Given the needs of the OP and the fact
>that sockets are a limited resource in a system, I took the liberty of
>proposing a simple alternative: using a named pipe, also because, IMO,
>sockets, in this case, are an overkill. with a few lines of code in a
>thread in the running script they can allow it to receive commands:

You're right. For receive only of small things this is pretty simple.  
Not to mention much easier on the command sender:

echo "my command" >the-named-pipe

I'm sorry for conflating the concurrency and return-a-response needs of 
a full blown client/server app with the much simpler request of the OP: 
to control a daemon simply. I've even done exactly what you suggested 
myself.

I think it's pretty clear that you're aware of the difference in 
behaviours and semantics between UNIX named pipes (unidirection shared 
single channel) with sockets (bidirection distinct multichannels).

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


[issue42805] broken pygame integration into wxpython

2021-01-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Pygame and wxpython are not parts of the stdlib. Please use an appropriate bug 
tracker.

--
nosy: +serhiy.storchaka
resolution:  -> third party
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



[issue42759] Take into acount a Tcl interpreter when compare variables and fonts

2021-01-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



Re: ANN: unicode 2.8

2021-01-01 Thread garabik-news-2005-05
Terry Reedy  wrote:
> On 12/31/2020 9:36 AM, garabik-news-2005...@kassiopeia.juls.savba.sk wrote:
>> unicode is a simple python command line utility that displays
>> properties for a given unicode character, or searches
>> unicode database for a given name.
> ...
>> Changes since previous versions:
>> 
>>   * display ASCII table (either traditional with --ascii or the new
>> EU–UK Trade and Cooperation Agreement version with --brexit-ascii)
> 
> Are you reproducing it with bugs included?
> How is that of any use to anyone?

Including the (correct) ASCII table has been a long term, low priority -
I am using ascii(1) utility reasonably often and it makes sense to
reproduce this functionality.

And when implementing this, it was a no-brainer to include also the
brexit varian (verbatim). After all, given the blood and sweat and tears
shed during the negotiations, I am sure each and every line of the
Agreement has been combed and (re)negotiated over and over by experienced
negotiators and verified an army of experts in the fields 

-- 
 ---
| Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/ |
| __..--^^^--..__garabik @ kassiopeia.juls.savba.sk |
 ---
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26407] csv.writer.writerows masks exceptions from __iter__

2021-01-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: commit 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



[issue39068] Base 85 encoding initialization race condition

2021-01-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



Re: Control stript which is runing in background.

2021-01-01 Thread jak

Il 01/01/2021 14:49, 2qdxy4rzwzuui...@potatochowder.com ha scritto:

On 2021-01-01 at 11:11:47 +0100,
jak  wrote:


Il 01/01/2021 04:14, 2qdxy4rzwzuui...@potatochowder.com ha scritto:

On 2021-01-01 at 03:43:43 +0100,
jak  wrote:

I think you were clear enough before, but you may not have
considered things the OP did not specify.  One of the hardest parts
of software development is understanding and specifying the actual
problem to be solved.  I've never done that in a second language
(I'm nowhere near fluent in anything other than English); I can only
imagine the extra layers of complexity.


This is the OP's initial request:


Hi. I would like to make something like this:
A python script would run headlessly in the background.
I would like to control the script from the command line using other python 
scripts or from the python shell.
 From time to time I would ask the main script to create a popup window with an 
image or a plot.
What would be the proper way to approach it. How to make communication between 
two scripts?
Thank you.
Petro.


I have suggested an alternative way for his necessity.
It will be up to him to decide which one he should adopt. That way he
has a choice, at least.
I don't know where you work. I know, however, that in these zones, if
you do more than necessary wasting their time, they will kick you away.


So what is necessary?  Does "control the script" include reporting
success or failure of a request?  The OP also said "communication
between two scripts," which to me means two way traffic.  Only the OP
knows for sure, and at least one of us might get it wrong if we don't
ask, or at least acknowledge that we don't know.

If I start with a named pipe because it's good enough for Phase Zero, or
Version 0.0.1, or Release Experimental Alpha, then I'm going to end up
ripping that out or reinventing something that already existed on top of
that named pipe.

Suppose I look ahead just a little, and use a socket in the first place.
Yes, you could argue that it's more than what was necessary and kick me
away.  Will you kick me again when you can build on it (I can't; I'm
gone) instead of having to rebuild what already worked?

I'm retired now, but I at one employer, I worked on products with (a)
lifetimes measured in decades, (b) extremely expensive (money, time,
convenience, etc.) upgrade/maintenance cycles, and therefore (c) strict
interoperability requirements.¹  A little bit of foresight and extra
analysis up front went a long way towards saving a lot of headaches and
development resources (and customers!)  in the long term.
Communications protocols in particular had to be well thought out, and
often more complex than was immediately necessary, because backwards and
forwards compatibility were not negotiable.

Again, I'm not (and no one else is, either) saying that your solution is
wrong or won't work.  Your solution may even be the be the best solution
to the OP's problem.  All I'm saying is that we can't know until the OP
tells us more.  Yes, the OP has a choice to make.  Maybe we have helped,
not by making that choice, but by giving it to the OP with enough
supporting information to make it.

¹ Think about a system containing dozens of individually field
upgradeable components.  It had to work when a customer upgraded one
component at a time (over the course of weeks or months), or plugged in
an old component while they were waiting for a broken one to be
repaired, or added a brand new component to a system that hadn't been
changed or upgraded for years.  There was no such thing as telling the
customer to wait, or to make them take down the entire system to upgrade
everything at once.  *That* was what was necessary.


Sorry if I made you argumentative. It was not my intention. Let me
reiterate once again that my intention was to offer an alternative to
the OP and that I never claimed my way was better than the other
suggestions. Furthermore, the OP will have already made its choice by
now. Just one last comment: I understand your point of view but I
disagree because the difficulty in providing assistance as the customer
wishes depends on how you have designed the product and not on how you
develop the pieces that compose it. One more thing: you probably don't
care anymore, but people have taught me that if you give a customer
something, you can't sell it to him anymore.

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


[issue39068] Base 85 encoding initialization race condition

2021-01-01 Thread miss-islington


miss-islington  added the comment:


New changeset 0d6e40744ae40ff397883ff90ca235efd3b63f18 by Miss Islington (bot) 
in branch '3.9':
bpo-39068: Fix race condition in base64 (GH-17627)
https://github.com/python/cpython/commit/0d6e40744ae40ff397883ff90ca235efd3b63f18


--

___
Python tracker 

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



Re: Funny error message

2021-01-01 Thread Bob van der Poel
On Fri, Jan 1, 2021 at 12:17 PM DL Neil via Python-list <
python-list@python.org> wrote:

> On 1/2/21 6:35 AM, Bob van der Poel wrote:
> > Found it!
>
> Well done!
>
>
> >> I had the proper urllib3 installed. But, in my .local/lib/ a
> previous
> >> version was installed. Removing .local/lib/python3.8 has resolved
> the
> >> problem.
> >>
> >> Anyone hazard a guess as to why I had a .local tree (nope, I did
> >> not create
> >> it ... I don't think!).
> >>
> >
> > That is where "python3.8 -m pip install --user" puts the packages
> > you install.
> >
> > Barry
> >
> >
> >
> > Okay ... I'll take your word for it. But, I really don't think I've
> > every run that command :)
>
> Assuming Python is maintained only at the system-level (cf --user or
> venv) then it may be possible that installing some application that runs
> 'on' Python added the local-library (as a "dependency"). Alternately,
> many beginners following installation instructions on a paint-by-numbers
> basis, may type/copy-paste commands without retaining any memory of same.
> [observation, not personal criticism]
>
> Python has been designed to offer flexibility. One of which is the
> ability to have multiple, co-resident, versions of Python and/or
> libraries. Of course, this also produces exactly the type of 'gotcha'
> illustrated (detected, and solved) here.
>
> Someone more familiar with Python-packaging may improve/correct...
>
>
> On a thematically-related, but OT-note:
> I decided to install a 'fresh' version of Fedora 33 on this machine,
> rather than performing a version-update. (required one hour from
> start-to-finish - try that MS-Win users!) The Python-relevance was to
> ensure there was no legacy-Python2 left 'lying-around'. However, the
> GIMP (popular graphics package) still uses (and has some sort of
> 'exemption' to use) Python2. Stymied! Not quite - there's a Flatpak
> option - which will enable my Python3-only objective by ring-fencing the
> GIMP and its dependencies. However... now I have a system package
> manager (dnf (~apt)) installing most system-software and 'other stuff'
> under a different method (I took the same approach with the Chromium
> browser) - how long will it be before such 'cleverness' is
> forgotten/trips me up?
>

I have installed a few packages using pip. I "try" to do so as root (this
is basically a one user machine) ... but I may have installed as user.
Still, it should not have brought in a complete py set of libraries. I'm
going with the idea that some other package, either via apt or flatpak
(which I really don't trust) decided to be nice. But it was a mess to have
python distros in /usr/lib, /usr/local/lib and ./local ... I am going to
really try in the future to have everything in one spot!

Speaking of "one spot" I also see that some functions do not create the
.pyc versions. Running as a user, the compressed version can't be created
in /usr/lib/. I assume the installer is supposed to do that, but it does
appear that it's not 100%.


-- 

 Listen to my FREE CD at http://www.mellowood.ca/music/cedars 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW:   http://www.mellowood.ca
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2021-01-01 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2021-01-01 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Yes, R. Hipp has fixed this here: 
https://www2.sqlite.org/cgi/src/info/e5d7209e118a8453
We still need to modify PCbuild in order to build the SQLite library with math 
functions from 3.35.0 and onwards.

--

___
Python tracker 

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



[issue42805] broken pygame integration into wxpython

2021-01-01 Thread monchy


New submission from monchy :

in previous python verions a pygame window could be embedded into wxpython by 
assigning the SDL_WINDOWID to the current wx.Panel.GetHandle() and the 
SDL_VIDEODRIVER to 'windib' before importing python
the same code creates a separate pygame window in the newest python version
a basic implementation can be found here:
https://github.com/Monchytales/Puppet-Theatre/blob/main/pygame_panel.py

--
messages: 384203
nosy: MonchyTales
priority: normal
severity: normal
status: open
title: broken pygame integration into wxpython
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Dong-hee Na for the fix!

We have many tests using external services, like test_ssl that Christian may 
know ;-)
https://pythondev.readthedocs.io/infra.html#services-used-by-unit-tests

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



[issue42804] Unable to compile the cpython code x86 windows

2021-01-01 Thread Sunny


Sunny  added the comment:

I am running using admin rights but still getting the error

--

___
Python tracker 

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



Re: Funny error message

2021-01-01 Thread DL Neil via Python-list
On 1/2/21 6:35 AM, Bob van der Poel wrote:
> Found it!

Well done!


>> I had the proper urllib3 installed. But, in my .local/lib/ a previous
>> version was installed. Removing .local/lib/python3.8 has resolved the
>> problem.
>>
>> Anyone hazard a guess as to why I had a .local tree (nope, I did
>> not create
>> it ... I don't think!).
>>
> 
> That is where "python3.8 -m pip install --user" puts the packages
> you install.
> 
> Barry
> 
> 
> 
> Okay ... I'll take your word for it. But, I really don't think I've
> every run that command :)

Assuming Python is maintained only at the system-level (cf --user or
venv) then it may be possible that installing some application that runs
'on' Python added the local-library (as a "dependency"). Alternately,
many beginners following installation instructions on a paint-by-numbers
basis, may type/copy-paste commands without retaining any memory of same.
[observation, not personal criticism]

Python has been designed to offer flexibility. One of which is the
ability to have multiple, co-resident, versions of Python and/or
libraries. Of course, this also produces exactly the type of 'gotcha'
illustrated (detected, and solved) here.

Someone more familiar with Python-packaging may improve/correct...


On a thematically-related, but OT-note:
I decided to install a 'fresh' version of Fedora 33 on this machine,
rather than performing a version-update. (required one hour from
start-to-finish - try that MS-Win users!) The Python-relevance was to
ensure there was no legacy-Python2 left 'lying-around'. However, the
GIMP (popular graphics package) still uses (and has some sort of
'exemption' to use) Python2. Stymied! Not quite - there's a Flatpak
option - which will enable my Python3-only objective by ring-fencing the
GIMP and its dependencies. However... now I have a system package
manager (dnf (~apt)) installing most system-software and 'other stuff'
under a different method (I took the same approach with the Chromium
browser) - how long will it be before such 'cleverness' is
forgotten/trips me up?
-- 
Regards =dn
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42804] Unable to compile the cpython code x86 windows

2021-01-01 Thread Bharath Posa


Bharath Posa  added the comment:

I just ran the file but got the below error 
 saying permission denied 

PermissionError: [WinError 5] Access is denied: 
'E:\\Libarary\\workspace\\python_dev\\cpython\\PCbuild\\..\\externals\\cpython-bin-deps-tcltk-8.6.9.0'
 -> 
'E:\\Libarary\\workspace\\python_dev\\cpython\\PCbuild\\..\\externals\\tcltk-8.6.9.0'

--
Added file: https://bugs.python.org/file49716/errors_python.JPG

___
Python tracker 

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



[issue42804] Unable to compile the cpython code x86 windows

2021-01-01 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Were you able to run PCbuild\get_externals.bat ?

--

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread Ned Deily


Ned Deily  added the comment:


New changeset 546baba63a446e261d0248338f9034e56eccfc46 by Miss Islington (bot) 
in branch '3.6':
bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037) 
(GH-24042)
https://github.com/python/cpython/commit/546baba63a446e261d0248338f9034e56eccfc46


--

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread Ned Deily


Ned Deily  added the comment:


New changeset 8200ee66697601a8766f234d6eb8e4c8735216fd by Miss Islington (bot) 
in branch '3.7':
bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037) 
(GH-24041)
https://github.com/python/cpython/commit/8200ee66697601a8766f234d6eb8e4c8735216fd


--
nosy: +ned.deily

___
Python tracker 

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



[issue42804] Unable to compile the cpython code x86 windows

2021-01-01 Thread Bharath Posa


Bharath Posa  added the comment:

Followed the instructions as per the link 
https://devguide.python.org/setup/#setup


While running the command build.bat

--

___
Python tracker 

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



[issue42804] Unable to compile the cpython code x86 windows

2021-01-01 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

What commands did you enter? Are you following the instructions at 
https://devguide.python.org/setup/ ?

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue42804] Unable to compile the cpython code x86 windows

2021-01-01 Thread Bharath Posa


Change by Bharath Posa :


--
title: Unable to compile the code x86 windows -> Unable to compile the cpython 
code x86 windows
type:  -> compile error

___
Python tracker 

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



[issue42804] Unable to compile the code x86 windows

2021-01-01 Thread Bharath Posa


New submission from Bharath Posa :

Hi Team,

While I am trying to build the  cpython in windows 10. I am getting tcl.h file 
not found error.

You can find the screen shot of the error along with the bug.

regards
Sunny

--
components: Build
files: error_python_compilation.JPG
messages: 384194
nosy: pbharat
priority: normal
severity: normal
status: open
title: Unable to compile the code x86 windows
versions: Python 3.8
Added file: https://bugs.python.org/file49715/error_python_compilation.JPG

___
Python tracker 

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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2021-01-01 Thread Big Stone


Big Stone  added the comment:

it seems resolved now, at least with VS 2019

--

___
Python tracker 

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



[issue2142] difflib.unified_diff(...) produces invalid patches

2021-01-01 Thread Paul "TBBle" Hampson


Paul "TBBle" Hampson  added the comment:

I just bounced off this issue and proposed a work-around for it in Black 
(https://github.com/psf/black/pull/1897).

Since it wasn't mentioned here earlier, the `\` marker _is_ documented in the 
GNU Diffutils documentation, under "Incomplete Lines" 
(https://www.gnu.org/software/diffutils/manual/html_node/Incomplete-Lines.html#Incomplete-Lines),
 and applies to both Context and Normal diff output formats.

--
nosy: +TBBle

___
Python tracker 

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



[issue39068] Base 85 encoding initialization race condition

2021-01-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22887
pull_request: https://github.com/python/cpython/pull/24051

___
Python tracker 

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



[issue26407] csv.writer.writerows masks exceptions from __iter__

2021-01-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6dffa67b98f78ae41b596f84478f3379f55d4d03 by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-26407: Do not mask errors in csv. (GH-20536) (GH-24021)
https://github.com/python/cpython/commit/6dffa67b98f78ae41b596f84478f3379f55d4d03


--

___
Python tracker 

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



[issue39068] Base 85 encoding initialization race condition

2021-01-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b863607d303a87e8680149361ac987328b35ca5f by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-39068: Fix race condition in base64 (GH-17627) (GH-24022)
https://github.com/python/cpython/commit/b863607d303a87e8680149361ac987328b35ca5f


--

___
Python tracker 

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



[issue36589] Incorrect error handling in curses.update_lines_cols()

2021-01-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 187785e2fa2050156a6eda93fb2da31db13f07a6 by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-36589: Fix the error handling in curses.update_lines_cols(). 
(GH-12766) (GH-24023)
https://github.com/python/cpython/commit/187785e2fa2050156a6eda93fb2da31db13f07a6


--

___
Python tracker 

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



[issue42425] Possible leak in initialization of errmap for OSError

2021-01-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 1a544e1dcf8e0880ee35ce78a7f90fc4e5c98c4f by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-42425: Fix possible leak in initialization of errmap for OSError 
(GH-23446). (GH-24025)
https://github.com/python/cpython/commit/1a544e1dcf8e0880ee35ce78a7f90fc4e5c98c4f


--

___
Python tracker 

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



[issue42759] Take into acount a Tcl interpreter when compare variables and fonts

2021-01-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e3a9adba329681b1b73b7223515e71e94fc35e12 by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-42759: Fix equality comparison of Variable and Font in Tkinter 
(GH-23968) (GH-24026)
https://github.com/python/cpython/commit/e3a9adba329681b1b73b7223515e71e94fc35e12


--

___
Python tracker 

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



Re: Funny error message

2021-01-01 Thread Bob van der Poel
Found it!

>
> I had the proper urllib3 installed. But, in my .local/lib/ a previous
> version was installed. Removing .local/lib/python3.8 has resolved the
> problem.
>
> Anyone hazard a guess as to why I had a .local tree (nope, I did not create
> it ... I don't think!).
>
>
> That is where "python3.8 -m pip install --user" puts the packages you
> install.
>
> Barry
>
>
>
> Okay ... I'll take your word for it. But, I really don't think I've every
run that command :)


-- 

 Listen to my FREE CD at http://www.mellowood.ca/music/cedars 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW:   http://www.mellowood.ca
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Ross Rhodes


Change by Ross Rhodes :


--
pull_requests: +22886
pull_request: https://github.com/python/cpython/pull/24050

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests:  -22885

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +22885
pull_request: https://github.com/python/cpython/pull/24049

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 3bf05327c2b25d42b92795d9d280288c22a0963d by Ross in branch 
'master':
bpo-42756: Configure LMTP Unix-domain socket to use global default timeout when 
timeout not provided (GH-23969)
https://github.com/python/cpython/commit/3bf05327c2b25d42b92795d9d280288c22a0963d


--

___
Python tracker 

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



[issue42802] distutils: Remove bdist_wininst command

2021-01-01 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

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



Re: Does windows edit .py file shebangs?

2021-01-01 Thread Eryk Sun
On 1/1/21, Barry Scott  wrote:
> I found python scripts have had their shebang lines edited behind my back.
>
> The shebang line I'm seeing is:
>
> #!C:\Users\barry\AppData\Local\Microsoft\WindowsApps\python3.EXE
>
> Is this Microsoft being "helpful"?
> Does anyone know what I will have done to best with this "help"?
>
> What do I need to do to prevent this happening?

Shebang lines may be localized to the current interpreter when
installing a package. Otherwise I don't know what's causing that.

Regarding Windows, the system doesn't support shebang lines in any
way. Python's installer associates .py files with the py.exe launcher,
which looks for a shebang line in a script in order to determine which
executable to run. It supports shebangs with fully-qualified Windows
paths, as well as virtual commands for registered installations, such
as "python", "python3", "python3.9-32", "/usr/bin/python3", and
"/usr/bin/env python".
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Does windows edit .py file shebangs?

2021-01-01 Thread Abdur-Rahmaan Janhangeer
Greetings list,

Being a windows user since long, this made
me laugh. Tell me

1/ What version of Python are you running?
2/ What editor/IDE are you using?



Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius


On Fri, Jan 1, 2021 at 8:43 PM Barry Scott  wrote:

> I found python scripts have had their shebang lines edited behind my back.
>
> The shebang line I'm seeing is:
>
> #!C:\Users\barry\AppData\Local\Microsoft\WindowsApps\python3.EXE
>
> Is this Microsoft being "helpful"?
> Does anyone know what I will have done to best with this "help"?
>
> What do I need to do to prevent this happening?
>
> Barry
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Funny error message

2021-01-01 Thread Barry Scott



> On 1 Jan 2021, at 16:50, Bob van der Poel  wrote:
> 
> On Thu, Dec 31, 2020 at 9:25 PM DL Neil via Python-list <
> python-list@python.org > wrote:
> 
>> On 1/1/21 11:46 AM, Bob van der Poel wrote:
>>> When I run python from the command line and generate an error I get the
>>> following:
>>> 
>>> Python 3.8.5 (default, Jul 28 2020, 12:59:40)
>>> [GCC 9.3.0] on linux
>>> Type "help", "copyright", "credits" or "license" for more information.
>> z
>>> /home/bob/.local/lib/python3.8/site-packages/requests/__init__.py:89:
>>> RequestsDependencyWarning: urllib3 (1.24.3) or chardet (4.0.0) doesn't
>>> match a supported version!
>>>  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
>>> Traceback (most recent call last):
>>>  File "", line 1, in 
>>> NameError: name 'z' is not defined
>>> 
>>> I understand "z in not defined" ... but what's with the warnings?
>> 
>> 
>> The implication is that there is a version-mismatch between Python 3.8
>> and whichever urllib3 and chardet libraries currently installed.
>> 
>> Recommend updating the system, container, or venv: either Python, pip3
>> of the two and/or requests or html-parser [as appropriate to the
>> installed libraries - see below], or both/all.
>> 
>> 
>> System here runs as-expected:
>> 
>> dn $ ... python
>> Python 3.9.1 (default, Dec  8 2020, 00:00:00)
>> [GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
> z
>> Traceback (most recent call last):
>>  File "", line 1, in 
>> NameError: name 'z' is not defined
> import chardet
> import urllib3
> exit()
>> dn $ ... pip show chardet urllib3
>> Name: chardet
>> Version: 3.0.4
>> Summary: Universal encoding detector for Python 2 and 3
>> Home-page: https://github.com/chardet/chardet
>> Author: Mark Pilgrim
>> Author-email: m...@diveintomark.org
>> License: LGPL
>> Location: /usr/lib/python3.9/site-packages
>> Requires:
>> Required-by: html5-parser, requests
>> ---
>> Name: urllib3
>> Version: 1.25.8
>> Summary: HTTP library with thread-safe connection pooling, file post,
>> and more.
>> Home-page: https://urllib3.readthedocs.io/
>> Author: Andrey Petrov
>> Author-email: andrey.pet...@shazow.net
>> License: MIT
>> Location: /usr/lib/python3.9/site-packages
>> Requires:
>> Required-by: requests
>> 
>> 
> Found it!
> 
> I had the proper urllib3 installed. But, in my .local/lib/ a previous
> version was installed. Removing .local/lib/python3.8 has resolved the
> problem.
> 
> Anyone hazard a guess as to why I had a .local tree (nope, I did not create
> it ... I don't think!).
> 

That is where "python3.8 -m pip install --user" puts the packages you install.

Barry


> 
> -- 
> 
>  Listen to my FREE CD at http://www.mellowood.ca/music/cedars 
>  
> Bob van der Poel ** Wynndel, British Columbia, CANADA **
> EMAIL: b...@mellowood.ca 
> WWW:   http://www.mellowood.ca 
> -- 
> https://mail.python.org/mailman/listinfo/python-list 
> 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread Barry Scott



> On 1 Jan 2021, at 16:42, Chris Angelico  wrote:
> 
> On Sat, Jan 2, 2021 at 3:36 AM Barry Scott  > wrote:
>> 
>> FYI this is what I have installed (lspy is a personal script):
>> 
>> $ lspy
>> /bin/python: 3.9.1 final 0
>> /bin/python2: 2.7.18 final 0
>> /bin/python2.7: 2.7.18 final 0
>> /bin/python3: 3.9.1 final 0
>> /bin/python3.10: 3.10.0 alpha 3
>> /bin/python3.4: 3.4.10 final 0
>> /bin/python3.5: 3.5.10 final 0
>> /bin/python3.6: 3.6.12 final 0
>> /bin/python3.9: 3.9.1 final 0
>> /bin/python34: 3.4.10 final 0
>> /bin/python35: 3.5.10 final 0
>> /usr/bin/python: 3.9.1 final 0
>> /usr/bin/python2: 2.7.18 final 0
>> /usr/bin/python2.7: 2.7.18 final 0
>> /usr/bin/python3: 3.9.1 final 0
>> /usr/bin/python3.10: 3.10.0 alpha 3
>> /usr/bin/python3.4: 3.4.10 final 0
>> /usr/bin/python3.5: 3.5.10 final 0
>> /usr/bin/python3.6: 3.6.12 final 0
>> /usr/bin/python3.9: 3.9.1 final 0
>> /usr/bin/python34: 3.4.10 final 0
>> /usr/bin/python35: 3.5.10 final 0
>> 
> 
> Pretty similar to mine, except that (a) most of the Pythons are in
> /usr/local/bin rather than /bin or /usr/bin, and (b) with just a
> couple of exceptions, they're all alphas and betas (eg 3.7.0a4+) built
> from git. I keep a single 2.7 around (provided by Debian Stable), and
> a couple of different 3.x versions are Debian-provided, with all the
> rest (from 3.4 to 3.10) hanging around from having been built.

In my case they are all installed from Fedora officially built and maintained 
RPMs.

Barry

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


Re: Funny error message

2021-01-01 Thread Bob van der Poel
On Thu, Dec 31, 2020 at 9:25 PM DL Neil via Python-list <
python-list@python.org> wrote:

> On 1/1/21 11:46 AM, Bob van der Poel wrote:
> > When I run python from the command line and generate an error I get the
> > following:
> >
> > Python 3.8.5 (default, Jul 28 2020, 12:59:40)
> > [GCC 9.3.0] on linux
> > Type "help", "copyright", "credits" or "license" for more information.
>  z
> > /home/bob/.local/lib/python3.8/site-packages/requests/__init__.py:89:
> > RequestsDependencyWarning: urllib3 (1.24.3) or chardet (4.0.0) doesn't
> > match a supported version!
> >   warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
> > Traceback (most recent call last):
> >   File "", line 1, in 
> > NameError: name 'z' is not defined
> >
> > I understand "z in not defined" ... but what's with the warnings?
>
>
> The implication is that there is a version-mismatch between Python 3.8
> and whichever urllib3 and chardet libraries currently installed.
>
> Recommend updating the system, container, or venv: either Python, pip3
> of the two and/or requests or html-parser [as appropriate to the
> installed libraries - see below], or both/all.
>
>
> System here runs as-expected:
>
> dn $ ... python
> Python 3.9.1 (default, Dec  8 2020, 00:00:00)
> [GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> z
> Traceback (most recent call last):
>   File "", line 1, in 
> NameError: name 'z' is not defined
> >>> import chardet
> >>> import urllib3
> >>> exit()
> dn $ ... pip show chardet urllib3
> Name: chardet
> Version: 3.0.4
> Summary: Universal encoding detector for Python 2 and 3
> Home-page: https://github.com/chardet/chardet
> Author: Mark Pilgrim
> Author-email: m...@diveintomark.org
> License: LGPL
> Location: /usr/lib/python3.9/site-packages
> Requires:
> Required-by: html5-parser, requests
> ---
> Name: urllib3
> Version: 1.25.8
> Summary: HTTP library with thread-safe connection pooling, file post,
> and more.
> Home-page: https://urllib3.readthedocs.io/
> Author: Andrey Petrov
> Author-email: andrey.pet...@shazow.net
> License: MIT
> Location: /usr/lib/python3.9/site-packages
> Requires:
> Required-by: requests
>
>
Found it!

I had the proper urllib3 installed. But, in my .local/lib/ a previous
version was installed. Removing .local/lib/python3.8 has resolved the
problem.

Anyone hazard a guess as to why I had a .local tree (nope, I did not create
it ... I don't think!).


-- 

 Listen to my FREE CD at http://www.mellowood.ca/music/cedars 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW:   http://www.mellowood.ca
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread Chris Angelico
On Sat, Jan 2, 2021 at 3:36 AM Barry Scott  wrote:
>
> FYI this is what I have installed (lspy is a personal script):
>
> $ lspy
> /bin/python: 3.9.1 final 0
> /bin/python2: 2.7.18 final 0
> /bin/python2.7: 2.7.18 final 0
> /bin/python3: 3.9.1 final 0
> /bin/python3.10: 3.10.0 alpha 3
> /bin/python3.4: 3.4.10 final 0
> /bin/python3.5: 3.5.10 final 0
> /bin/python3.6: 3.6.12 final 0
> /bin/python3.9: 3.9.1 final 0
> /bin/python34: 3.4.10 final 0
> /bin/python35: 3.5.10 final 0
> /usr/bin/python: 3.9.1 final 0
> /usr/bin/python2: 2.7.18 final 0
> /usr/bin/python2.7: 2.7.18 final 0
> /usr/bin/python3: 3.9.1 final 0
> /usr/bin/python3.10: 3.10.0 alpha 3
> /usr/bin/python3.4: 3.4.10 final 0
> /usr/bin/python3.5: 3.5.10 final 0
> /usr/bin/python3.6: 3.6.12 final 0
> /usr/bin/python3.9: 3.9.1 final 0
> /usr/bin/python34: 3.4.10 final 0
> /usr/bin/python35: 3.5.10 final 0
>

Pretty similar to mine, except that (a) most of the Pythons are in
/usr/local/bin rather than /bin or /usr/bin, and (b) with just a
couple of exceptions, they're all alphas and betas (eg 3.7.0a4+) built
from git. I keep a single 2.7 around (provided by Debian Stable), and
a couple of different 3.x versions are Debian-provided, with all the
rest (from 3.4 to 3.10) hanging around from having been built.

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


[issue42794] test_nntplib fails on CI

2021-01-01 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Thanks for the patch, Dong-hee Na.

Christian: Tests relying on external resources will always have such issues. 
This doesn't mean that the code which is being tested is outdated or broken. 
It's just an issue with the tests. Perhaps we ought to disable external tests 
for NNTP on CI or ask the PSF to setup a news server for testing purposes (just 
like we have for SSL tests), e.g. news.pythontest.net mirroring 
comp.lang.python.

--
stage: patch review -> 

___
Python tracker 

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



Re: Funny error message

2021-01-01 Thread Bob van der Poel
It appears that a couple of things are happening ... and not being a python
install expert by a long shot, none of it makes sense to me.

But, let me first state that I've never screwed around with the python
installation. I let the Ubuntu packager take care of that.

- running "python -v" I get A LOT of data about various modules being
loaded, etc. I see that most of the modules are loaded from the system dir
/usr/lib/python3.8 but some from .local/lib/python3.8. I have never created
the .local tree so I, again, assume that the installer is doing this. BTW,
sys.path is:
['', '/usr/lib/python38.zip', '/usr/lib/python3.8',
'/usr/lib/python3.8/lib-dynload', '/home/bob/.local

   /lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages',
'/usr/lib/python3/dist-packages']

- running python -v gives too much info. I really can't see what is causing
the unneeded text, but assume it is "requests". Note that this is the
module from .local. Experimenting, I deleted .local/.../requests and it is
now using /usr/.../requests. I've undeleted the .local version.

- creating a one line script with only a bad command in it and running
"python -v script.py >err_file" does not give the lengthy printout. The
same error message is displayed on the terminal.

I really have no idea ... and don't care that much, except it is annoying
to have these same lines repeated over and over again after every error.
Could this be a bug in requests?


On Fri, Jan 1, 2021 at 3:03 AM Peter Otten <__pete...@web.de> wrote:

> On 31/12/2020 23:46, Bob van der Poel wrote:
>
> > When I run python from the command line and generate an error I get the
> > following:
> >
> > Python 3.8.5 (default, Jul 28 2020, 12:59:40)
> > [GCC 9.3.0] on linux
> > Type "help", "copyright", "credits" or "license" for more information.
>  z
> > /home/bob/.local/lib/python3.8/site-packages/requests/__init__.py:89:
> > RequestsDependencyWarning: urllib3 (1.24.3) or chardet (4.0.0) doesn't
> > match a supported version!
> >warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported
> "
> > Traceback (most recent call last):
> >File "", line 1, in 
> > NameError: name 'z' is not defined
> >
> > I understand "z in not defined" ... but what's with the warnings?
>
> It looks like Python tries to import requests as a side effect of
> printing the traceback.
> Start the interpreter in verbose mode
>
> $ python -v
>
> and trigger the name error again to see which module triggers that import.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 

 Listen to my FREE CD at http://www.mellowood.ca/music/cedars 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW:   http://www.mellowood.ca
-- 
https://mail.python.org/mailman/listinfo/python-list


Does windows edit .py file shebangs?

2021-01-01 Thread Barry Scott
I found python scripts have had their shebang lines edited behind my back.

The shebang line I'm seeing is:

#!C:\Users\barry\AppData\Local\Microsoft\WindowsApps\python3.EXE

Is this Microsoft being "helpful"?
Does anyone know what I will have done to best with this "help"?

What do I need to do to prevent this happening?

Barry

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


Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread Barry Scott



> On 29 Dec 2020, at 15:10, Chris Green  wrote:
> 
> Why are there both /usr/lib/python3 and /usr/lib/python3.8 on my
> x[ubuntu] system?
> 
> /usr/lib/python3 has just the dist-packages directory in it,
> /usr/lib/python3.8 has lots of individual python files in it as well
> as quite a number of directories.  
> 
> There's also a /usr/lib/python3.9 directory even though Ubuntu hasn't
> moved to python3.9 yet.
> 

It is common on linux systems for python3 to be a sym link to the systems 
preferred
version of python3 to use.

It is also common to be able to install multiple versions of python on a system.
Both older and newer versions.

Usually I use '#!/usr/bin/python3' in my scripts unless I know that a script
has version dependences.

By using python3 you do not have to edit your scripts shebang lines when
your distro updates to a newer version of python.

If you are testing your code against multiple version of python you need the
version specific names like python3.8, python3.10 etc.

Barry

FYI this is what I have installed (lspy is a personal script):

$ lspy
/bin/python: 3.9.1 final 0
/bin/python2: 2.7.18 final 0
/bin/python2.7: 2.7.18 final 0
/bin/python3: 3.9.1 final 0
/bin/python3.10: 3.10.0 alpha 3
/bin/python3.4: 3.4.10 final 0
/bin/python3.5: 3.5.10 final 0
/bin/python3.6: 3.6.12 final 0
/bin/python3.9: 3.9.1 final 0
/bin/python34: 3.4.10 final 0
/bin/python35: 3.5.10 final 0
/usr/bin/python: 3.9.1 final 0
/usr/bin/python2: 2.7.18 final 0
/usr/bin/python2.7: 2.7.18 final 0
/usr/bin/python3: 3.9.1 final 0
/usr/bin/python3.10: 3.10.0 alpha 3
/usr/bin/python3.4: 3.4.10 final 0
/usr/bin/python3.5: 3.5.10 final 0
/usr/bin/python3.6: 3.6.12 final 0
/usr/bin/python3.9: 3.9.1 final 0
/usr/bin/python34: 3.4.10 final 0
/usr/bin/python35: 3.5.10 final 0


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


[issue42794] test_nntplib fails on CI

2021-01-01 Thread Christian Heimes


Christian Heimes  added the comment:

> The test fails because it was relying on an external news server's
> configuratoin. This doesn't mean the code itself is broken, just the
> test, so clearly: no.

Broken and unstable tests are one of two reasons why I listed nntplib in my 
PEP, https://www.python.org/dev/peps/pep-0594/#nntplib .

Q.E.D.

--

___
Python tracker 

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



[issue4643] cgitb.html fails if getattr call raises exception

2021-01-01 Thread Irit Katriel


Irit Katriel  added the comment:

On closer scrutiny I'm not sure this patch should be merged. 

The getattr call here has a default value, so it should not raise 
AttributeError. It should also not raise any other exception because a valid 
implementation of __getattr__ should raise only AttributeError:

https://docs.python.org/3/reference/datamodel.html#object.__getattr__

--

___
Python tracker 

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



[issue4643] cgitb.html fails if getattr call raises exception

2021-01-01 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue4643] cgitb.html fails if getattr call raises exception

2021-01-01 Thread Irit Katriel


Irit Katriel  added the comment:

On closer scrutiny I'm not sure this patch should not be merged. 

The getattr call here has a default value, so it should not raise 
AttributeError. It should also not raise any other exception because a valid 
implementation of __getattr__ should raise only AttributeError:

https://docs.python.org/3/reference/datamodel.html#object.__getattr__

--

___
Python tracker 

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



[issue42802] distutils: Remove bdist_wininst command

2021-01-01 Thread STINNER Victor


STINNER Victor  added the comment:

I created a https://discuss.python.org/t/remove-bdist-wininst-command/6434 
topic to check if anyone wants to keep the command, or if it's ok to remove it 
right now.

--

___
Python tracker 

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



[issue42802] distutils: Remove bdist_wininst command

2021-01-01 Thread STINNER Victor


STINNER Victor  added the comment:

Note: bdist_msi is deprecated since Python 3.9 (bpo-39586). I prefer to wait 
for Python 3.11 to remove it:

commit 29b3fc0a18f105de666fdd586b537f34e349766d
Author: Hugo van Kemenade 
Date:   Mon Feb 10 15:26:40 2020 +0200

bpo-39586: Deprecate distutils bdist_msi command (GH-18415)

--

___
Python tracker 

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



Re: help

2021-01-01 Thread Eryk Sun
On 1/1/21, Sibylle Koczian  wrote:
>
> But that doesn't help, if the script raises an exception. In that case
> the input() call won't be reached and the window will close anyway
> before you could see anything. And in a script with errors that's even
> worse. Same effect with the "run" window.

The simplest, best option is running the script from an existing shell
that owns the console session.  That said, here are a couple
alternatives to calling input() in a `finally` block.

If you have .py files associated with the py launcher, for testing you
can use a shebang such as `#!/usr/bin/python3 -i`. The "-i" option
enters interactive mode after executing the script, even if there's an
unhandled Python exception.

Entering interactive mode won't work if the process crashes at a low
level. To handle that, you can instead spawn a child process in the
console session that waits forever. A good candidate is "waitfor.exe",
which opens a mailslot and waits for it to be signaled. For example:

import subprocess
subprocess.Popen('waitfor.exe ever')

This process will still be attached to the console session after
Python exits. You can kill it by closing the console window, or by
running `waitfor.exe /si ever` to signal it.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42802] distutils: Remove bdist_wininst command

2021-01-01 Thread STINNER Victor


STINNER Victor  added the comment:

FYI last year, I fixed setuptools v45.2 (released in February 2020) when 
bdist_wininst is missing:
https://github.com/pypa/setuptools/commit/5d17586a56077dfa3109a5861cf0ff579095a42e

--

___
Python tracker 

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



[issue42802] distutils: Remove bdist_wininst command

2021-01-01 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42803] Traced line number is wrong for "if not __debug__"

2021-01-01 Thread Ned Batchelder


New submission from Ned Batchelder :

(Using CPython commit 6b1ac809b9)

This program never executes line 4, but the "if not __debug__" is partly 
attributed to line 4, giving an incorrect trace:

for value in [True, False]:
if value:
if not __debug__:
1/0 # line 4
else:
x = 6

Using a simple trace program 
(https://github.com/nedbat/coveragepy/blob/master/lab/run_trace.py), it 
produces this output:

call  1 @-1
line  1 @0
line  2 @8
line  3 @12
line  4 @14
line  1 @4
line  2 @8
line  6 @16
line  1 @4
return  1 @24

Various simplifications of the program make the problem go away.

--
components: Interpreter Core
messages: 384178
nosy: Mark.Shannon, nedbat
priority: normal
severity: normal
status: open
title: Traced line number is wrong for "if not __debug__"
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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread miss-islington


miss-islington  added the comment:


New changeset b20d5e5ce95248e0fa77c5d7bf8f6f5b1231fa53 by Miss Islington (bot) 
in branch '3.9':
bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037)
https://github.com/python/cpython/commit/b20d5e5ce95248e0fa77c5d7bf8f6f5b1231fa53


--

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread miss-islington


miss-islington  added the comment:


New changeset 381f3e4bfd4b1c440f7cb3025972fe0acd0406fc by Miss Islington (bot) 
in branch '3.8':
bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037)
https://github.com/python/cpython/commit/381f3e4bfd4b1c440f7cb3025972fe0acd0406fc


--

___
Python tracker 

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



[issue42802] distutils: Remove bdist_wininst command

2021-01-01 Thread STINNER Victor


STINNER Victor  added the comment:

There are 19 issues (+ this one) on bdist_wininst. Once distutils bdist_wininst 
command will be removed, I propose to all these issues.

Search for open issues with "bdist_wininst" in the title.

Only bpo-41771 was active recently (3 months ago). The 18 other issues are 
inactive for between 18 months and 121 months (10 years!).

--

___
Python tracker 

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



[issue42801] Exception catching function crashes on recursive list

2021-01-01 Thread Steve Stagg


Steve Stagg  added the comment:

This is fixed by https://github.com/python/cpython/pull/23744

--
nosy: +stestagg

___
Python tracker 

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



[issue42802] distutils: Remove bdist_wininst command

2021-01-01 Thread STINNER Victor

New submission from STINNER Victor :

Attached PR removes it.

The bdist_wininst command was deprecated in Python 3.8:

commit 1da4462765b084dfa8d869b6cb5855e8f6014a11
Author: Victor Stinner 
Date:   Fri Jul 5 10:44:12 2019 +0200

bpo-37481: Deprecate distutils bdist_wininst command (GH-14553)

The distutils bdist_wininst command is now deprecated, use
bdist_wheel (wheel packages) instead.


"What’s New In Python 3.9: Build Changes" also announced:

* On non-Windows platforms, creating ``bdist_wininst`` installers is now
  officially unsupported.  (See :issue:`10945` for more details.)

https://docs.python.org/dev/whatsnew/3.9.html#build-changes


See bpo-37481 and:
https://discuss.python.org/t/deprecate-bdist-wininst/1929

--
components: Distutils
messages: 384173
nosy: dstufft, eric.araujo, vstinner
priority: normal
severity: normal
status: open
title: distutils: Remove bdist_wininst command
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



[issue42796] tempfile doesn't seem to play nicely with os.chdir on Windows

2021-01-01 Thread Eryk Sun


Eryk Sun  added the comment:

> def test_chdir():
> with tempfile.TemporaryDirectory() as tempdir:
> old = os.getcwd()
> os.chdir(tempdir)
> with open(os.path.join(tempdir, "delme")) as fout:
> fout.write("Hello")
> os.chdir(old)

The open() call in test_chdir() fails before os.chdir(old) executes. You would 
need to call os.chdir(old) in a `finally` block.

But the cleanup routine could still fail due to a sharing violation from some 
other process (likely a child process) setting the directory or a child 
directory as the working directory. Also, a sharing violation when trying to 
delete a regular file in the tree causes the cleanup routine to fail with 
NotADirectoryError because the onerror function calls rmtree() if unlink() 
fails with a PermissionError.

--

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22883
pull_request: https://github.com/python/cpython/pull/24042

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22882
pull_request: https://github.com/python/cpython/pull/24041

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22881
pull_request: https://github.com/python/cpython/pull/24040

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +22880
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24039

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset ec3165320e81ac87edcb85c86c452528ddbaec1c by Dong-hee Na in branch 
'master':
bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037)
https://github.com/python/cpython/commit/ec3165320e81ac87edcb85c86c452528ddbaec1c


--

___
Python tracker 

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



[issue4643] cgitb.html fails if getattr call raises exception

2021-01-01 Thread karl


karl  added the comment:

Converted into GitHub PR https://github.com/python/cpython/pull/24038

--

___
Python tracker 

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



[issue4643] cgitb.html fails if getattr call raises exception

2021-01-01 Thread karl


Change by karl :


--
nosy: +karlcow
nosy_count: 4.0 -> 5.0
pull_requests: +22878
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/24038

___
Python tracker 

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



[issue42794] test_nntplib fails on CI

2021-01-01 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 01.01.2021 13:57, Christian Heimes wrote:
> 
> Does this issue mean that I should include nntplib in PEP 594 again?

The test fails because it was relying on an external news server's
configuratoin. This doesn't mean the code itself is broken, just the
test, so clearly: no.

--

___
Python tracker 

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



  1   2   >