Le 18 novembre 2009 17:24, Michael Droettboom <md...@stsci.edu> a écrit :
>
> This is a bug -- but it has a fairly straightforward fix: to use Sphinx's
> "include" directive rather than roll our own as we currently do. This has
> been fixed in SVN r7972. plot-directive now takes an "encoding" option,
> exactly like the Sphinx include directive. It does not do automatic
> encoding detection (meaning it ignores the "# coding: latin1" comments),
> just as the Sphinx include directive does.
>
Hello Michael,
thank you for your fast reply and action. I just tried with the version from
trunk (r7978) and I still have an encoding problem on the same test case. It
seems to happen when the file is ran (to produce the figure) rather. I do
not understand what is happenning, I would have expected imp to proprely
guess the encoding.
Could you tell me if you have the same problem ? Do you have any idea of
what is going on ?
Thanks !
$ git clone git://github.com/sbarthelemy/SphinxEncoding.git
$ cd SphinxEncoding/
$ make html
sphinx-build -b html -d _build/doctrees . _build/html
Making output directory...
Running Sphinx v0.6.2
loading pickled environment... not found
building [html]: targets for 1 source files that are out of date
updating environment: 1 added, 0 changed, 0 removed
/home/barthelemy/.local/lib/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273:
UserWarning: Exception running plot ./fileutf8.py
Traceback (most recent call last):
File
"/home/barthelemy/.local/lib/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py",
line 270, in render_figures
run_code(plot_path, function_name, plot_code)
File
"/home/barthelemy/.local/lib/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py",
line 182, in run_code
"__plot__", fd, fname, ('py', 'r', imp.PY_SOURCE))
File "fileutf8.py", line 2, in <module>
print(u"accent aigus é")
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position
13: ordinal not in range(128)
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users