Skip to content

Improve compatibility with Windows#41

Open
Kilo19 wants to merge 1 commit intophilipbl:masterfrom
Kilo19:master
Open

Improve compatibility with Windows#41
Kilo19 wants to merge 1 commit intophilipbl:masterfrom
Kilo19:master

Conversation

@Kilo19
Copy link
Copy Markdown

@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:
Copy link
Copy Markdown

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