[Tutor] empty delimiters, and None
ugajin at talktalk.net
ugajin at talktalk.net
Sat Nov 30 13:04:46 CET 2013
Thanks for the helpful comments Eryksun/Steve
Mis-configured environment (see below)?
I rather felt that setting the 2nd parameter to None, was side stepping an underlying issue.
However I experimented further and find; locale.setlocale(locale.LC_ALL, 'en_GB') also works OK. Perhaps this is a better fix than locale.setlocale(locale.LC_ALL, None) but again it may be side stepping the underlying issue.
Here is link: https://answers.launchpad.net/inkscape/+question/239599. I think you need to register to access the both the question and Bug #803791 report. You may not want to do this.
I believe the system locale is set correctly:
Apples-iMac-4:~ apple$ locale
LANG="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_CTYPE="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_ALL=
The underlying problem appears to be with the application launcher script (see below).
To explain 'booted from Unix file' is difficult for me, especially if you are unfamiliar with OSX, It is a way of running the application together with a Terminal window.
Inkscape is an Open Source SVG editor with some 'proprietary' features that are not part of the SVG standard.
The Measure Path script, can calculate either the length of, or the area enclosed by a path.
The value is displayed as text, which is added and anchored to the path that is measured.
Variables include precision (no. of significant places) and unit type (px, mm & etc.), as well as offset & font size (for text output).
I did try contacting one of its authors, and I have raised the matter as a question, (see link above). The initial response was; "A workaround is to edit the launcher script (to force a valid UTF-8 language settings)." The fix provided (shown below) caused Inkscape to crash immediately after the launch routine completed:
Quit all running instances of Inkscape. Then
1) Select Inkscape (the application) in the Finder
2) Choose 'Show Package Contents' from the context menu
3) Browse to 'Contents > Resources > bin'
4) Open the file 'inkscape' in a plain-text editor (e.g. TextWrangler)
5) Scroll down to line 127
6) Insert a new line before line 127 with this content:
export LANG="en_US.UTF-8"
7) Save & close file (make sure that your text editor does _not_ add a
hidden suffix to the file, else the application won't launch anymore)
8) Relaunch Inkscape
If you prefer a different UI language, adjust the string "en_US.UTF-8"
as needed.
Lines 123 to 127 of the launcher script read:
# NOTE: Have to add ".UTF-8" to the LANG since omitting causes Inkscape
# to crash on startup in locale_from_utf8().
export LANG="`grep \"\`echo $LANGSTR\`_\" /usr/share/locale/locale.alias | \
tail -n1 | sed 's/\./ /' | awk '{print $2}'`.UTF-8"
echo "Setting Language: $LANG" 1>&2
I am told this 'fix' works for OSX v10.5.8 (Leopard) and OSX 10.7.5 (Lion). However, I run OSX v10.6.8 (Snow Leopard).
I am also interested in identifying the underlying issue, although I am far out of my comfort zone, and which seems to be with the launcher script. From the various postings and comments read, this seems to be something of an old chestnut. Maybe you can't suggest an alternative fix to the above, but maybe you can comment to help explain lines 123 - 127.
Many many thanks, once more.
-A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131130/035d9240/attachment.html>
More information about the Tutor
mailing list