Eryk Sun <eryk...@gmail.com> added the comment:
Sorry, I seem to have missed your post last month when I scanned over the thread on python-ideas [1]. In POSIX, it could try to handle ENAMETOOLONG by walking the path forward with a relative chdir(). This could try to consume as many components as possible in each pass according to os.pathconf(cwd, os.pathconf_names['PC_PATH_MAX']), starting with cwd='/' and subsequently cwd=".". However, the return value is unreliable if the relative path traverses a mount point into a more restrictive filesystem [2]. It's probably good enough to just walk forward one component at a time. --- [1] https://mail.python.org/archives/list/python-id...@python.org/thread/C525UVPP3ALGTXDNFL2GFDV23KCHP3RL [2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45545> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com