Open choksi81 opened 10 years ago
Author: monzum I've seen similar problems when launching the custom installer and some of the transition scripts. Since they all share the same lib files and import from the same directory, sometimes when you start up a script it raises the TranslationError.
Using repyhelper.translate_and_import will throw a !TranslationError (see below) if the *_repy.py file of a module it is trying to import appears to not be auto-generated. It does this to prevent the chance of clobbering a file that isn't actually a _repy.py file generated from a .repy file.
However, if for any reason one of the repy files that the software updater depends on doesn't appear to be auto-generated, it will crash when it starts due to a !TranslationError.
So, the concern is along the lines of: what if the file should actually be overwritten because it's bogus? Maybe the user's disk was full the last time it tried to be auto-generated and an empty file was written, or the system crashed or process was killed while it was generating the file?
There is also risk of programmer error. What if the tag line used to identify auto-generated files was changed and all of the testing was done with clean installers rather than updates? Seems unlikely not to be noticed, but if it happened it could knock out every node that updated. (Similarly, had the _repy.py files accidentally pushed with 0.1j (#529) not had the correct tag line, it would have knocked out every node that updated due to the !TranslationError.)
So, there's probably risk of accidental clobbering, but it might be worth considering removing the auto-generated check from repyhelper. For that matter, it might be worth considering allowing use of a _repy.py file even if there is no corresponding .repy rather than throw a !TranslationError in that case, as well.
It's worth noting that it's not just a software updater issue. This same issue would cause the nodemanager to refuse to start. However, that seems less risky than if the software updater refused to start because the software updater not running would make it impossible to correct the issue.