Loading construct library causes error - no viable alternative
<p>When I try to load the construct library v 2.5.4, in python 2.5.4 it is causing this error. Any idea how to resolve? Is there something I can adapt/edit in the library to fix this</p>

<pre><code>SyntaxError: ('no viable alternative at input \'""\'', ('/Users/blahblah/Documents/lib/java-classes/lib/Lib/construct/lib/binary.py', 66, 16, '        return 
b"".join(_char_to_bin[int(ch)] for ch in data)\n'))
</code></pre>

<p>You are running in some environment that suppresses a proper traceback printing and instead gives you the raw representation of the exception object.  It says that the error is in line 66, column 16 and then gives the line.</p>

<pre><code>        return b"".join(_char_to_bin[int(ch)] for ch in data)
</code></pre>

<p>The error, when running in 2.5, is <code>b"</code>.  The <code>b</code> string prefix is not valid until 2.7 (or perhaps 2.6), and even then, it has no effect.  It is only recognized to aid compatibility with 3.x. The use of the prefix indicates that the library is not intended to run with 2.5.  It might or might not be intended to work with 2.7.  You need to either find a version (likely older) that works with 2.5 or use a newer version of python.</p>

<p>You could fix this error by removing the <code>b</code>, but you will likely run into others.</p>

python python-module construct