massedit icon indicating copy to clipboard operation
massedit copied to clipboard

Can't read iso-8859-5 encoded files

Open goodboy opened this issue 9 years ago • 7 comments

Not that you should support it; just thought I'd report it.

>>> massedit -e "line" -m 99 nonascii.py                                                   
Traceback (most recent call last):
  File "/usr/bin/massedit", line 9, in <module>
    load_entry_point('massedit', 'console_scripts', 'massedit')()
  File "/home/tyler/repos/massedit/massedit.py", line 475, in main
    command_line(sys.argv)
  File "/home/tyler/repos/massedit/massedit.py", line 462, in command_line
    output=arguments.output)
  File "/home/tyler/repos/massedit/massedit.py", line 440, in edit_files
    diffs = list(editor.edit_file(path))
  File "/home/tyler/repos/massedit/massedit.py", line 168, in edit_file
    from_lines = from_file.readlines()
  File "/usr/lib/python2.7/codecs.py", line 314, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb1 in position 81: invalid start byte

Where the offending file is nonascii.py from the IPython project.

goodboy avatar May 02 '16 21:05 goodboy

Hey tgoodlet, thanks for the example. Kind of struggling with my tests and the unicode transition between 2.7 and 3.3. I've found http://python3porting.com/ but I need to find the time to focus on it a little.

I'll get there eventually...

elmotec avatar May 17 '16 03:05 elmotec

Hey @tgoodlet, the release v0.68.1 should fix this issue. Let me know if it does not.

elmotec avatar Jun 05 '16 00:06 elmotec

Fixed by d8330735aa454b117bfa12d83524f456364883f9

elmotec avatar Sep 20 '17 22:09 elmotec

Hey @elmotec I'm still seeing this issue (sorry it's been a while - haven't needed massedit for a bit). An example would be a utf-8 encoded tags file generated from the VIM editor. If you need an example I can probably whip another one up.

goodboy avatar Oct 16 '17 19:10 goodboy

Mmmmmh. Yeah @tgoodlet, I could use another test case. The one I had was fixed with 0.68.1.

elmotec avatar Oct 25 '17 02:10 elmotec

Sorry @goodboy, it's been 2 years. I just realized I pinged the wrong person. If you can provide an example, I could take a look.

elmotec avatar Dec 03 '19 02:12 elmotec

Without a test case it's difficult to make sure the issue is resolved. If you could provide an example, that would give us a change to resolve the issue.

elmotec avatar Dec 23 '20 01:12 elmotec