New submission from Guilherme Moro <[email protected]>:
http://docs.python.org/library/os.html#os.access
points out that I should use
try:
fp = open("myfile")
except IOError as e:
if e.errno == errno.EACCESS:
return "some default data"
# Not a permission error.
raise
else:
with fp:
return fp.read()
but theres a typo the correct is errno.EACCES: not errno.EACCESS:
----------
assignee: docs@python
components: Documentation
messages: 146024
nosy: Guilherme.Moro, docs@python
priority: normal
severity: normal
status: open
title: os.acces documentation error
versions: Python 2.7
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13233>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com