Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic encoding possible for open and reading file or contents? #900

Open
donni106 opened this issue Jun 11, 2020 · 0 comments
Open

Dynamic encoding possible for open and reading file or contents? #900

donni106 opened this issue Jun 11, 2020 · 0 comments

Comments

@donni106
Copy link

We have an error for web pages that are not utf-8. Here is a code line (L325) which is affected:

def open(self, *args, **kwargs):
"""Open files from filesystem."""
raw = kwargs.pop('raw', False)
with open(self._path(*args), encoding = 'utf-8') as f:
return decode(f.read()) if raw else json.load(f)

Can this encoding be dynamic based on the web page or an option set for a web page in some configs?

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

No branches or pull requests

1 participant