kutsurak / python-bitstring

Automatically exported from code.google.com/p/python-bitstring
0 stars 0 forks source link

1.0.2 doesn't build in python2.4 #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

setup.py install

What is the expected output? What do you see instead?

Building.  Instead it fails because of ternary operators (1 occurrence) and
the b'' syntax, which doesn't work on py2.4 (3 occurrences)

What version of the product are you using? And which Python version?

1.0.2, python 2.4.3 (64-bit linux)

Please provide any additional information below.

Fixing the ternary operator bit is awkward by easy:

-            format = ''.join([f[-1]*int(f[:-1]) if len(f) != 1 else f for
f in formatlist])
+            format = []
+            for f in formatlist:
+                if len(f) == 1:
+                    format.append(f)
+                else:
+                    format.append(f[-1]*int(f[:-1]))
+            format = ''.join(format)
+            #format = ''.join([f[-1]*int(f[:-1]) if len(f) != 1 else f for
f in formatlist])

But the b'' thing...?  That's rougher!

Original issue reported on code.google.com by gregg.l...@gmail.com on 7 Nov 2009 at 10:27

GoogleCodeExporter commented 9 years ago
Okay, so after some more examination, other problematic parts include:

* 'bytes' function is 2.6+ only  (faked by aliasing it to str, just as in 2.6)
* the Iterable ABS is 2.6+, fakeable though.
* future_builtins is 2.6+

Original comment by gregg.l...@gmail.com on 7 Nov 2009 at 11:25

Attachments:

GoogleCodeExporter commented 9 years ago
I also don't know how to fake bytearray in Python 2.4.  Alias it to list()?

Original comment by gregg.l...@gmail.com on 7 Nov 2009 at 11:31

GoogleCodeExporter commented 9 years ago
Thanks for the report. You're right that the trunk build doesn't work for 
Python 2.4,
although as it's not released yet it's not guaranteed to work for any version!

The current stable version for Python 2.4 is 1.0.0, so you should use that 
version
from the Downloads tab. The 1.0.1 release works for Python 2.6 and 3.x, as will 
the
upcoming 1.0.2 release. I will probably go back and provide a newer version for
Python 2.4 and 2.5 when significant changes have occurred, but the main 
development
branch needs Python 2.6 or later I'm afraid.

Original comment by python.bitstring@googlemail.com on 8 Nov 2009 at 1:42