"Internal Server Error" when page name has non-ASCII symbols
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zim |
New
|
Undecided
|
Unassigned |
Bug Description
When run Zim Web server, the pages non-pure-ASCII symbols lead to "Internal Server Error" displayed in browser.
Version of zim: 0.66 and above (I have tried 0.66 and 0.67-rc2).
With version 0.65 this error did not happen.
How to reproduce:
create sub-page with name "Français" (note the "c with cedilla"), run server, click the page.
The relevant messages from zim -D:
ERROR: Unexpected error:
Traceback (most recent call last):
File "/home/
path = self.notebook.
File "/home/
source, href, ignore_
File "/home/
return self.resolve_
File "/home/
page_id, pagename, branch = self._resolve_
File "/home/
(page_id, "%:"+basename)
ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.
127.0.0.1 - - [19/Jun/2017 17:17:16] "GET /Home/Fran%
Python:
DEBUG: Python version is sys.version_
DEBUG: Platform is posix
Linux:
$uname -a
Linux venus 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux
$ lsb_release -d
Description: BunsenLabs GNU/Linux 8.7 (Hydrogen)
Also, if the notebook name itself contains a non-ascii character, every page apart from root gives an Internal Server Error. In that case, however, the error message is different. Here log from trying to open page "Page with only ascii characters in the name" in notebook "ääkköset web server" using the embedded web server:
[otto@ottovain Muiden]$ zim --server --port 8086 ~/Ohjelmistopro jektit/ Testit/ Zim/ääkköset\ web\ server/ zim/templates/ html/Default. html python2. 7/site- packages/ zim/www. py", line 230, in __call__ page(page) python2. 7/site- packages/ zim/www. py", line 295, in render_page self.notebook. pages.get_ previous( page) if not page.isroot else None, python2. 7/site- packages/ zim/notebook/ index/pages. py", line 562, in get_previous only_ascii_ characters_ in_the_ name only_ascii_ characters_ in_the_ name.html HTTP/1.1" 500 21
INFO: This is zim 0.67-rc2
INFO: Loading template from: /usr/share/
INFO: No VCS detected
INFO: Serving HTTP on ottovain port 8086...
127.0.0.1 - - [19/Jul/2017 08:38:22] "GET / HTTP/1.1" 200 7032
127.0.0.1 - - [19/Jul/2017 08:38:22] "GET /favicon.ico HTTP/1.1" 200 1150
ERROR: Unexpected error:
Traceback (most recent call last):
File "/usr/lib/
content = self.render_
File "/usr/lib/
prevpage=
File "/usr/lib/
raise IndexNotFoundError, 'No such page: %s' % path
IndexNotFoundError: No such page: Page_with_
127.0.0.1 - - [19/Jul/2017 08:38:23] "GET /Page_with_
127.0.0.1 - - [19/Jul/2017 08:38:23] "GET /favicon.ico HTTP/1.1" 200 1150