From: Harald Hanche-O. <ha...@ma...> - 2010-12-27 16:45:30
|
DIRECTORY doesn't seem to like filenames that aren't ASCII. (I got burned by this when ASDF stopped working after my home directory acquired such a file.) Digging partway down toward the bug, I put a file named "bær" in /tmp/, and can see the following happen: ; sbcl --version SBCL 1.0.45.4 ; sbcl --noinform --no-userinit * (sb-impl::map-directory (lambda (fn) (format t "~&~s" fn)) "/tmp/") #P"/tmp/.font-unix/" #P"/tmp/.ICE-unix/" #P"/tmp/.X0-lock" #P"/tmp/.X11-unix/" debugger invoked on a SB-INT:C-STRING-DECODING-ERROR: c-string decoding error (:external-format :ASCII): the octet sequence 1 cannot be decoded. Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level. (SB-INT:C-STRING-DECODING-ERROR :ASCII 1) 0] back 0: (SB-INT:C-STRING-DECODING-ERROR :ASCII 1) 1: (SB-IMPL::READ-FROM-C-STRING/ASCII #.(SB-SYS:INT-SAP #X048004D5) CHARACTER) 2: ((FLET SB-IMPL::ONE-ITER)) 3: ((FLET SB-IMPL::ITERATE) #<CLOSURE (FLET SB-IMPL::ONE-ITER) {39FF6B9}>) 4: (SB-IMPL::CALL-WITH-NATIVE-DIRECTORY-ITERATOR #<CLOSURE (FLET SB-IMPL::ITERATE) {39FF799}> "/private/tmp/" T) 5: (SB-IMPL::MAP-DIRECTORY #<FUNCTION (LAMBDA #) {1002B68229}> "/tmp/" :FILES T :DIRECTORIES T :CLASSIFY-SYMLINKS NIL :ERRORP T) 6: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SB-IMPL::MAP-DIRECTORY (LAMBDA (FN) (FORMAT T "~&~s" FN)) "/tmp/") #<NULL-LEXENV>) 7: (INTERACTIVE-EVAL (SB-IMPL::MAP-DIRECTORY (LAMBDA (FN) (FORMAT T "~&~s" FN)) "/tmp/") :EVAL NIL) 8: (SB-IMPL::REPL-FUN NIL) 9: ((LAMBDA ())) 10: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (LAMBDA #) {1002B1D629}>) 11: (SB-IMPL::TOPLEVEL-REPL NIL) 12: (SB-IMPL::TOPLEVEL-INIT) 13: ((LABELS SB-IMPL::RESTART-LISP)) 0] What to do about it? Other than the obvious "don't do that"? - Harald |
From: Juho S. <js...@ik...> - 2010-12-31 00:42:05
|
On Mon, Dec 27, 2010 at 5:45 PM, Harald Hanche-Olsen <ha...@ma...>wrote: > DIRECTORY doesn't seem to like filenames that aren't ASCII. > It won't like names that aren't valid in the default external format. I'm not too familiar with how the locale configuration works on OS X, but setting LC_CTYPE to some appropriate value (e.g. en_US.UTF-8) will probably help. -- Juho Snellman |
From: Harald Hanche-O. <ha...@ma...> - 2010-12-31 09:14:34
|
[Juho Snellman <js...@ik...> (2010-12-31 00:41:58 UTC)] > On Mon, Dec 27, 2010 at 5:45 PM, Harald Hanche-Olsen <ha...@ma...>wrote: > > > DIRECTORY doesn't seem to like filenames that aren't ASCII. > > > > It won't like names that aren't valid in the default external format. I'm > not too familiar with how the locale configuration works on OS X, but > setting LC_CTYPE to some appropriate value (e.g. en_US.UTF-8) will probably > help. Okay, that worked. Thanks! I had naïvely thought that setting sb-impl::*default-external-format* would be sufficient, but apparently that variable is not consulted when filenames are decoded. Incidentally, I discovered that although I had set LC_CTYPE in my environment, I had managed to botch it. Argh. Anyhow, a happy new year to all sbcl developers and users alike. Cheers! - Harald |
From: DS <sb...@so...> - 2010-12-31 01:30:12
|
On 27 Dec 2010, at 17:45, Harald Hanche-Olsen wrote: > DIRECTORY doesn't seem to like filenames that aren't ASCII. Works for me (Mac OS X 10.6.5, LANG=en_GB.UTF-8, SBCL 1.0.45 compiled from sources). Maybe there's a problem with your local configuration. -DS |