with-input-from-string incorrectly signals closed-stream-error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Below is a test script that, I think:
- Behaves "correctly" on SBCL 1.0.46 and current CCL
- Behave strangely on SBCL 1.1.14, perhaps a bug.
Thanks!
$ cat tmp.lsp # here is the test script
(defun read-string-fn (str)
(handler-case
(let ((acc nil))
(stream str)
(loop do
(setq acc (nreverse acc))
(values :OK acc))
(error (condition)
;; Test: try to read #\wtf, which of course is silly and should cause an
;; error. But, I think, the error handler above should catch this error.
(read-string-fn "#\wtf")
$ sbcl-1.0.46 < tmp.lsp # works as expected, the error is caught
This is SBCL 1.0.46, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
*
READ-STRING-FN
*
:ERROR
"SB-
no dispatch function defined for #\\W"
*
$ ccl < tmp.lsp # works as expected, the error is caught
Welcome to Clozure Common Lisp Version 1.10-dev-
? READ-STRING-FN
? :ERROR
"Reader error on #<STRING-
Undefined character #\\W in a #\\# dispatch macro."
?
$ sbcl-1.1.14 < tmp.lsp # bug? causes and does not catch a stream closing error
This is SBCL 1.1.14, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
*
READ-STRING-FN
*
debugger invoked on a SB-INT:
#<THREAD "main thread" RUNNING {1002AA3B73}>:
#<
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-
0: [ABORT] Exit debugger, returning to top level.
(SB-
You are using 1.1.14, which was released last year. There's no such problem anymore. Please, test your bug on the current release (or preferably on the current git head) before reporting it.