GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — Fix Server text output splitting multi-byte characters across service responses by fdcastel · Pull Request #80 · FirebirdSQL/python3-driver Conversation
Member
Follow-up to #79. Problem
Trace output is where this shows up, because it carries the SQL text of statements. FixResponses are decoded through
Evidence (live, Firebird 5.0.4 on localhost, Windows)The probe uses the public API only:
The replacement characters always come in pairs. Each pair is one 2-byte character cut at a response boundary, for example Tests
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions… responses The service fills each text output response by size, not by character, so a response can end inside a multi-byte character. `_query_output()` decoded every response on its own with `read_sized_string()`, which turned both halves of such a character into U+FFFD with errors='replace', and raised UnicodeDecodeError with the default errors='strict'. Decode responses through an incremental decoder that keeps the bytes of an unfinished character until the next response. The decoder is reset with the rest of the output state in `_reset_output()`, and flushed at the end of output (and at the end of each LINE-mode line), so a character that never completes still goes to the error handler instead of being dropped.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |