X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/62e16c41f54d764cc08dd4aa305d242a98b86052..5f6ed2ebca66244de0e4aa489df92013d74e3abe:/doc/bugs/crashes_in_the_python_proxy_even_if_disabled.mdwn diff --git a/doc/bugs/crashes_in_the_python_proxy_even_if_disabled.mdwn b/doc/bugs/crashes_in_the_python_proxy_even_if_disabled.mdwn index 3d57aa8e7..bbaa53658 100644 --- a/doc/bugs/crashes_in_the_python_proxy_even_if_disabled.mdwn +++ b/doc/bugs/crashes_in_the_python_proxy_even_if_disabled.mdwn @@ -1,3 +1,5 @@ +[[!template id=gitbranch branch=anarcat/dev/proxy-utf8-fail author="[[anarcat]]"]] + ikiwiki 3.20130904.1~bpo70+1 rebuilding the whole wiki: @@ -39,3 +41,27 @@ error: ikiwiki failed """]] \xe9 is "é" in latin1, it may be the last letter of my name. no clue how it got there. suspecting this is related to the fix in [[bugs/proxy.py_utf8_troubles]], since this was not happening before the upgrade from squeeze. --[[anarcat]] + +> Ooops... turns out the plugin *was* enabled, through the `rst` plugin. After disabling it, the crash is gone, but one page isn't rendered anymore: +> +> removing art/histoireinternet/index.html, no longer built by art/histoireinternet.rst +> +> Here is that source file: http://anarc.at/art/histoireinternet.rst - and it seems encoded properly: +> +> $ curl -s http://anarc.at/art/histoireinternet.rst | iconv -f utf8 -t latin1 | iconv -f latin1 -t utf8 > /dev/null +> $ +> +> So I am not sure what is going on here... --[[anarcat]] + +>> Python is decoding what it receives from IkiWiki using the default `ascii` +>> codec. To match IkiWiki's "all source text is UTF-8" assumption, the +>> Python proxy should explicitly decode incoming text from bytes +>> (`str`) to `unicode` using the `utf8` codec instead. +>> +>> Python's conservative default is "`ascii`, regardless of locale" - +>> this minimizes the chance of silently incorrect decoding, but +>> unfortunately also maximizes the chance of crashing. --[[smcv]] + +> > > Right, I know that. The trick is to find the rabbit hole. :P +> > > +> > > And I found it. With my dev/proxy-utf8-fail, this doesn't fail anymore. Yay, a [[patch]] ready for commit! --[[anarcat]]