Skip to content
This repository was archived by the owner on Jan 9, 2022. It is now read-only.

Possible encoding problem when loading notebooks #6

Open
michaelosthege opened this issue Jan 9, 2022 · 2 comments
Open

Possible encoding problem when loading notebooks #6

michaelosthege opened this issue Jan 9, 2022 · 2 comments

Comments

@michaelosthege
Copy link

Hi @MarcoGorelli ,

over at pymc-devs/pymc-examples#264 I'm running into an encoding issue with this pre-commit step.

Would it help if you specify an encoding for opening the files?

Here's the file that triggered it:
sampler-stats.zip

INFO:scripts/rerun.py:Running pre-commit on examples\diagnostics_and_criticism\sampler-stats.ipynb
black-jupyter..................................................................................Failed
- hook id: black-jupyter
- files were modified by this hook

reformatted examples\diagnostics_and_criticism\sampler-stats.ipynb
All done! \u2728 \U0001f370 \u2728
1 file reformatted.

nbqa-isort.....................................................................................Passed
nbqa-pyupgrade.................................................................................Passed
check-execution-order..........................................................................Failed
- hook id: check-execution-order
- exit code: 1

Traceback (most recent call last):
  File "c:\users\zufal\miniconda3\envs\pm3v4\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\zufal\miniconda3\envs\pm3v4\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\zufal\.cache\pre-commit\repodgyo1nz1\py_env-default\Scripts\check-execution-order.EXE\__main__.py", line 7, in <module>
  File "C:\Users\zufal\.cache\pre-commit\repodgyo1nz1\py_env-default\lib\site-packages\check_execution_order.py", line 44, in main
    content = json.load(fd)
  File "c:\users\zufal\miniconda3\envs\pm3v4\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "c:\users\zufal\miniconda3\envs\pm3v4\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 39467: character maps to <undefined>

Check notebooks have watermark (see Jupyter style guide from PyMC3 Wiki).......................Passed
Check all notebooks appear in table of contents................................................Passed
Add PyMC3 classes used to tags.................................................................Passed
@MarcoGorelli
Copy link
Owner

Yup, will do so today, thanks a ton for the report!

@MarcoGorelli
Copy link
Owner

@michaelosthege @OriolAbril have fixed and moved this over to https://github.com/MarcoGorelli/madforhooks , if you use that repo version 0.3.0 then this, and as well as Oriol's --strict option, should be available

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

No branches or pull requests

2 participants