Op vrijdag 28 oktober 2022 08:37:55 CEST schreef Guillaume Gardet:
> Hi,
> 
> > -----Original Message-----
> > From: Freek de Kruijf <[email protected]>
> > Sent: 27 October 2022 19:22
> > To: Mailinglist openSUSE ARM <[email protected]>
> > Subject: Problem with python program on Raspi4 Leap 15.4
> > 
> > Hi all,
> > I am using Python version 3.6.15 on a Raspi4 with Leap 15.4.
> > Since Sunday, likely after an update I have a problem when running a 
python
> > module which is embedded in a larger system.
> > 
> > The piece of code is:
> >    if name in moduleData:
> >         if self.debugMode:
> >             self.logMessage('moduleData[name]: '+moduleData[name]+" 
point"\
> >             
> >                 +name+': '+str(valDouble))
> >         
> >         a = moduleData[name].split("+")
> >         b = a[1].split(":")
> >         c = a[0].split(".")
> >         #self.logMessage('a[0]='+str(a[0]))
> >         
> >         if len(c) > 1 :
> >             pT = datetime.strptime(str(a[0]),"%Y-%m-%dT%H:%M:%S.%f")
> >         
> >         else :
> >             pT = datetime.strptime(str(a[0]),"%Y-%m-%dT%H:%M:%S")
> > 
> > In debug mode the output of the third line from this piece of code gives:
> > 2022-10-27 16:11:59.236  Zonnepanelen: moduleData[name]:
> > 2022-10-27T16:10:54.458+02:00 point electricity_point_meter: -134.66 which
> > means that moduleData[name] contains: 2022-10-27T16:10:54.458+02:00 So the
> > elements of a, b and c all of type str.
> > 
> > The error message I get is:
> > 2022-10-27 14:45:34.221  Zonnepanelen: Exception caught :attribute of type
> > 
> > 'NoneType' is not callableTraceback (most recent call last):
> >   File "/usr/share/domoticz/plugins/PlugwiseStretch/plugin.py", line 262, 
in
> > 
> > onHeartbeat
> > 
> >     pT = datetime.strptime(str(a[0]),"%Y-%m-%dT%H:%M:%S.%f")
> > 
> > TypeError: attribute of type 'NoneType' is not callable
> > 
> > This NoneType message makes no sense to me.
> > 
> > Above that, when I remove the # in front of line 8 of this piece of code I 
get an
> > error message at compile time:
> > 
> > Error Line '          self.logMessage('a[0]='+str(a[0]))
> > 
> > This does not make sense to me either; it has the same construction as in 
line
> > 3 of this piece of code, which works and get compiled.
> > 
> > Any suggestions? Should I use python 3.10?
> 
> I do not feel this is an arm specific problem. Do you know which update 
could have break it?
> 
> You can give python 3.10 a try.
> 
> Guillaume

I did however:

zypper in -f python3-3.6.15-150300.10.27.1 python3-base-3.6.15-150300.10.27.1 
python3-dbm-3.6.15-150300.10.27.1 python3-devel-3.6.15-150300.10.27.1

So went back to an earlier version of Python 3.6 and all is OK.

Made a bug report on bugzilla: bug #1204829

-- 
fr.gr.

member openSUSE
Freek de Kruijf

Reply via email to