From 4c4fb973f3fc7ae3b1224f6657a4117fff28cc3e Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Fri, 8 Apr 2022 10:14:49 +0700 Subject: [PATCH] Fix trailing comma removal --- tools/redditcrawl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/redditcrawl.py b/tools/redditcrawl.py index 8641e88c..00b45c19 100755 --- a/tools/redditcrawl.py +++ b/tools/redditcrawl.py @@ -109,8 +109,8 @@ print("written "+submission.id+", submitted "+str(round(time.time()-submission.created_utc))+" seconds ago") totalcount += 1 -# Remove ,\n -outfile.seek(outfile.tell()-4, os.SEEK_SET) +# Remove last trailing comma +outfile.seek(outfile.tell()-3, os.SEEK_SET) outfile.truncate() outfile.write("\n]")