Character input streams not recognized as such
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When I try to write a string (using either `write', `prin1', or `print') to an empty existing text file open with `open', it errors out that the stream is not a character one (full backtrace from SLY in the attachment):
#<SB-SYS:FD-STREAM for "file /home/aartaka/
[Condition of type SIMPLE-TYPE-ERROR]
The error happens both in SLY REPL in Emacs and in barebones SBCL in the shell.
The test case for it is (change the name of the file and location to e.g. /tmp/empty.lisp if necessary):
(with-open-file (s #p"~/junkyard/
(print '(hello) s))
sbcl --version reports "SBCL 2.2.6". I've tried rebuilding from source on version 2.2.8.130-
uname -a reports "Linux paranoidal 5.18.10 #1 SMP PREEMPT_DYNAMIC 1 x86_64 GNU/Linux"
*features* are:
(:QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
:NON-BASE-
:COMMON-LISP :ELF :IEEE-FLOATING-
:PACKAGE-
:SB-THREAD :SB-UNICODE :SBCL :UNIX)
Might be related to bug #1956878, but I've decided to report separately just in case it's not.
It's not lying, it's an input stream. Add :direction :output. (Alternatively, :io)