New submission from Richard:

No idea if I should be reporting this here, but it came with the default 
installation, so here goes:

On a mac, I supplied a basicConfig object to the logging class that contains a 
PosixPath instance for the "filename" attribute.
consequently, it fails with the error message "'PosixPath' object has no 
attribute 'startswith'" without specifying where the issue lies.

offending value:
STATUSLOG_PATH   = Path('~/logFiles/Reseller/').expanduser()

Relevant part of the traceback (which didn't print by default):
  File 
"/Users/rhendrikse/Documents/PythonScripts/Reseller/Reseller/application/application.py",
 line 41, in __setup_logger
    logging.basicConfig(level=logging.DEBUG, format=DEFS.RUNLOG_FORMAT, 
filename=DEFS.RUNLOG_PATH)
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py",
 line 1744, in basicConfig
    h = FileHandler(filename, mode)
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py",
 line 998, in __init__
    self.baseFilename = os.path.abspath(filename)
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/posixpath.py", 
line 357, in abspath
    if not isabs(path):
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/posixpath.py", 
line 64, in isabs
    return s.startswith(sep)
AttributeError: 'PosixPath' object has no attribute 'startswith'

----------
components: Library (Lib)
messages: 270233
nosy: rhendrikse
priority: normal
severity: normal
status: open
title: logging module fails with unclear error when supplied a (Posix)Path
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27493>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to