Why does naming a file 'con.txt' in windows make Python write to console, not file?
<p>I need help debugging some odd file behavior in Python.  Take the following script (<code>write_con.py</code>):</p>

<pre><code>f=open('con.txt','w')
f.write('hi')
</code></pre>

<p>In Linux, this creates a file called <code>con.txt</code> with the contents <code>hi</code>.  In Windows this writes <code>hi</code> to the console and does not create a file.  I've tried this with Python 2.5.1, 2.6.3, 2.6.5, and 2.7.2.  Example run:</p>

<pre><code>C:\Users\rpsharp&gt; C:\Python27\python.exe .\write_con.py
hiC:\Users\rpsharp&gt; C:\Python25\python.exe .\write_con.py
hiC:\Users\rpsharp&gt;
</code></pre>

<p>Yet a file named anything other than something that starts with <code>con</code> works fine (<code>write_other_con.py</code>):</p>

<pre><code>f=open('other_con.txt','w')
f.write('hi')
</code></pre>

<p>Here's a run:</p>

<pre><code>C:\Users\rpsharp&gt; C:\Python25\python.exe .\write_other_con.py
C:\Users\rpsharp&gt; type .\other_con.txt
hi
</code></pre>

<p>What's going on that causes windows versions of python to write to the console when the prefix of the named file is <code>con</code>?</p>
