Skip to content

Conversation

Kilo19
Copy link

@Kilo19 Kilo19 commented Jun 1, 2018

*Magic is hard to set up on Windows and does not handle non-ASCII paths well. Python's built-in imghdr works for the job really well.
*open() on Windows does not use Unicode by default. Use codecs.open() instead.

*Magic is hard to set up on Windows and does not handle non-ASCII paths well. Python's built-in imghdr works for the job really well.
*open() on Windows does not use Unicode by default. Use codecs.open instead.
chunk_size = 25
for i, dups in enumerate(chunked(duplicates, chunk_size)):
with open('{}/{}.html'.format(folder, i), 'w') as f:
with codecs.open('{}/{}.html'.format(folder, i), 'w', 'utf-8') as f:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works as well

with open('{}/{}.html'.format(folder, i), 'w', encoding='utf-8') as f:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants