Skip to content

Commit

Permalink
Fix issue with processing files longer than 4k
Browse files Browse the repository at this point in the history
  • Loading branch information
mkamarin committed Feb 13, 2023
1 parent 7a91759 commit 87ce232
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hugo2gg.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io
import sys
import html
import shutil
import getopt
import random
import urllib
Expand Down Expand Up @@ -287,9 +288,7 @@ def clone_file(src, dst):
if not os.path.exists(dstFolder):
os.makedirs(dstFolder)

with open(src, 'rb') as flSrc:
with open(dst, 'wb') as flDst:
flDst.write(flSrc.read(4096))
shutil.copyfile(src, dst)

except OSError as e:
error(e, " while processing files", src,"=>",dst)
Expand Down

0 comments on commit 87ce232

Please sign in to comment.