@@ -824,7 +824,7 @@ class StataParser(object):
824
824
def __init__ (self , encoding = 'latin-1' ):
825
825
826
826
if encoding not in VALID_ENCODINGS :
827
- raise ValueError ('Unknown encoding. Only latin-1 and ascii '
827
+ raise ValueError ('Unknown encoding. Only latin-1 and ascii '
828
828
'supported.' )
829
829
830
830
self ._encoding = encoding
@@ -1373,7 +1373,8 @@ def _read_value_labels(self):
1373
1373
1374
1374
def _read_strls (self ):
1375
1375
self .path_or_buf .seek (self .seek_strls )
1376
- self .GSO = {0 : '' }
1376
+ # Wrap v_o in a string to allow uint64 values as keys on 32bit OS
1377
+ self .GSO = {'0' : '' }
1377
1378
while True :
1378
1379
if self .path_or_buf .read (3 ) != b'GSO' :
1379
1380
break
@@ -1398,7 +1399,8 @@ def _read_strls(self):
1398
1399
if self .format_version == 117 :
1399
1400
encoding = self ._encoding or self ._default_encoding
1400
1401
va = va [0 :- 1 ].decode (encoding )
1401
- self .GSO [v_o ] = va
1402
+ # Wrap v_o in a string to allow uint64 values as keys on 32bit OS
1403
+ self .GSO [str (v_o )] = va
1402
1404
1403
1405
# legacy
1404
1406
@Appender ('DEPRECATED: ' + _data_method_doc )
@@ -1634,7 +1636,8 @@ def _insert_strls(self, data):
1634
1636
for i , typ in enumerate (self .typlist ):
1635
1637
if typ != 'Q' :
1636
1638
continue
1637
- data .iloc [:, i ] = [self .GSO [k ] for k in data .iloc [:, i ]]
1639
+ # Wrap v_o in a string to allow uint64 values as keys on 32bit OS
1640
+ data .iloc [:, i ] = [self .GSO [str (k )] for k in data .iloc [:, i ]]
1638
1641
return data
1639
1642
1640
1643
def _do_select_columns (self , data , columns ):
0 commit comments