Details
-
Type:
Defect
-
Status:
In Progress
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Approval:Test
Description
Reproduce the bug with:
(require 'clojure.contrib.io) (clojure.contrib.io/append-writer "/xyz.txt") </code></pre> which will throw an Exception ���Cannot change an open stream to append mode���. This is caused because of a flaw in the call chain. *clojure.contrib.io/writer* for Strings calls again *writer* for whatever *clojure.contrib.io/output-stream* returns. We call *append-writer* which then calls *writer* on the String which in turn then calls: <pre><code> output-stream for ^String which calls output-stream for ^URL which calls output-stream for ^File which binds *append* to false and calls output-stream for ^OutputStream which returns a BufferedOutputStream instance which then jumps back to the ^File handler, which removes its binding for *append*!! and returns the BOS to the ^URL handler which returns the BOS to the ^String handler
At this point the outer binding (for append) is set to true again, and assert-not-appending fails.
Converted from http://www.assembla.com/spaces/clojure/tickets/90
Attachments:
0002-t90-default-reader-implementation-special-cases-for-.patch - https://www.assembla.com/spaces/clojure/documents/auuXEWSiur35DyeJe5cbCb/download/auuXEWSiur35DyeJe5cbCb
0001-t90-regression-test.patch - https://www.assembla.com/spaces/clojure/documents/amTyVwSt8r378NeJe5cbLr/download/amTyVwSt8r378NeJe5cbLr