New submission from Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:

on Windows, the stat() function always returns True for some special
device names (nul, con, com1, lpt1...), even when followed by an extension.

Thus "import con" manages to find that "con.py" exists, and tries to
read from it... fun.

A solution is to use GetFileAttributes() instead.

Note that on python2.5.2, the error message suggest that we have such a
problem, but fortunately the error is still an ImportError::
  >>> import nul
  ImportError: DLL load failed: Le module spécifié est introuvable.

----------
components: Windows
messages: 68115
nosy: amaury.forgeotdarc, ocean-city
severity: normal
status: open
title: On windows, "import nul" always succeed
versions: Python 2.5, Python 2.6, Python 3.0

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3099>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to