8000 Latex not work because dvipng_hack_alpha does not work with dvipng that prints non ascii characters · Issue #4545 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Latex not work because dvipng_hack_alpha does not work with dvipng that prints non ascii characters #4545
Closed
@KalaShayminS

Description

@KalaShayminS

The matplotlib on my machines cannot work with LaTeX because of

  File "/export/opt/python/2.7.8/lib/python2.7/site-packages/matplotlib-1.4.2-py2.7-linux-x86_64.egg/matplotlib/texmanager.py", line 78, in dvipng_hack_alpha
    lines = stdout.decode('ascii').split('\n')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 43: ordinal not in range(128)

The code clip:

def dvipng_hack_alpha():
    try:
        p = Popen(['dvipng', '-version'], stdin=PIPE, stdout=PIPE,
                  stderr=STDOUT, close_fds=(sys.platform != 'win32'))
        stdout, stderr = p.communicate()
    except OSError:
        mpl.verbose.report('No dvipng was found', 'helpful')
        return False
    lines = stdout.decode('ascii').split('\n')

I think decode('ascii') code does not support non-ascii characters , while dvipng indeed prints one (the Author name) in some versions:

This is dvipng 1.5 Copyright 2002-2005 Jan-īe Larsson
dvipng 1.5
kpathsea version 3.5.4
Copyright (C) 2002-2005 Jan-īe Larsson.
There is NO warranty.  You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files
named COPYING and dvipng.c.

Metadata

Metadata

Assignees

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

    0