Pyyhon regular expression works on OSx but not on Windows
<pre><code>expression = re.compile(ur'\?(.*)')
</code></pre>

<p>The expression is simple and this project was originally built on a mac. It runs fine on the mac, however it doesn't run on windows failing with </p>

<pre><code>File "path/to/scrapy/spiders/spider.py", line 42
expression = re.compile(ur'\?(.*)')
                                 ^
</code></pre>

<p>It is not about Mac vs Windows, I suspect, <em>it is about the Python version you are using to run this code on</em>.</p>

<p>When I run this code on Python 2.7 - it runs fine, no problems. On Python 3.5 I get a <code>SyntaxError</code> (cause of the <code>u</code> prefix, of course):</p>

<pre><code>  File "/Users/user/SO/test.py", line 3
    expression = re.compile(ur'\?(.*)')
                                     ^
SyntaxError: invalid syntax
</code></pre>

<p>Check that you are actually using Python 2 on both machines.</p>

python windows osx