Skip to content

Commit

Permalink
removed the mutable default value for warc_header_dict keyword arg in…
Browse files Browse the repository at this point in the history
… BaseWARCWriter:create_revisit_record and BaseWARCWriter:create_warc_record (#70)
  • Loading branch information
N0taN3rd authored and ikreymer committed Feb 19, 2019
1 parent 759ab07 commit 7f533c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions warcio/warcwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,11 @@ def create_warcinfo_record(self, filename, info):
length=length)

def create_revisit_record(self, uri, digest, refers_to_uri, refers_to_date,
http_headers=None, warc_headers_dict={}):
http_headers=None, warc_headers_dict=None):

assert digest, 'Digest can not be empty'
if warc_headers_dict is None:
warc_headers_dict = dict()

record = self.create_warc_record(uri, 'revisit', http_headers=http_headers,
warc_headers_dict=warc_headers_dict)
Expand All @@ -187,9 +189,11 @@ def create_warc_record(self, uri, record_type,
payload=None,
length=None,
warc_content_type='',
warc_headers_dict={},
warc_headers_dict=None,
warc_headers=None,
http_headers=None):
if warc_headers_dict is None:
warc_headers_dict = dict()

if payload and not http_headers:
loader = ArcWarcRecordLoader()
Expand Down

0 comments on commit 7f533c8

Please sign in to comment.