As per this suggestion:
https://github.com/Textualize/textual/pull/995#issuecomment-1290331867
the default time format changes to one with no problematic characters within
it. For the moment at least I'm going to keep the stripping of reserved
characters as the user of the code could still pass in problematic format
strings.
See #993.
While the code in _arrange.py does mark the unknown dock type branch as
being for the benefit of type checkers only, and was marked as to be ignored
for the purposes of coverage, it was still showing in a coverage test and
it's not a terrible thing to ensure that a user, giving the wrong type of
dock in their own code, will get the expected result.
Because testing on Windows is going to add a drive to any absolute path, and
in the tests we don't want to make it specific to something like that, take
the absolute path to test against and then absolute it again which is pretty
much a NOP on a Unix-a-like, but will add the drive on Windows.
This improves coverage of _make_path_object_relative in _path.py, and
generally provides some simple tests of how CSS_PATH gets turned into a
css_path property of an App.
Note that if an actual CSS path gets added (something that has been mooted)
this will need updating.
This extends the set of reserved characters that are guarded against when
auto-generating a screenshot filename. The extension covers the most likely
candidates taken from:
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
This could be spun out into a more general filename cleaning function, which
takes OS and filesystem into account and covers every single reserved
character, but for the purposes of this bit of code this should be more than
enough.
Addresses #993.