Forum Stats

  • 3,853,758 Users
  • 2,264,266 Discussions
  • 7,905,443 Comments

Discussions

Updating time-slider to python 3.7 on Solaris 11.4.42.111.0

Random Kiwi
Random Kiwi Member Posts: 1 Green Ribbon
edited Mar 6, 2022 6:42AM in Solaris 11

A few problems with time-slider as released with the 11.4.42 CBE build: python is now by default python3, so a few adjustments need to be made to the time-slider code

In lib/time_slider/util.py, all references to f[statvfs.F_XXXX] need to be replaced with f.f_xxxx (for XXXX in BAVAIL, BLOCKS, FRSIZE), and any "import statvfs" statements need to be removed. Also, since the default character encoding has gone from 8-bit ASCII to UTF-8, in run_command(...), outdata.decode() needs to be outdata.decode(encoding='iso-8859-1') to allow 8-bit data to be passed back from the command that is being run.

In lib/plugin/rsync/backup.py, f = open(testKeyFile, 'r') needs to be f = open(testKeyFile, 'r', encoding='iso-8859-1')

Why? Because at some time in the past the code in lib/time_slider/setupgui.py that sets up a new random target key didn't generate printable data, so if you're unlucky you could have got a sequence of bytes that are not a legal UTF-8 encoding, meanwhile the changes above will allow an existing system with a problematic key to continue to function. The current code was modified to use the characters in string.letters, but letters is not available in python3, so it should be changed to ascii_letters instead.

I'm not a user with a support contract so I don't know how to file a formal bug report, but perhaps this will be useful for anyone else who has to use time-slider.

Tagged: