Failure in restart for OPEN on nonexistent file

Bug #1886587 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

(defun bug011 ()
  ;; Attempt to open a non-existent file
  (loop for i from 1
        do (let ((name (format nil "/tmp/foo~a" i)))
             (unless (probe-file name)
               ;; Attempt to open nonexistent file
               (return (open name :direction :input))))))

(bug011)

==>

Error opening #P"/tmp/foo1"
   [Condition of type SB-EXT:FILE-DOES-NOT-EXIST]

Restarts:
 0: [CREATE] Reopen with :if-does-not-exist :create
 1: [CONTINUE] Retry opening.
 2: [USE-VALUE] Try opening a different file.
 3: [RETRY] Retry SLIME REPL evaluation request.
 4: [*ABORT] Return to SLIME's top level.
 5: [ABORT] abort thread (#<THREAD "new-repl-thread" RUNNING {101742E6C3}>)

Backtrace:
  0: (SB-IMPL::FILE-PERROR #P"/tmp/foo1" 2 SB-EXT:FILE-DOES-NOT-EXIST :FORMAT-CONTROL "Error opening ~S" :FORMAT-ARGUMENTS (#P"/tmp/foo1"))
  1: (SB-IMPL::%OPEN-ERROR #P"/tmp/foo1" 2 :IGNORE-THIS-ARG :ERROR)
  2: (OPEN "/tmp/foo1" :DIRECTION :INPUT :ELEMENT-TYPE BASE-CHAR :IF-EXISTS NIL :IF-DOES-NOT-EXIST NIL :EXTERNAL-FORMAT :DEFAULT :CLASS SB-SYS:FD-STREAM)
  3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (BUG011) #<NULL-LEXENV>)
  4: (EVAL (BUG011))

Then: select restart 2:

Enter a form to be evaluated: "/dev/null"

==>

Error while parsing arguments to DESTRUCTURING-BIND:
  unknown keyword: :FILENAME; expected one of :RETURN, :NEW-FILENAME, :NEW-IF-EXISTS, :NEW-IF-DOES-NOT-EXIST
   [Condition of type SB-KERNEL::DEFMACRO-LAMBDA-LIST-BROKEN-KEY-LIST-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "new-repl-thread" RUNNING {101742E6C3}>)

Backtrace:
  0: (OPEN "/tmp/foo1" :DIRECTION :INPUT :ELEMENT-TYPE BASE-CHAR :IF-EXISTS NIL :IF-DOES-NOT-EXIST NIL :EXTERNAL-FORMAT :DEFAULT :CLASS SB-SYS:FD-STREAM)
  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (BUG011) #<NULL-LEXENV>)
  2: (EVAL (BUG011))
 --more--

Stas Boukarev (stassats)
Changed in sbcl:
status: New → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.