isaacmg / fb_scraper

FBLYZE is a Facebook scraping system and analysis system.
Apache License 2.0
64 stars 21 forks source link

Shelve corruption #14

Closed isaacmg closed 7 years ago

isaacmg commented 7 years ago

Occasionally when testing an error is occurring when opening shelve file.

isaacmg commented 7 years ago

    return DbfilenameShelf(filename, flag, protocol, writeback)                                   
  File "/opt/conda/lib/python3.6/shelve.py", line 227, in __init__                                
    Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)                           
  File "/opt/conda/lib/python3.6/dbm/__init__.py", line 94, in open                               
    return mod.open(file, flag, mode)                                                             
AttributeError: module 'dbm.gnu' has no attribute 'open'                                          
isaacmg commented 7 years ago

Bug is hopefully fixed by changing ln of fb_scrapper to

with shelve.open(path) as d:
            if page_id in d:
                time_opened = d[page_id]
                pageStamp = str(time_opened)
                print("Scraping since unix time " + pageStamp)
isaacmg commented 7 years ago

This should have been fixed with the migration to postgresql