wanted: a reasonable way to control pathname external format

Bug #411501 reported by Tobias C. Rittweiler on 2009-08-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Replicated from http://thread.gmane.org/gmane.lisp.steel-bank.devel/13755

mkdir /tmp/foo/
cd /tmp/foo/
touch `printf "\x3f\xff\xb0"`

Then on SBCL

(directory (make-pathname :defaults #P"/tmp/foo/" :name :wild))

  c-string decoding error (:external-format :UTF-8):
    the octet sequence 4 cannot be decoded.
     [Condition of type SB-INT:C-STRING-DECODING-ERROR]

   0: [RETRY] Retry SLIME REPL evaluation request.
   1: [ABORT] Return to SLIME's top level.
   2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" RUNNING {AD8C7B9}>)

    5: (SB-IMPL::MAP-DIRECTORY #<CLOSURE (LAMBDA #) {B78FA05}> #P"/tmp/foo/")[:EXTERNAL]
    7: (DIRECTORY #P"/tmp/foo/*")[:EXTERNAL]

On an SBCL (1.0.11) before the changes on DIRECTORY the form simply returns NIL.

Tobias C. Rittweiler (tcr) wrote :

At the moment, this makes the ,load-system Slime-REPL shortcut fail
for me because that grovels the directories in ASDF:*CENTRAL-REGISTRY*,
including a directory that contains such a junk file name.

description: updated
tags: added: external-formats feature
summary: - DIRECTORY fails on directories which contain junk in file names
+ wanted: a reasonable way to control pathname external format
Changed in sbcl:
status: New → Confirmed
importance: Undecided → Medium
Nikodemus Siivola (nikodemus) wrote :

I hope the characterization new description doesn't mismatch the way you see this issue too badly.

  LANG=C sbcl

(or any other way to get eg. LATIN-1 as the default external format) is the current simple workaround, SB-IMPL::*DEFAULT-EXTERNAL-FORMAT* is the for-now-unsupported alternative.

For DIRECTORY I think adding an :EXTERNAL-FORMAT argument might be fine, but the issue extends to opening such files as well -- I'm not sure if there should be PATHNAME-EXTERNAL-FORMAT, or if a documented and supported *D-E-F* would be sufficient.

Changed in sbcl:
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers