MAB  
          
              
                August 21, 2021,  9:22am
               
              #1 
           
         
        
          I get the following error when I try to run the codes for chapter 2, processing Nasdaq ITCH data:
Start of Messages
Start of System Hours 
error                                     Traceback (most recent call last)
error: unpack requires a buffer of 18 bytes
How can I solve this problem, and what is the problem exactly?
         
        
           
         
            
       
      
        
        
          Hi,
         
        
           
         
            
       
      
        
          
          
            MAB  
          
              
                September 5, 2021, 11:33am
               
              #3 
           
         
        
          Hi,
FTP_URL = ‘ftp://emi.nasdaq.com/ITCH/Nasdaq  ITCH/’
         
        
           1 Like 
         
         
            
       
      
        
          
          
            JB31  
          
              
                January 19, 2024,  3:13pm
               
              #4 
           
         
        
          Hi @MAB 
def unpack_helper(fmt, data):
    size = calcsize(fmt)
    if (len(data) < size):
        record = (data+data[0:calcsize(fmt)-len(data)]).decode('latin1').encode('utf-8')
        return unpack(fmt, record[:size])
    return unpack(fmt, data[:size])
And
message = message_fields[message_type]._make(unpack_helper(fstring[message_type], record))