Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
Closed
Description
Bug report
Bug description:
GNU coreutilsrealpath -e errors out when given a path to a file (not a directory) with a trailing slash:
$ realpath -e python/realpath: python/: Not a directory
... but Python'sos.path.realpath(..., strict=True) doesn't raise any error:
>>>os.path.isfile('python')True>>>os.path.isdir('python')False>>>os.path.realpath('python/',strict=True)# should raise NotADirectoryError'/home/barney/projects/cpython/python'>>>os.path.realpath('python/.',strict=True)# should raise NotADirectoryError'/home/barney/projects/cpython/python'
CPython versions tested on:
3.12, 3.13, CPython main branch
Operating systems tested on:
Linux