Hello,
In the context of a move for hosting of my one recto-verso pdf cheat
sheet, I updated it to add Python's news stuff and make a new 2.1.0
version (latest version, 2.0.6, was from 2017).
DOWNLOAD
English version is at https://py3cheatsheet.lisn.fr/
(its a short URL fore real host
On Wed, 25 Oct 2023 at 13:02, Mike H via Python-list
wrote:
> Is it possible to use lambda expression instead of defining a `Key` class?
> Something like `sorted(my_list, key = lambda x, y: x+y > y+x)`?
Look up functools.cmp_to_key.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-lis
gt; > '953433230'
> >
> > nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True)
> >
> > But how to do this in python 3?
> >
> > Thank you
> While cmp_to_key is neat doing it by hand should also be instructive.
> Essentially you move the comp
Stefan Ram wrote:
> Chris Green writes:
> >I have some text files which are ISO8859-1 encoded and I want to output
> >them to screen using Python.
>
> Well, the first attempt would be:
>
> import pathlib
> name = r"C:\example.txt"
> encoding = r"iso8859-1"
> path = pathlib.Path( name )
> with
This sounds as if it should be trivial but searching only seems to
produce ways ofd doing it in Python 2.
I have some text files which are ISO8859-1 encoded and I want to output
them to screen using Python.
--
Chris Green
·
--
https://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
> On Fri, 25 Jun 2021 09:19:49 +0100, Chris Green declaimed the
> following:
>
> >
> >Here's the full program where I'm encountering the error (yes, I
> >should have posted this first time around) :-
> >
> >#!/usr/bin/python3
> >
> >import mailbox
> >import s
gt; >print msg # or whatever you want to do with the message
> > > >
> > > >
> > > > However in python 3 this produces "TypeError: string argument
> > > > expected, got 'bytes'".
> > > >
> > >
do with the message
> > >
> > >
> > > However in python 3 this produces "TypeError: string argument
> > > expected, got 'bytes'".
> > >
> > > How should one iterate over a maildir in python3?
> >
> > You're alre
Gilmeh Serda wrote:
> On Fri, 25 Jun 2021 09:19:49 +0100, Chris Green wrote:
>
> > TypeError: string argument expected, got 'bytes'
>
> couple things comes to mind:
>
> 1. find py2 as archive, put it somewhere and run it from that
>
Hmm! :-)
> 2. convert the bytes to str (find and replace)
>
Greg Ewing wrote:
> On 25/06/21 7:06 am, Chris Green wrote:
> > In python 2 one can do:-
> >
> > for msg in maildir:
> >print msg # or whatever you want to do with the message
> >
> >
> > However in python 3 this produces
In python 2 one can do:-
for msg in maildir:
print msg # or whatever you want to do with the message
However in python 3 this produces "TypeError: string argument
expected, got 'bytes'".
How should one iterate over a maildir in python3?
(I've
On 25/06/21 7:06 am, Chris Green wrote:
In python 2 one can do:-
for msg in maildir:
print msg # or whatever you want to do with the message
However in python 3 this produces "TypeError: string argument
expected, got 'bytes'".
How should one itera
tall the PyPi package
>>>>
>>>> getent
>>>>
>>>> I get the error
>>>>
>>>> File "/tmp/pip-build-vu4lziex/getent/setup.py", line 9, in
>>>> long_description = file('README.rst').read(),
>>&
t the error
>>>
>>> File "/tmp/pip-build-vu4lziex/getent/setup.py", line 9, in
>>> long_description = file('README.rst').read(),
>>> NameError: name 'file' is not defined
>>>
>>> I duckduckwent a bit and the probl
long_description = file('README.rst').read(),
>> NameError: name 'file' is not defined
>>
>> I duckduckwent a bit and the problem seems to be that 'file' from Python
>> 2 has been replaced by 'open' in Python 3.
>>
>> S
27; is not defined
>
> I duckduckwent a bit and the problem seems to be that 'file' from Python
> 2 has been replaced by 'open' in Python 3.
>
> So what's the standard way of getting a list of users in this case?
>
I don't have LDAP experience so I don
File "/tmp/pip-build-vu4lziex/getent/setup.py", line 9, in
long_description = file('README.rst').read(),
NameError: name 'file' is not defined
I duckduckwent a bit and the problem seems to be that 'file' from Python
2 has been replaced by
I’ve had similar issue today on macOS when trying to download something from
PyPI with Python 3.9.1 but I didn’t try to debug it and just moved on to
different things. Maybe we both have outdated ca bundles?
Michał Jaworski
> Wiadomość napisana przez Carlos Andrews w dniu
> 16.02.2021, o godz
Hi All,
I ran into an error I, so far, cannot explain regarding Python's general
ability to communicate via SSL/TLS.
I'm using Python a lot to communicate with web servers and APIs, which
worked just fine until yesterday (or somewhen late last week).
I first noticed yesterday, when a requests-ba
r, I wouldn't even try to port that to Python 3. First,
it would be clearly against the licence agreement. Second, that would
probably result in total mess and take more time that it takes to earn for
a new printer. If you really want to keep the printer (I wouldn't) I would
do the follo
system.
> Aside from whinging about systemd it installed ok. How do I reproduce
> your problems? (I've got no printer of course, but...)
>
Try running scantool.py, that should pop up a little GUI.
It uses GTK which of course in itself makes migration tricky because
one has to m
;as I don't have the source, I can't build for Python 3.
>>
>> ChrisA I think suggested keeping a Python 2.7 install around for this.
>>
>Not possible really as there are other python conflicts that start
>appearing if one tries to retain the libraries needed.
Ru
me from a PPA to support Python GTK, these conflict with
> ongoing updates to Python. The PPA works OK in Ubuntu 20.04 but
> prevents some updates in 20.10. I expect it will get worse as time
> goes on.
>
Try getting JUST the printer info in Python 2, and then outputting
that to stdou
Cameron Simpson wrote:
> On 16Dec2020 18:51, Chris Green wrote:
> >The specific problem that finally prevented me from managing to get it
> >to work was a (Linux) .so file that had been built for Python 2 and,
> >as I don't have the source, I can't build fo
the source, I can't build for Python 3.
>
> ChrisA I think suggested keeping a Python 2.7 install around for this.
(MRAB did, but I agree with it.)
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 16Dec2020 18:51, Chris Green wrote:
>The specific problem that finally prevented me from managing to get it
>to work was a (Linux) .so file that had been built for Python 2 and,
>as I don't have the source, I can't build for Python 3.
ChrisA I think suggested keeping a
On Thu, Dec 17, 2020 at 7:27 AM MRAB wrote:
>
> On 2020-12-16 19:16, Chris Angelico wrote:
> > On Thu, Dec 17, 2020 at 6:06 AM Chris Green wrote:
> >>
> >> Some time ago (in July) I asked some questions here
> >> about problems migrating some code f
On 2020-12-16 19:16, Chris Angelico wrote:
On Thu, Dec 17, 2020 at 6:06 AM Chris Green wrote:
Some time ago (in July) I asked some questions here
about problems migrating some code from Python 2 to Python 3.
The specific problem that finally prevented me from managing to get it
to work was a
On Thu, Dec 17, 2020 at 6:06 AM Chris Green wrote:
>
> Some time ago (in July) I asked some questions here
> about problems migrating some code from Python 2 to Python 3.
>
> The specific problem that finally prevented me from managing to get it
> to work was a (Linux) .so
Some time ago (in July) I asked some questions here
about problems migrating some code from Python 2 to Python 3.
The specific problem that finally prevented me from managing to get it
to work was a (Linux) .so file that had been built for Python 2 and,
as I don't have the source, I can
Hi,
Wikipedia has an article on the duodecimal system, that includes an
explanation of how to convert from decimal and the other way around.
https://en.wikipedia.org/wiki/Duodecimal?wprov=sfla1
Peerrhaps it can be easily implemented as a function. Good luck.
H.
Den lör 7 nov. 2020 07:55Nick
> On 7 Nov 2020, at 06:51, Nick Li wrote:
>
> Does anyone know how to turn a decimal number into duodecimal or if there is
> a function built-in for it?
I see lots of interesting answer in here:
https://stackoverflow.com/questions/2267362/how-to-convert-an-integer-to-a-string-in-any-base
Does anyone know how to turn a decimal number into duodecimal or if there is a
function built-in for it?
--
https://mail.python.org/mailman/listinfo/python-list
dle, it's there in
your Python installation. Or download PyScripter, or Jetbrains' PyCharm, or
Wing (see recent new version announcement).
--- Joseph S.
-Original Message-
From: jjall...@aol.com
Sent: Thursday, October 8, 2020 12:59 PM
To: python-list@python.org
Subject
Am 08.10.2020 um 18:58 schrieb Joe via Python-list:
Hi,
I just downloaded the above for Windows but am unable to get it to run. I have gone to
the directory and double-clicked the "python.exe" file but that just brings me
to the command prompt.
Any suggestions as to what I am doing wrong?
Tha
Hi,
I just downloaded the above for Windows but am unable to get it to run. I have
gone to the directory and double-clicked the "python.exe" file but that just
brings me to the command prompt.
Any suggestions as to what I am doing wrong?
Thank you.
Joe
--
https://mail.python.org/mailman/listin
h Py3, Py2 works properly).
I have cut the code to a pretty minimum set and will attempt to paste it to the
bottom of
this message in the hope that it will encourage one of you to see what the
problem might be.
Alternatively if anyone knows of an example that works with Python-3 I'd be
de
Cameron Simpson wrote:
> On 29Aug2020 16:50, Chris Green wrote:
> >However the problem appears to be that internally in Python 3 mailbox
> >class there is an assumption that it's being given 'ascii'. Here's
> >the error (and I'm doing no processing
Karsten Hilbert wrote:
> > However the problem appears to be that internally in Python 3 mailbox
> > class there is an assumption that it's being given 'ascii'.
>
> Do you really _need_ the mailbox class ? From what you've
> written so far my understandin
On 29Aug2020 16:50, Chris Green wrote:
>However the problem appears to be that internally in Python 3 mailbox
>class there is an assumption that it's being given 'ascii'. Here's
>the error (and I'm doing no processing of the message at all):-
>
>Traceb
> Just appending a message as a raw file to a mailbox, doesn't properly
> add it as a new message. You need to add a From: line to the front, and
> then go through the message and alter any line that begins as "From:"
> (and possibly any line that begins with something like ">From:" or
> ">>From:"
On 8/29/20 3:31 PM, Karsten Hilbert wrote:
>> However the problem appears to be that internally in Python 3 mailbox
>> class there is an assumption that it's being given 'ascii'.
> Do you really _need_ the mailbox class ? From what you've
> written so far my u
> However the problem appears to be that internally in Python 3 mailbox
> class there is an assumption that it's being given 'ascii'.
Do you really _need_ the mailbox class ? From what you've
written so far my understanding was that you receive data
(bytes) and wan
", and using the
>>> methods of the bytes data type.
>>>
>> Now I'm beginning to realise that *this* may well be what I need to
>> do, after going round in several convoluted circles! :-)
>>
> However the problem appears to be that internall
I've started a new thread because this relates to two or three threads
I started here over the past few days.
First, thank you everyone for all the help and suggestions.
I've finally fixed the problem, it was due to sys.stdin.read()
returning a string object in Python 3 as opposed t
gt; any encoding.
> >
> > So, for Python3, the SAME processing requires NOT USING "string"
> > (which
> > is now Unicode) and ensuring that all literals are b"stuff", and using the
> > methods of the bytes data type.
> >
> Now I
Dennis Lee Bieber wrote:
> On Fri, 28 Aug 2020 12:26:07 +0100, Chris Green declaimed the
> following:
>
>
>
> >Maybe I shouldn't but Python 2 has been managing to do so for several
> >years without any issues. I know I *could* put the exceptions in a
> >bucket somewhere and deal with them sep
On 2020-08-28, Chris Green wrote:
> Maybe I shouldn't but Python 2 has been managing to do so for several
> years without any issues. I know I *could* put the exceptions in a
> bucket somewhere and deal with them separately but I'd really rather
> not.
Then just leave it as bytes and do whateve
On 2020-08-27, Chris Green wrote:
> bbb = [b'aaa', b'bbb', b'ccc']
> sss = []
> for i in range(0, 2):
> sss.append(str(bbb[i])
>
> but that does seem a bit clumsy. Is there a better way?
sss = [str(s) for s in bbb]
--
Grant
--
https://mail.python.org/mailman/listinfo/pyth
On 2020-08-27, Marco Sulla wrote:
> Are you sure you want `str()`?
>
str(b'aaa')
> "b'aaa'"
>
> Probably you want:
>
> map(lambda x: x.decode(), bbb)
If you're an old Scheme or Lisp programmer. :)
This is probably the more usual way to spell it:
sss = [x.decode() for x in bbb]
--
ht
On Saturday, 29 August 2020 at 02:47:56 UTC+5:30, Ben Bacarisse wrote:
Thanks you all, I was really confused in this code.
> Shivlal Sharma writes:
>
> > I have seen this code on one of competative programming site but I
> > didn't get it, Why output is 9?
> >
> > from functools import *
> >
Shivlal Sharma writes:
> I have seen this code on one of competative programming site but I
> didn't get it, Why output is 9?
>
> from functools import *
>
> def ADDS(a,b):
> return a+1
> nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]
> add = reduce(ADDS, nums)
> print(add)
>
> output: 9
Hint:
reduce(f
Python 2 code still installed) it all 'just works'
>and the absolute worst corruption I ever see in an E-Mail is things
>like accented characters missing altogether or £ signs coming out as a
>funny looking string. Either of these don't really make the message
>unintelli
Shivlal Sharma wrote:
> I have seen this code on one of competative programming site but I didn't
> get it, Why output is 9?
>
> from functools import *
>
> def ADDS(a,b):
> return a+1
> nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]
> add = reduce(ADDS, nums)
> print(add)
>
> output: 9
Rewrite the AD
All the numbers in the nums list don't matter and aren't used. Only the first
number, and how many there are.
https://docs.python.org/3.8/library/functools.html#functools.reduce
Basically it's doing
ADDS(1, 2) which returns 2
that 2 gets fed back into
ADDS(2, 3) which returns 3
that 3 gets fed ba
I have seen this code on one of competative programming site but I didn't get
it, Why output is 9?
from functools import *
def ADDS(a,b):
return a+1
nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]
add = reduce(ADDS, nums)
print(add)
output: 9
--
https://mail.python.org/mailman/listinfo/python-list
ake a difference between "scoring" and "transport":
>>
>> To transfer a message into an mbox it can be transferred as it is.
>> Just the bytes from the POP3 server. Let mutt deal with them.
>>
> That's what I do at present in Python 2, the problem is
On Fri, Aug 28, 2020 at 11:24 PM Chris Green wrote:
>
> Chris Angelico wrote:
> >
> > Also, if you're parsing an email message, you can and should be doing
> > so with respect to the encoding(s) stipulated in the headers, after
> > which you will have valid Unicode text.
> >
> But not all E-Mail
On 2020-08-28 08:30, Richard Damon wrote:
> This might be one of the cases where Python 2's lack handling of string
> vs bytes was an advantage.
For English speaking Americans.
> Python2 handled that sort of case quite easily. Python 3 on the other
> hand, will have issue co
Chris Angelico wrote:
>
> Also, if you're parsing an email message, you can and should be doing
> so with respect to the encoding(s) stipulated in the headers, after
> which you will have valid Unicode text.
>
But not all E-Mail messages are 'well behaved', the above works fine
if the headers sp
> I want to transport the message into my mbox and Python 3 won't do it
> without knowing how it's encoded whereas Python 2 just stuffed it in
> there 'as is'.
>
> I want Python 3's mailbox class to juyst put what I tell it (even if
> mis-formatted or mis
ere were no issues because everything worked just right under
>>> py2 but rather because py2 cared less than py3 does now.
>>>
>>>> Are we saying that Python 3 really can't be made to handle things
>>>> 'tolerantly' like Python 2 used to?
>
On Fri, Aug 28, 2020 at 10:51 PM Chris Green wrote:
>
> > One possible solution in Python3 is to decode the byte string using an
> > encoding that allows all 256 byte values, so it won't raise any encoding
> > errors, just give your possibly non-sense characters for non-ASCII text.
> >
> But this
> To transfer a message into an mbox it can be transferred as it is.
> Just the bytes from the POP3 server. Let mutt deal with them.
>
That's what I do at present in Python 2, the problem is that Python 3
complains when I use the standard library to put the message into the
mbox.
I
;> Maybe I shouldn't but Python 2 has been managing to do so for several
> >> years without any issues.
> > I am inclined to congratulate you on that sheer amount of luck. I don't
> > believe there were no issues because everything worked just right under
> &
ite is unlikely to have been causing
> problems.
>
> Python2 handled that sort of case quite easily. Python 3 on the other
> hand, will have issue converting the byte message to a string, since
> there isn't a single encoding that you could use for all of it all the
> time
managing to do so for several
>> years without any issues.
> I am inclined to congratulate you on that sheer amount of luck. I don't
> believe there were no issues because everything worked just right under
> py2 but rather because py2 cared less than py3 does now.
>
managing to do so for several
>> years without any issues.
> I am inclined to congratulate you on that sheer amount of luck. I don't
> believe there were no issues because everything worked just right under
> py2 but rather because py2 cared less than py3 does now.
>
I am inclined to congratulate you on that sheer amount of luck. I don't
believe there were no issues because everything worked just right under
py2 but rather because py2 cared less than py3 does now.
> Are we saying that Python 3 really can't be made to handle things
>
>
Maybe I shouldn't but Python 2 has been managing to do so for several
years without any issues. I know I *could* put the exceptions in a
bucket somewhere and deal with them separately but I'd really rather
not.
At prsent (with the Python 2 code still installed) it all 'just works'
and the absolute worst corruption I ever see in an E-Mail is things
like accented characters missing altogether or £ signs coming out as a
funny looking string. Either of these don't really make the message
unintelligible.
Are we saying that Python 3 really can't be made to handle things
'tolerantly' like Python 2 used to?
--
Chris Green
·
--
https://mail.python.org/mailman/listinfo/python-list
On 28Aug2020 08:56, Chris Green wrote:
>Stefan Ram wrote:
>> Chris Angelico writes:
>> >But this is a really good job for a list comprehension:
>> >sss = [str(word) for word in bbb]
>>
>> Are you all sure that "str" is really what you all want?
>>
>Not absolutely, you no doubt have been follow
Cameron Simpson wrote:
> On 27Aug2020 23:54, Marco Sulla wrote:
> >Are you sure you want `str()`?
> >
> str(b'aaa')
> >"b'aaa'"
> >
> >Probably you want:
> >
> >map(lambda x: x.decode(), bbb)
>
> _And_ you need to know the encoding of the text in the bytes. The above
> _assumes_ UTF-8 beca
hing that might be a typo for one of
our names or anything else that might be of interest. I have an
associated configuration file that specifies the patterns to look for
so I can change things on the fly as it were.
One of the scripts that I'm having trouble converting to Python 3 is
the one that d
Chris Angelico wrote:
> On Fri, Aug 28, 2020 at 6:36 AM Chris Green wrote:
> >
> > This sounds quite an easy thing to do but I can't find how to do it
> > elegantly.
> >
> > I have a list of bytes class objects (i.e. a list containing sequences
> > of bytes, which are basically text) and I want t
Stefan Ram wrote:
> Chris Angelico writes:
> >But this is a really good job for a list comprehension:
> >sss = [str(word) for word in bbb]
>
> Are you all sure that "str" is really what you all want?
>
Not absolutely, you no doubt have been following other threads related
to this one. :-)
> >Are you sure you want `str()`?
> >
> str(b'aaa')
> >"b'aaa'"
> >
> >Probably you want:
> >
> >map(lambda x: x.decode(), bbb)
>
> _And_ you need to know the encoding of the text in the bytes. The above
> _assumes_ UTF-8 because that is the default for bytes.decode, and if
> that is _not_ wha
ing a new filing rule.
>> >E.g. in this case the only (well the only ready made) way to get a
>> >POP3 message is using poplib and this just gives you a list of lines
>> >made up of "bytes as text" :-
>> >
>> >popmsg = pop3.retr(i+1)
>&g
On 27Aug2020 23:54, Marco Sulla wrote:
>Are you sure you want `str()`?
>
str(b'aaa')
>"b'aaa'"
>
>Probably you want:
>
>map(lambda x: x.decode(), bbb)
_And_ you need to know the encoding of the text in the bytes. The above
_assumes_ UTF-8 because that is the default for bytes.decode, and if
Are you sure you want `str()`?
>>> str(b'aaa')
"b'aaa'"
Probably you want:
map(lambda x: x.decode(), bbb)
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Aug 28, 2020 at 6:36 AM Chris Green wrote:
>
> This sounds quite an easy thing to do but I can't find how to do it
> elegantly.
>
> I have a list of bytes class objects (i.e. a list containing sequences
> of bytes, which are basically text) and I want to convert it to a list
> of string ob
This sounds quite an easy thing to do but I can't find how to do it
elegantly.
I have a list of bytes class objects (i.e. a list containing sequences
of bytes, which are basically text) and I want to convert it to a list
of string objects.
One of the difficulties of finding out how to do this is
empties the POP3
catchall mailbox, checks for anything that *might* be for me or other
family members then just deletes the rest.
> >E.g. in this case the only (well the only ready made) way to get a
> >POP3 message is using poplib and this just gives you a list of lines
> >m
On 27Aug2020 09:16, Chris Green wrote:
>Cameron Simpson wrote:
>> But note: joining bytes like strings is uncommon, and may indicate
>> that
>> you should be working in strings to start with. Eg you may want to
>> convert popmsg from bytes to str and do a str.join anyway. It depends on
>> exactl
Cameron Simpson wrote:
> On 26Aug2020 15:09, Chris Green wrote:
> >2qdxy4rzwzuui...@potatochowder.com wrote:
> >> Join bytes objects with a byte object:
> >>
> >> b"\n".join(popmsg[1])
> >
> >Aaahhh! Thank you (and the other reply).
>
> But note: joining bytes like strings is uncommon, and
On 26Aug2020 15:09, Chris Green wrote:
>2qdxy4rzwzuui...@potatochowder.com wrote:
>> Join bytes objects with a byte object:
>>
>> b"\n".join(popmsg[1])
>
>Aaahhh! Thank you (and the other reply).
But note: joining bytes like strings is uncommon, and may indicate that
you should be working i
2qdxy4rzwzuui...@potatochowder.com wrote:
> On 2020-08-26 at 14:22:10 +0100,
> Chris Green wrote:
>
> > I have the following line in Python 2:-
> >
> > msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list containing
> the lines of the message
> >
> > ... so I changed it to:-
> >
> >
e list in popmsg[1] but surely there must be a way that's as neat
and elegant as the Python 2 way was?
In Python 3, bytestring literals require the 'b' prefix:
msgstr = b"\n".join(popmsg[1])
--
https://mail.python.org/mailman/listinfo/python-list
On 2020-08-26 09:22, Chris Green wrote:
> I have the following line in Python 2:-
>
> msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list
> containing the lines of the message
>
> ... so I changed it to:-
>
> s = "\n"
> msgstr = s.join(popmsg[1]) # popmsg[1] is a l
On 2020-08-26 at 14:22:10 +0100,
Chris Green wrote:
> I have the following line in Python 2:-
>
> msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list
> containing the lines of the message
>
> ... so I changed it to:-
>
> s = "\n"
> msgstr = s.join(popmsg[1]) # po
I have the following line in Python 2:-
msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list containing
the lines of the message
... so I changed it to:-
s = "\n"
msgstr = s.join(popmsg[1]) # popmsg[1] is a list containing the lines
of the message
However this sti
Chris Green wrote:
>> >1 - Why doesn't it error in Python 2?
>>
>> The dict internal implementation has changed. I don't know the
>> specifics, but it is now faster and maybe smaller and also now preserves
>> insert order.
>>
> Ah, that probably explains it then.
But if you try to modify a dict
Cameron Simpson wrote:
> On 23Aug2020 10:00, Chris Green wrote:
> >I have a (fairly) simple little program that removes old mail messages
> >from my junk folder. I have just tried to upgrade it from Python 2 to
> >Python 3 and now, when it finds any message[s] to delete it
On 23Aug2020 10:00, Chris Green wrote:
>I have a (fairly) simple little program that removes old mail messages
>from my junk folder. I have just tried to upgrade it from Python 2 to
>Python 3 and now, when it finds any message[s] to delete it produces
>the error:-
>
>Runtim
I have a (fairly) simple little program that removes old mail messages
from my junk folder. I have just tried to upgrade it from Python 2 to
Python 3 and now, when it finds any message[s] to delete it produces
the error:-
RuntimeError: dictionary changed size during iteration
I can sort of
why the 20.04 release insists
> >on 2.7.
>
> I would guess they didn't have the resources to regression test the
> shift in time for 20.04. Moving to Python 3, _particularly_ with
> something like Mercurial which has a bunch of internal things which are
> in fact byte string
rces to regression test the
shift in time for 20.04. Moving to Python 3, _particularly_ with
something like Mercurial which has a bunch of internal things which are
in fact byte strings, risks subtle breakage.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
On 20Aug2020 18:13, Chris Green wrote:
>Cameron Simpson wrote:
>> On 19Aug2020 08:53, Chris Green wrote:
>> >Maybe I should bite the bullet and make Python 3 the default Python
>> >and see what falls over as a consequence.
>>
>> Don't change the syst
lists. All the OS python
> > code in Ubuntu 20.04 is now Python 3 but there are some other things
> > which I have installed (such as Mercurial) which still depend on
> > Python 2. One can see what is affected by doing:-
> >
> > $ sudo apt remove python2 --simulate
&
On Fri, Aug 21, 2020 at 3:21 AM Chris Green wrote:
> It's actually more subtle and complicated than the OS changing or not
> changing the default Python version. There are quite a lot of
> questions about exactly this on the Ubuntu lists. All the OS python
> code in Ubuntu 20.0
n so I have to
> >run pip3 explicitly to get Python 3 code.
>
> My approach to this is to have a personal venv based on a modern Python3
> and put its bin near the front of my $PATH. The pip and python come from
> it. But I tend to type "pip3" anyway - still the pip from
1 - 100 of 3843 matches
Mail list logo