[docs] [issue37478] Docs: Method os.chdir() does not mention errors that can be raised

Terry J. Reedy report at bugs.python.org
Fri Jul 5 15:33:51 EDT 2019


Terry J. Reedy <tjreedy at udel.edu> added the comment:

> what exactly is the standard for mentioning errors
My impression is that there is none, or that it is inconsistent, but that the trend is to say more.  If you want to followup, check the documentation chapters of the devguide, and if there is nothing clear now, post to the pydev list.

https://docs.python.org/3/library/os.html#os-file-dir has

 os.chdir(path)
    Change the current working directory to path.
    This function can support specifying a file descriptor. The descriptor must refer to an opened directory, not an open file.

Most of the other entries in do not mention errors, but is_dir has the line mentioned.  I think the condensed line is enough to add, as the sub-exception names are self-explanatory; and when they occur, the full message certainly is.  (I verified both possibilities mentioned.)  Most users should just catch OSError, if anything.

Make a PR with the short message and request me as a reviewer.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37478>
_______________________________________


More information about the docs mailing list