dictation-toolbox / natlinkcore

Other
4 stars 4 forks source link

config.py expand_path unexpected behavior #43

Open dougransom opened 1 year ago

dougransom commented 1 year ago

in repot https://github.com/dougransom/natlinkcore/tree/nc_tests_tweak/src/natlinkcore

I added

except Exception as e:
        print(f"{__file__} Exception {e} ignored in expand_path{input_path}")

catching

C:\Users\doug\code\dt\natlinkcore\src\natlinkcore\config.py Exception PureWindowsPath('C:') has an empty name ignored in expand_pathC:\Users\doug\code\dt\unimacro\tests\unimacro_test_natlink_config.natlink

Not sure why that is being thrown, but not catching exceptions here seems to cause issues.

I would propose a keyword argument to expand path, attempt_load=True which will only try the import trick if it is set.