This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Guilherme.Moro
Recipients Guilherme.Moro, docs@python
Date 2011-10-20.16:20:40
SpamBayes Score 0.034517474
Marked as misclassified No
Message-id <1319127640.96.0.83884717457.issue13233@psf.upfronthosting.co.za>
In-reply-to
Content
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:
History
Date User Action Args
2011-10-20 16:20:41Guilherme.Morosetrecipients: + Guilherme.Moro, docs@python
2011-10-20 16:20:40Guilherme.Morosetmessageid: <1319127640.96.0.83884717457.issue13233@psf.upfronthosting.co.za>
2011-10-20 16:20:40Guilherme.Morolinkissue13233 messages
2011-10-20 16:20:40Guilherme.Morocreate