[docs] Bug on "open" function

Zachary Ware zachary.ware+pydocs at gmail.com
Fri Oct 30 15:03:06 EDT 2015


Hi,

On Fri, Oct 30, 2015 at 3:17 AM, 阎兆珣 <yanzhaoxun at greendh.com> wrote:
> Dear Staff:
>
>    I encountered a bug on "open" function on my Office computer, Pentium
> E5700 with 2GB of memory in Windows 7 32bit
>
>    f = open("README.txt","r") should open the README file in Python
> directory, but it failed.
>
>    Attached is the screenshot of the problem. Hope it helps.

Firstly, this is not the correct place to report non-documentation
bugs.  This list is meant for discussion of the Python documentation.
Bug reports may be sent to python-list at python.org, or reported on
bugs.python.org.

However, this is not a bug.  Python is raising a FileNotFoundError
exception because it can't find the file you want, probably because
Python's current working directory is not what you expect.  Try
'import os;print(os.getcwd())' to see what Python's current working
directory is, or pass an absolute path to open() to open the file you
want.

I hope this message helps your understanding.  If you have further
questions about this, please direct them to python-list at python.org.

Regards,
-- 
Zach


More information about the docs mailing list