Decompressing bz2 files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hobbyuser
    Junior Member
    • Sep 2019
    • 17

    #1

    Decompressing bz2 files

    Hi - I am downloading bz2 files using Python and Historical data API. Some of these bz2 files do not decompress (not all files). I noticed that the files that give error are all 152 bytes size. The files that are larger (1kb, 2kb etc) decompress fine. I tried decompressing both using bz2 package in Python and also manual decompression using 7zip. Both give error. So there is something peculiar with the 152 byte files. Python's error says ''Invalid data stream".

    Appreciate any help.

  • hobbyuser
    Junior Member
    • Sep 2019
    • 17

    #2
    OK I managed to open one of these files using TextEdit. Here is the content of the file:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title>not_logged_in</title>
    </head>
    <body>
    not_logged_in
    </body>
    </html>




    Why am I getting a 'Not Logged In' notice in these files? Some files have this notice and some have the proper data. Appreciate any help solving this.

    Comment

    • hobbyuser
      Junior Member
      • Sep 2019
      • 17

      #3
      Looks like I may need to refresh my login during file download. I will put an exception handler into my Python code. Hopefully this will fix.

      Comment

      Working...
      X