You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValveKeyValue.KeyValueException : Found end of file while trying to read token.
----> System.IO.EndOfStreamException : Attempted to read past the end of the stream.
Stack Trace:
KV1TextReader.ReadObject() line 50
KVSerializer.Deserialize(Stream stream, KVSerializerOptions options) line 44
EscapedQuoteNoEscapeTestCase.SetUp() line 21
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--EndOfStreamException
KV1TokenReader.Next() line 175
KV1TokenReader.ReadUntil(Char[] terminators) line 221
KV1TokenReader.ReadQuotedStringRaw() line 316
KV1TokenReader.ReadStringRaw() line 305
KV1TokenReader.ReadString() line 81
KV1TokenReader.ReadNextToken() line 64
KV1TextReader.ReadObject() line 42
\" causes it to trip up, it works with HasEscapeSequences: true. It's probably fine for this not to parse correctly, but I would at least expect the exception to be somewhat better than EOF
The text was updated successfully, but these errors were encountered:
It's likely due to the extra quote, which misaligns all the keys/values. The only real improvement I can think of is to improve the exception message (add line number, print last key), but it will end up printing the very last line, and not the actual one where the issue happened.
The best solution I can think of may be tricky but it would be to check this condition and flag the first string that contains a newline (or the one before it?) as suspicious
See https://github.com/ValveResourceFormat/ValveKeyValue/tree/eof-unescape-bug
This throws:
\"
causes it to trip up, it works withHasEscapeSequences: true
. It's probably fine for this not to parse correctly, but I would at least expect the exception to be somewhat better than EOFThe text was updated successfully, but these errors were encountered: