Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Okay, I think I figured it out, although I have no idea why. My question was what I though was the root cause of my original problem which was that I got</p> <pre><code>sre_constants.error nothing to repeat </code></pre> <p>when I tried to compile my program in the XP virtual environment. The cause of this was in <code>C:\Python27\Lib\site-packages\pywinauto\tests\asianhotkey.py</code> at line 110.</p> <pre><code>_asianHotkeyRE = re.compile (r""" \(&amp;.\) # the hotkey ( (\t.*)| # tab, and then anything #(\\t.*)| # escaped tab, and then anything (\(.*\) # anything in brackets )| \s*| # any whitespace :| # colon (\.\.\.)| # elipsis &gt;| # greater than sign &lt;| # less than sign (\n.*) # newline, and then anything \s)*$""", re.VERBOSE) </code></pre> <p>I couldn't even run this in its own script in my virtual XP environment. It would run if I either removed the <code>*</code> in either one of these lines</p> <pre><code>\s*| # any whitespace </code></pre> <p>or</p> <pre><code>\s)*$""", re.VERBOSE) </code></pre> <p>I have no idea why that was the case, just experimental outcomes.</p> <p>Anyway, as far as I could tell the variable <code>_asianHotkeyRE</code> is only used once in this whole package; at line (133) of this same file:</p> <pre><code>found = _asianHotkeyRE.search(text) </code></pre> <p>So I changed those two groups of code to </p> <pre><code>pattern = r""" \(&amp;.\) # the hotkey ( (\t.*)| # tab, and then anything #(\\t.*)| # escaped tab, and then anything (\(.*\) # anything in brackets )| \s*| # any whitespace :| # colon (\.\.\.)| # elipsis &gt;| # greater than sign &lt;| # less than sign (\n.*) # newline, and then anything \s)*$""" </code></pre> <p>and</p> <pre><code> found = re.search(pattern,text) </code></pre> <p>Something about using regular expression compiling didn't like the formatting of this pattern. Maybe the version of <code>re</code> that is installed on that virtual machine isn't up to date or something?</p> <p>So long story short, it's fixed. I don't know why and I would love it if someone could try to reproduce the issue using their own virtual environments of any kind. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload