Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #82500
| References | <mailman.16941.1418547951.18130.python-list@python.org> <548d6e92$0$13013$c3e8da3$5496439d@news.astraweb.com> <mailman.16942.1418555375.18130.python-list@python.org> <548d79cb$0$13008$c3e8da3$5496439d@news.astraweb.com> |
|---|---|
| Date | 2014-12-14 23:13 +1100 |
| Subject | Re: which is the right file path format in python3.4 ? |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.16943.1418559201.18130.python-list@python.org> (permalink) |
On Sun, Dec 14, 2014 at 10:51 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> I don't have access to a Windows box to check, otherwise I would do it
> myself. What happens if you specify a non-existent drive letter?
>
> open("Q:\\xxx") # Assuming you don't have a drive Q.
Hmm. I just grabbed one (granted, it's XP not W7) and checked it, and
it's not what I was expecting either.
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:24:06) [MSC v.1600
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> open("Q:\\xxx")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'Q:\\xxx'
Still, it might be something unusual about the OP's drive. Maybe a
network drive with a broken connection, or a mounted CD, or an alias
for another directory... who knows. Hopefully the stat and access
checks will reveal something.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
which is the right file path format in python3.4 ? sir <elearn2014@gmail.com> - 2014-12-14 17:05 +0800
Re: which is the right file path format in python3.4 ? Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2014-12-14 10:52 +0100
Re: which is the right file path format in python3.4 ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-14 22:03 +1100
Re: which is the right file path format in python3.4 ? Chris Angelico <rosuav@gmail.com> - 2014-12-14 22:09 +1100
Re: which is the right file path format in python3.4 ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-14 22:51 +1100
Re: which is the right file path format in python3.4 ? Chris Angelico <rosuav@gmail.com> - 2014-12-14 23:13 +1100
csiph-web