[issue24196] Fail to create file if name starts with prn.

2015-05-14 Thread Boris

New submission from Boris:

 f=open('prn.txt','w')
Traceback (most recent call last):
  File pyshell#80, line 1, in module
f=open('prn.txt','w')
FileNotFoundError: [Errno 2] No such file or directory: 'prn.txt'

Names that fail:
prn.
prn.txt
prn.yourmmama.txt
...

Names that do not fail:
prn
prn_.txt
npr.txt
...

Happens on Windows 7, Python3.3, both 32 bit and 64 bit
This should be easy to replicate.

--
components: IO
messages: 243219
nosy: borisompol
priority: normal
severity: normal
status: open
title: Fail to create file if name starts with prn.
type: behavior
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24196
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24196] Fail to create file if name starts with prn.

2015-05-14 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +steve.dower

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24196
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24196] Fail to create file if name starts with prn.

2015-05-14 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
stage:  - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24196
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24196] Fail to create file if name starts with prn.

2015-05-14 Thread Martin Panter

Martin Panter added the comment:

I could be wrong, but I thought this was normal Windows behaviour, not related 
to Python. Same probably applies to other special names like NUL, COM1.

--
components: +Windows
nosy: +tim.golden, vadmium, zach.ware

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24196
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24196] Fail to create file if name starts with prn.

2015-05-14 Thread Steve Dower

Steve Dower added the comment:

It's a name reserved by Windows - see 
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx#file_and_directory_names

If you have a full (and 100% resolved) path, you can prefix it with \\?\ (plus 
escaping) to access a file by that name, but I wouldn't recommend it as you'll 
probably break Explorer.

In any case, this is an OS limitation and not a Python issue.

--
resolution:  - not a bug

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24196
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com