TypeError: '>' not supported between instances of 'NoneType' and 'int'
After I run this code: from sas7bdat import SAS7BDAT DS=SAS7BDAT('xxxxx.sas7bdat')
I got following message:
[key_lexid.sas7bdat] header length 1024 != 8192
TypeError Traceback (most recent call last) <ipython-input-7-9264883b8ea8> in <module>() ----> 1 DS=SAS7BDAT('xxxxx.sas7bdat')
~/anaconda3/lib/python3.6/site-packages/sas7bdat.py in init(self, path, log_level, extra_time_format_strings, extra_date_time_format_strings, extra_date_format_strings, skip_header, encoding, encoding_errors, align_correction) 451 self.header = SASHeader(self) 452 self.properties = self.header.properties --> 453 self.header.parse_metadata() 454 self.logger.debug('\n%s', str(self.header)) 455 self._iter = self.readlines()
~/anaconda3/lib/python3.6/site-packages/sas7bdat.py in parse_metadata(self) 1521 'Failed to read a meta data page from file' 1522 ) -> 1523 done = self.process_page_meta() 1524 1525 def read_page_header(self):
~/anaconda3/lib/python3.6/site-packages/sas7bdat.py in process_page_meta(self) 1548 self.read_page_header() 1549 if self.parent.current_page_type in self.PAGE_META_MIX_AMD: -> 1550 self.process_page_metadata() 1551 return self.parent.current_page_type in self.PAGE_MIX_DATA_TYPE or \ 1552 self.parent.current_page_data_subheader_pointers
~/anaconda3/lib/python3.6/site-packages/sas7bdat.py in process_page_metadata(self) 1579 cls(parent).process_subheader( 1580 pointer.offset, -> 1581 pointer.length 1582 ) 1583 else:
~/anaconda3/lib/python3.6/site-packages/sas7bdat.py in process_subheader(self, offset, length) 1000 ) 1001 self.properties.creator_proc = creatorproc -> 1002 elif self.properties.lcs > 0: 1003 self.properties.lcp = 0 1004 vals = self.parent._read_bytes({
TypeError: '>' not supported between instances of 'NoneType' and 'int'
I do not know what's wrong for input sas7bdat files.
Comments (2)
-
repo owner -
I get the error with this file : sasfile
- Log in to comment
I'll need a sample file to reproduce this issue in order to fix it