fix traceback when logging path object