Problem with Python version for version >=3.10

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
mstorti
Posts: 4
Joined: Wed Jan 25, 2017 2:00 pm

Problem with Python version for version >=3.10

Post by mstorti »

Hi all,

I wonder if someone has stumbled on this problem before. CS stopped to work after upgrade to Fedora 35. It compiles and installs OK, but when trying to run a case it results in an error

Code: Select all

 Traceback (most recent call last):
   File "/home/scratch/mstorti/TO-BACKUP/DATA-CD/saturne-vof/bin/code_saturne", line 67, in <module>
     from cs_script import master_script
It seems that the problem is that in many Python scripts within CS the major.minor version of Python is obtained as sys.version[:3] which fails unless both numbers have one digit. I'm using CS 6.1 but I checked with the current version and it seems that the problem is still there.

I solved it replacing in the sources sys.version[:3] with the following string:

Code: Select all

python_version = "%d.%d" % (sys.version_info.major,sys.version_info.minor)
Find attached a patch in case it helps.
Attachments
pyvers.patch.zip
(1.39 KiB) Downloaded 376 times
Yvan Fournier
Posts: 4157
Joined: Mon Feb 20, 2012 3:25 pm

Re: Problem with Python version for version >=3.10

Post by Yvan Fournier »

Thanks a lot Mario !

Yvan
Post Reply