Skip to content
This repository was archived by the owner on Jun 10, 2021. It is now read-only.
This repository was archived by the owner on Jun 10, 2021. It is now read-only.

Report filename with invalid encoding #112

@ezyang

Description

@ezyang

I'm trying to run codemod on my codebase and it is choking with:

Traceback (most recent call last):
  File "/home/ezyang/local/pytorch-tmp-env/bin/codemod", line 8, in <module>
    sys.exit(main())
  File "/home/ezyang/local/pytorch-tmp-env/lib/python3.7/site-packages/codemod/base.py", line 1025, in main
    run_interactive(**options)
  File "/home/ezyang/local/pytorch-tmp-env/lib/python3.7/site-packages/codemod/base.py", line 167, in run_interactive
    for patch in suggestions:
  File "/home/ezyang/local/pytorch-tmp-env/lib/python3.7/site-packages/codemod/base.py", line 442, in generate_patches
    lines = list(open(path))
  File "/home/ezyang/local/pytorch-tmp-env/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 16: invalid continuation byt

It would be very nice if it told me what file had the bad encoding!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions