Closed bboudaoud-nv closed 2 years ago
It may be worth noting that G3D also has an option for FilePath::makeLegalFilename()
that we could use as an alternative to attempt to automatically correct invalid filenames as opposed to just throwing an exception. The behavior of this method is not documented and I haven't looked into it so I didn't use it ahead of throwing the exception for now.
Update: FilePath::makeLegalFilename()
replaces any illegal character(s) with _
, and has logic to avoid appending multiple _
s in a row. This may be a viable approach to avoid illegal names with things like spaces.
Currently this branch also introduces an issue with descriptions/user names that include spaces. This should be resolved before merging...
For now I've moved to using FilePath::makeLegalFilename()
as a quick fix here. This is a work-around for the problem of temporary user names (i.e., "Create a new user") and experiment descriptions with spaces in them triggering a runtime exception.
This may only cause issues when something like 2 user IDs/experiment descriptions only differ by sequential illegal characters in which case they may collide... I think this branch is a fine fix for the issue for now
Actually, it looks like there's a likely bug with an extra + ".db"
in there. Checking that before merging.
Actually, it looks like there's a likely bug with an extra
+ ".db"
in there. Checking that before merging.
This should be fixed with 137b0da
This branch adds a
FilePath::isLegalFilename()
check on the filename used for the results database. Previously the results could fail to write due to an illegal character in either an experiment description or a user name.The new check should throw an exception when any invalid filename character is detected in the results filename. It is worth noting this may catch characters that technically legal but not encouraged for file naming.
Merging this PR closes #351