LOAD on a directory at the REPL incurs nested error instead of a stream error

Bug #1077996 reported by Douglas Katzman on 2012-11-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

The file that I attempted to load was supposed to be "extensions/something.lisp" but I accidentally omitted the filename-

* (load "extensions")
debugger invoked on a SB-C::INPUT-ERROR-IN-COMPILE-FILE in thread
#<THREAD "main thread" RUNNING {10029F1543}>:
(A SB-INT:SIMPLE-STREAM-ERROR was caught when trying to print *DEBUG-CONDITION*
when entering the debugger. Printing was aborted and the
SB-INT:SIMPLE-STREAM-ERROR was stored in SB-DEBUG::*NESTED-DEBUG-CONDITION*.)

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Abort loading file "/ita/src/trunk/QPX/lw/extensions".
  1: Exit debugger, returning to top level.

((LAMBDA () :IN SB-C:COMPILER-ERROR))

So here's the error that was saved-
0] (apply #'format nil (simple-condition-format-control SB-DEBUG::*NESTED-DEBUG-CONDITION*) (simple-condition-format-arguments SB-DEBUG::*NESTED-DEBUG-CONDITION*))

"couldn't read from #<SB-SYS:FD-STREAM
                     for \"file /ita/src/trunk/QPX/lw/extensions\" {1002D3F9B3}>:
  Is a directory"

Catching it is ok, but still seems like the wrong kind of error-

* (handler-case (load "extensions") (error (c) (format t "Got an error: ~A" c)))
Got an error:
debugger invoked on a SB-INT:CLOSED-STREAM-ERROR in thread
#<THREAD "main thread" RUNNING {10029F1543}>:
  #<SB-SYS:FD-STREAM for "file /ita/src/trunk/QPX/lw/extensions"
    {1002D96AD3}> is closed

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(SB-KERNEL:CLOSED-FLAME
 #<SB-SYS:FD-STREAM for "file /ita/src/trunk/QPX/lw/extensions" {1002D96AD3}>)

Ideally LOAD would give the same error as this-

* (read-line (open "extensions"))
debugger invoked on a SB-INT:SIMPLE-STREAM-ERROR in thread
#<THREAD "main thread" RUNNING {10029F1543}>:
  couldn't read from #<SB-SYS:FD-STREAM
                       for "file /ita/src/trunk/QPX/lw/extensions"
                       {1002DACEF3}>:
    Is a directory

using 1.1.0.46.HEAD.85-3468e0d

Paul Khuong (pvk) on 2013-07-22
Changed in sbcl:
status: New → Confirmed
importance: Undecided → Low
tags: added: easy
Stas Boukarev (stassats) on 2014-03-02
Changed in sbcl:
status: Confirmed → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers