csaftoiu / yahoo-groups-backup

A python script to backup the contents of private Yahoo! groups.
The Unlicense
37 stars 18 forks source link

AttributeError: 'list' object has no attribute 'apply' #44

Open imfatant opened 6 years ago

imfatant commented 6 years ago

Solved one issue, and now another. Still trying to dump a site. Any ideas? Here's the output:

$ ./yahoo-groups-backup.py dump_site jokes_and_stories jas_test Rendering templates... Rendering config file... Rendering index data... Traceback (most recent call last): File "./yahoo-groups-backup.py", line 129, in main() File "./yahoo-groups-backup.py", line 125, in main arguments, cfg_args) File "./yahoo-groups-backup.py", line 103, in invoke_subcommand return module.command(args) File "/home/bo/yahoo-groups-backup/yahoo_groups_backup/subcommands/dump_site.py", line 334, in command ds.run() File "/home/bo/yahoo-groups-backup/yahoo_groups_backup/subcommands/dump_site.py", line 318, in run self.render_index() File "/home/bo/yahoo-groups-backup/yahoo_groups_backup/subcommands/dump_site.py", line 246, in render_index for message in self.db.yield_all_messages(start=self.redact_before) File "/home/bo/yahoo-groups-backup/yahoo_groups_backup/subcommands/dump_site.py", line 246, in for message in self.db.yield_all_messages(start=self.redact_before) File "/home/bo/yahoo-groups-backup/yahoo_groups_backup/subcommands/dump_site.py", line 232, in apply_redactions return self.redactions.apply(text) AttributeError: 'list' object has no attribute 'apply'

chapatt commented 5 years ago

It's because in yahoo_groups_backup/subcommands/dump_site.py, DumpSite.redactions is mistakenly initialized to an empty list if no --redactions= argument is provided, instead of a real instance of Redactions. So either provide a redactions yaml file (there's an example template in the root), or edit dump_site.py to add a line: from yahoo_groups_backup.redaction import Redactions And change: self.redactions = [] to: self.redactions = Redactions([])