ebmlite icon indicating copy to clipboard operation
ebmlite copied to clipboard

Support Path objects where filenames are used

Open StokesMIDE opened this issue 4 years ago • 1 comments

In functions/methods that use a string to specify a path or filename, we should also support the use of pathlib.Path objects. For example, in Document.__init__(), isinstance(stream, (str, bytes, bytearray)) is used to identify a filename vs. a stream; we should add Path to that second argument, and that's about all we'd need to do.

In places where other code expects a string, we can cast to str to handle something that may either be a str or a Path.

StokesMIDE avatar Jun 24 '21 15:06 StokesMIDE

Path objects for loading schemata were introduced as part of #103, but there are other places it could be implemented.

StokesMIDE avatar Feb 17 '22 15:02 StokesMIDE