[Issue 17358] [REG 2.074.0] std.stdio.File.lockingTextWriter.put no longer accepts chains of characters
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Apr 30 13:27:52 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17358
Steven Schveighoffer <schveiguy at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schveiguy at yahoo.com
--- Comment #4 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Yes, the bug that the PR fixed was to prevent lockingTextWriter.put from taking
an arbitrary byte, ubyte, short, ushort, int, or uint range and integer
promoting the elements to dchar. It was decided to allow ubyte[] specifically
(and write it directly as an array of ubytes), because of the inability to use
byChunk and lockingBinaryWriter to achieve a direct copy of a file.
IMO, the whole system is really messed up. It doesn't make sense to accept a
range of arbitrary bytes to a text writer, but lockingBinaryWriter changes the
stream from a text to binary (Which means something for Windows newlines).
I'm not sure of a "correct" way to fix this regression (which really is
erroneous behavior which happened not to blow up). If the identified CommonType
bug is fixed, we still are dealing with integer promoting chars to dchars
inside chain, which isn't right either.
--
More information about the Digitalmars-d-bugs
mailing list