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.

classification
Title: Can't Locate File with No Capital in Name
Type: Stage:
Components: None Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eckhardt, markpennock
Priority: normal Keywords:

Created on 2009-01-09 17:05 by markpennock, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg79478 - (view) Author: mark pennock (markpennock) Date: 2009-01-09 17:09
error reading files in python 2.5

reports files don't exist under certain conditions

*Doesn't Work Code*
f = open("D:\test.html", "r").read()

*Does Work Code*
(Change file name and retry)

f = open("D:\Test.html", "r").read()

*Comments*
i tried different file types and names all of which made no difference.
When I copied the file (Windows XP) of the file it automatically adds
"Copy of" to the name. I then narrowed it down to the Capital letter in
the name.
msg79479 - (view) Author: Ulrich Eckhardt (eckhardt) Date: 2009-01-09 17:12
"\t" is a tab while "\T" is (I think) just an ugly equivalent to "T". 
Use either of

  r"D:\test.html" 
  "D:\\test.html"

Please check if that is the reason for your failure.
msg79480 - (view) Author: mark pennock (markpennock) Date: 2009-01-09 17:16
Your right! Thanks a lot, I am obviously a newbie.....
History
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49150
2009-01-09 17:40:06benjamin.petersonsetstatus: open -> closed
resolution: not a bug
2009-01-09 17:16:17markpennocksetmessages: + msg79480
2009-01-09 17:12:47eckhardtsetnosy: + eckhardt
messages: + msg79479
2009-01-09 17:09:26markpennocksetmessages: + msg79478
2009-01-09 17:05:16markpennockcreate