#113 Error with trailing L on Constants with Python 3 on Windows

closed-invalid
nobody
None
5
2011-11-02
2011-10-30
Chris Mayo
No

Had to make the following modifications to get pyserial working with Python 3.2.2 on Windows 7 (64bit) (relative to r430) - not so good for Python 2 I guess!

--- win32.py.orig
+++ win32.py
@@ -193,7 +193,7 @@
PURGE_TXCLEAR = 4 # Variable c_int
FILE_FLAG_OVERLAPPED = 1073741824 # Variable c_int
EV_DSR = 16 # Variable c_int
-MAXDWORD = 4294967295L # Variable c_uint
+MAXDWORD = 4294967295 # Variable c_uint
EV_RLSD = 32 # Variable c_int
ERROR_IO_PENDING = 997 # Variable c_long
MS_CTS_ON = 16 # Variable c_ulong
@@ -208,12 +208,12 @@
EV_TXEMPTY = 4 # Variable c_int
EV_RXFLAG = 2 # Variable c_int
MS_RLSD_ON = 128 # Variable c_ulong
-GENERIC_READ = 2147483648L # Variable c_ulong
+GENERIC_READ = 2147483648 # Variable c_ulong
EV_EVENT2 = 4096 # Variable c_int
EV_CTS = 8 # Variable c_int
EV_BREAK = 64 # Variable c_int
PURGE_RXCLEAR = 8 # Variable c_int
-INFINITE = 0xFFFFFFFFL
+INFINITE = 0xFFFFFFFF

class N11_OVERLAPPED4DOLLAR_48E(Union):

Discussion

  • Chris Liechti
    Chris Liechti
    2011-11-01

    did you install with "python3 setup.py"? in that case, the files should get converted automatically w/ 2to3.py

     
  • Chris Liechti
    Chris Liechti
    2011-11-01

    • status: open --> pending
     
  • Chris Mayo
    Chris Mayo
    2011-11-02

    • status: pending --> closed-invalid
     
  • Chris Mayo
    Chris Mayo
    2011-11-02

    I did run "setup.py install" but because of the 64bit problems then grabbed win32.py from subversion and just copied it into site-packages. Didn't realise it was modified in the install. Thanks for the explanation.