Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

emacs: Fatal malloc_jumpstart() error

Emacs fails with the error Fatal malloc_jumpstart() error

Black Magic

In a Terminal window type

 $ sudo mv /usr/bin/emacs-i386 /usr/bin/emacs-i386.backup $ sudo /usr/libexec/dumpemacs -d $ emacs --version GNU Emacs 22.1.1 ... 
(Here, $ is the shell prompt.)

Once youve checked all is OK you can remove the backup

$ sudo rm /usr/bin/emacs-i386.backup

Python and UTF-8 on OSX: UnicodeEncodeError

an acute problem

UnicodeEncodeError:
'ascii' codec can't encode character u'\xe9'

I'm on a Mac Air with the latest Snow Leopard (10.6.2). I'm using Python 2.6.4 with unicode strings. I can't print appliqué !?

I tried adding
# -*- coding: utf-8 -*-
at the head of my Python script, but I still get this complaint.

Solution

The encoding used for standard input, output, and standard error can be specified by setting the PYTHONIOENCODING environment variable before running the interpreter.

The value should be a string in the form <encoding> or <encoding>:<errorhandler>. The encoding part specifies the encoding’s name, e.g. utf-8 or latin-1; the optional errorhandler part specifies what to do with characters that can’t be handled by the encoding, and should be one of “error”, “ignore”, or “replace”.

export PYTHONIOENCODING=utf-8

does the trick.

– or you could just add this setting to your environment file: ~/.MacOSX/environment.plist