From ml at mherrn.de Tue Dec 1 03:18:52 2015 From: ml at mherrn.de (ml at mherrn.de) Date: Tue, 1 Dec 2015 09:18:52 +0100 Subject: [Moin-user] Problem with encoding URLS In-Reply-To: <201511301649.39859.paul@boddie.org.uk> References: <52ad129bda00f44dcd2f20c40f353a59.squirrel@mail.sout.de> <201511301649.39859.paul@boddie.org.uk> Message-ID: <20151201081852.GA2687@fujian> Hi Paul, thanks for your help. > > When trying to access this page the apache log tells me: > > > > -----/----- > > mod_wsgi (pid=31988): Exception occurred processing WSGI script > > '/home/user/www/moin/moin.wsgi'. > > Traceback (most recent call last): > > File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 567, in > > __call__ > > cleaned_path = cleaned_path.encode(sys.getfilesystemencoding()) > > UnicodeEncodeError: 'ascii' codec can't encode character u'\\xf6' in > > position 2: ordinal not in range(128) > > -----/----- > > > > What is going on here? Do I have a misconfiguration in moinmoin? Why is it > > trying to encode it in ASCII? > > Here, I imagine that your locale setting isn't helping. What do you get at the > Python prompt if you call sys.getfilesystemencoding() ? As the user I running the moin instance, I get: 'UTF-8' > > You may need to look at your system's default locale and/or the user's locale, > I guess. The users locale is: LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES=POSIX LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= So that should all be well. I have now done some tests and wrote a minimal WSGI script to print out some variables: ----/---- import locale import getpass import os def application(environ, start_response): status = '200 OK' output = "" output += "User: "+getpass.getuser()+"\n" output += "defaultlocale: "+str(locale.getdefaultlocale())+"\n" output += "prefencoding: "+locale.getpreferredencoding()+"\n" output += "LANG: "+os.getenv('LANG')+"\n" output += "LC_ALL: "+str(os.getenv('LC_ALL'))+"\n" output += "LC_CTYPE: "+str(os.getenv('LC_CTYPE'))+"\n" output += "LC_MESSAGES: "+str(os.getenv('LC_MESSAGES'))+"\n" response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] ----/---- And the output is: ----/---- User: moinuser defaultlocale: (None, None) prefencoding: ANSI_X3.4-1968 LANG: C LC_ALL: None LC_CTYPE: None LC_MESSAGES: None ----/---- When running these lines on the console I get: ----/---- User: moinuser defaultlocale: ('en_US', 'UTF-8') prefencoding: UTF-8 LANG: en_US.UTF-8 LC_ALL: None LC_CTYPE: None LC_MESSAGES: POSIX ----/---- So obviously the locale settings are gone. I have googled around a bit and it seems that I have to explicitly set the locale settings to WSGIDaemonProcess: ----/---- WSGIDaemonProcess moin user=moinuser group=moinuser processes=5 threads=10 maximum-requests=1000 umask=0007 lang='de_DE.UTF-8' locale='de_DE.UTF-8' ----/---- and everything is well then! > I see someone else has experienced this recently, too: > > https://moinmo.in/MoinMoinBugs/1.9.8NonAsciiURL-UnicodeEncodeError I have added my solution to the Discussion paragraph on that page. Thanks for your help! From paul at boddie.org.uk Tue Dec 1 06:57:32 2015 From: paul at boddie.org.uk (Paul Boddie) Date: Tue, 1 Dec 2015 12:57:32 +0100 Subject: [Moin-user] Problem with encoding URLS In-Reply-To: <20151201081852.GA2687@fujian> References: <52ad129bda00f44dcd2f20c40f353a59.squirrel@mail.sout.de> <201511301649.39859.paul@boddie.org.uk> <20151201081852.GA2687@fujian> Message-ID: <201512011257.32909.paul@boddie.org.uk> On Tuesday 1. December 2015 09.18.52 ml at mherrn.de wrote: > Hi Paul, > > thanks for your help. Well, thanks for doing all the hard work investigating the problem! ;-) [...] > > Here, I imagine that your locale setting isn't helping. What do you get > > at the Python prompt if you call sys.getfilesystemencoding() ? > > As the user I running the moin instance, I get: > 'UTF-8' > > > You may need to look at your system's default locale and/or the user's > > locale, I guess. > > The users locale is: > > LANG=en_US.UTF-8 Yes, these two things look consistent. [...] > So that should all be well. > I have now done some tests and wrote a minimal WSGI script to print out > some variables: If only everyone reporting problems was as thorough. :-) [...] > And the output is: > > ----/---- > User: moinuser > defaultlocale: (None, None) > prefencoding: ANSI_X3.4-1968 > LANG: C > LC_ALL: None > LC_CTYPE: None > LC_MESSAGES: None > ----/---- > > When running these lines on the console I get: > > ----/---- > User: moinuser > defaultlocale: ('en_US', 'UTF-8') > prefencoding: UTF-8 > LANG: en_US.UTF-8 > LC_ALL: None > LC_CTYPE: None > LC_MESSAGES: POSIX > ----/---- > > > So obviously the locale settings are gone. > > I have googled around a bit and it seems that I have to explicitly set > the locale settings to WSGIDaemonProcess: > > ----/---- > WSGIDaemonProcess moin user=moinuser group=moinuser processes=5 threads=10 > maximum-requests=1000 umask=0007 lang='de_DE.UTF-8' locale='de_DE.UTF-8' > ----/---- > > and everything is well then! Here, I almost feel as if I should have asked about CGI or WSGI or whatever. This does actually sound familiar now, but I'll admit that I use CGI more often than not. > > I see someone else has experienced this recently, too: > > > > https://moinmo.in/MoinMoinBugs/1.9.8NonAsciiURL-UnicodeEncodeError > > I have added my solution to the Discussion paragraph on that page. > > Thanks for your help! No problem! You helped yourself, really. Thanks for contributing to the page, too! I'm sure the configuration instructions can be improved by someone with a bit more familiarity with mod_wsgi. Paul From service at metamodul.com Fri Dec 4 03:52:25 2015 From: service at metamodul.com (service at metamodul.com) Date: Fri, 4 Dec 2015 09:52:25 +0100 (CET) Subject: [Moin-user] https://moinmo.in/HelpOnVariables , Display variables in fixed font format Message-ID: <125168821.5222.67489fc8-a3b0-454d-a338-af07528016ef.open-xchange@email.1und1.de> Hi is it possible to display a variable in a fixed font like VAR1 = {{{ <> }}} tia Hajo -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Fri Dec 4 07:06:39 2015 From: paul at boddie.org.uk (Paul Boddie) Date: Fri, 4 Dec 2015 13:06:39 +0100 Subject: [Moin-user] https://moinmo.in/HelpOnVariables , Display variables in fixed font format In-Reply-To: <125168821.5222.67489fc8-a3b0-454d-a338-af07528016ef.open-xchange@email.1und1.de> References: <125168821.5222.67489fc8-a3b0-454d-a338-af07528016ef.open-xchange@email.1und1.de> Message-ID: <201512041306.40618.paul@boddie.org.uk> On Friday 4. December 2015 09.52.25 service at metamodul.com wrote: > Hi > is it possible to display a variable in a fixed font like > > VAR1 = {{{ <> }}} Have you tried it, and did it work? ;-) What about this...? VAR1 = ` <> ` It might be the case that the {{{ and }}} processing is different from the way backquotes are interpreted, in that the former may not permit a wide range of Moin syntax inside the braces. Used within a paragraph, however, the basic formatting of the text should be the same in both cases. Paul From service at metamodul.com Fri Dec 4 08:30:44 2015 From: service at metamodul.com (service at metamodul.com) Date: Fri, 4 Dec 2015 14:30:44 +0100 (CET) Subject: [Moin-user] https://moinmo.in/HelpOnVariables , Display variables in fixed font format In-Reply-To: <201512041306.40618.paul@boddie.org.uk> References: <125168821.5222.67489fc8-a3b0-454d-a338-af07528016ef.open-xchange@email.1und1.de> <201512041306.40618.paul@boddie.org.uk> Message-ID: <661497661.19541.67489fc8-a3b0-454d-a338-af07528016ef.open-xchange@email.1und1.de> Hi Paul, > > is it possible to display a variable in a fixed font like > > VAR1 = {{{ <> }}} > Have you tried it, and did it work? ;-) > VAR1 = ` <> ` It does not work - If i use {{{ ... }}} or ` ... ` i get <> in Fixed font but not the content of the VAR1 in fixed font. If i set the variable like VAR1:: {{{ My Value }}} or VAR1:: ` My Value ` i also do not get "My value" but <>. I checked just on https://moinmo.in/HelpOnFormatting and it says that Wiki markup is ignored for {{{...}}} and `...` So its looks like it is working as designed accept for parsing a variable ;-( Hajo -------------- next part -------------- An HTML attachment was scrubbed... URL: From service at metamodul.com Wed Dec 16 09:24:37 2015 From: service at metamodul.com (service at metamodul.com) Date: Wed, 16 Dec 2015 15:24:37 +0100 (CET) Subject: [Moin-user] Info - General Information ( from pages , has pages ) Message-ID: <1706467857.64681.399f40ef-d606-4d6e-9802-d6d3735a4e34.open-xchange@email.1und1.de> Hi, The "Info" link ( left of Attachments ) gives general information about a page. Example: /Customer/NetworkGuide ... This page links to the following pages: DHCP, NTP, ... What i would like to know: Is it possible to get the following information as well: ( Example) - This page import/has links FROM: GlobalNetworkGuide This page is IMPORTED/LINKED by the following pages: ListOfGuides Reason for the question: This way it would be easy to see the link tree/loop of different pages. for in the above example somebody could see, that the /Customer/NetworkGuide reads stuff from the GlobalNetworkGuide and is listed in the ListOfGuides. I think it would make it more to easy to maintain the wiki in cases where the information is not within a single page or its sub pages, tia Hajo -------------- next part -------------- An HTML attachment was scrubbed... URL: