@@ -611,9 +611,10 @@ class StataMissingValue(StringMixin):
611
611
MISSING_VALUES = {}
612
612
bases = (101 , 32741 , 2147483621 )
613
613
for b in bases :
614
- MISSING_VALUES [b ] = '.'
614
+ # Conversion to long to avoid hash issues on 32 bit platforms #8968
615
+ MISSING_VALUES [compat .long (b )] = '.'
615
616
for i in range (1 , 27 ):
616
- MISSING_VALUES [i + b ] = '.' + chr (96 + i )
617
+ MISSING_VALUES [compat . long ( i + b ) ] = '.' + chr (96 + i )
617
618
618
619
float32_base = b'\x00 \x00 \x00 \x7f '
619
620
increment = struct .unpack ('<i' , b'\x00 \x08 \x00 \x00 ' )[0 ]
@@ -643,6 +644,8 @@ class StataMissingValue(StringMixin):
643
644
644
645
def __init__ (self , value ):
645
646
self ._value = value
647
+ # Conversion to long to avoid hash issues on 32 bit platforms #8968
648
+ value = compat .long (value ) if value < 2147483648 else float (value )
646
649
self ._str = self .MISSING_VALUES [value ]
647
650
648
651
string = property (lambda self : self ._str ,
@@ -1375,13 +1378,6 @@ def _pad_bytes(name, length):
1375
1378
return name + "\x00 " * (length - len (name ))
1376
1379
1377
1380
1378
- def _default_names (nvar ):
1379
- """
1380
- Returns default Stata names v1, v2, ... vnvar
1381
- """
1382
- return ["v%d" % i for i in range (1 , nvar + 1 )]
1383
-
1384
-
1385
1381
def _convert_datetime_to_stata_type (fmt ):
1386
1382
"""
1387
1383
Converts from one of the stata date formats to a type in TYPE_MAP
0 commit comments