|
2018-06-18
| ||
| 15:54 | Fix [53cad613d8]: TIP 389 implementation makes Tk tests font-4.12 and font-4.15 fail. One more situa... check-in: c45de6cdb4 user: jan.nijtmans tags: core-8-6-branch | |
| 10:58 | • Ticket [53cad613d8] TIP 389 implementation makes Tk tests font-4.12 and font-4.1... artifact: fcc9e74792 user: jan.nijtmans | |
|
2018-06-17
| ||
| 20:48 | • Ticket [53cad613d8]: 5 changes artifact: 577b1bfd85 user: fvogel | |
| 16:16 | • Closed ticket [53cad613d8]. artifact: 42e70e58a4 user: jan.nijtmans | |
| 16:07 | Fix [53cad613d8a4de166e680f09a6c6399ebddbc17c|53cad613d8]: TIP 389 implementation makes Tk tests fon... check-in: 8702869d89 user: jan.nijtmans tags: core-8-6-branch | |
|
2018-06-16
| ||
| 13:31 | • Ticket [53cad613d8] TIP 389 implementation makes Tk tests font-4.12 and font-4.1... artifact: 5d39e1f479 user: jan.nijtmans | |
| 06:08 | • Ticket [53cad613d8]: 3 changes artifact: e69e7096f8 user: fvogel | |
| 06:05 | • Ticket [53cad613d8]: 3 changes artifact: 1bcd062e32 user: fvogel | |
| 06:05 | • New ticket [53cad613d8]. artifact: c0c0e30201 user: fvogel | |
TIP 389 implementation makes Tk tests font-4.12 and font-4.15 fail
Closed / Fixed53cad613d8a4de166e680f09a6c6399ebddbc17cCreated 8 years agoUpdated 8 years ago
Descriptionwiki2018-06-16 06:05:38
Since TIP 389 was committed in core-8-branch, that is since [e109760b1c], two tests from the Tk test suite started failing as follows:
==== font-4.12 font command: actual FAILED
==== Contents of test case:
font actual {-family times} -- \ud800
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: expected a single character but got ""
while executing
"font actual {-family times} -- \ud800"
("uplevel" body line 2)
invoked from within
"uplevel 1 $script"
---- errorCode: TK VALUE FONT_SAMPLE
==== font-4.12 FAILED
==== font-4.15 font command: actual FAILED
==== Contents of test case:
font actual {-family times} -- \udc00\ud800
---- Test completed normally; Return code was: 0
---- Return code should have been one of: 1
==== font-4.15 FAILED
Both behaviors can be reproduced easily outside of the Tk test suite:
% package require Tk
8.7a2
% font actual {-family times} -- \ud800 ; # font-4.12
expected a single character but got ""
% font actual {-family times} -- \udc00\ud800 ; # font-4.15
-family times -size 12 -weight normal -slant roman -underline 0 -overstrike 0
%
Note that in contrast font-4.13 and font-4.14 do not fail, despite being very similar:
% font actual {-family times} -- \udc00 ; # font-4.13
-family times -size 12 -weight normal -slant roman -underline 0 -overstrike 0
% font actual {-family times} -family -- \ud800\udc00 ; # font-4.14
times
I'm unsure whether implementation of TIP 389 has a bug, or if Tk should be changed to match TIP 389, but I'm inclined to suspect the former because the TIP states:
As long as no Surrogates or characters >= U+010000 are used, all functions behave exactly the same as before.
Referenced by2
c45de6cdb4Fix [53cad613d8]: TIP 389 implementation makes Tk tests font-4.12 and font-4.15 fail. One more situation in which high surrogate causes problem check-in2018-06-18 15:54:388702869d89Fix [53cad613d8a4de166e680f09a6c6399ebddbc17c|53cad613d8]: TIP 389 implementation makes Tk tests font-4.12 and font-4.15 fail. (Fix it in 8.6 too, for benefit of androwish) check-in2018-06-17 16:07:09
fvogel Ticket [53cad613d8]: 3 changes
[History diff]2018-06-16 06:05:50
fvogel Ticket [53cad613d8]: 3 changes
[History diff]2018-06-16 06:08:12
jan.nijtmansplain2018-06-16 13:31:54
Thanks, François, for noticing this! I'll have a look. Actually, Tk was already adapted here to match TIP-389, but after that some changes in surrogate handling were added to the Tcl implementation (to make it more robust). The \ud800 character is a high surrogate, which is not expected in isolation, that's what this test is testing for. I'm suspecting the compatibility function TkUtfToUniChar(), but I'll have a further look. It's not really a problem, since such a surrogate in isolation is invalid anyway. But at least Tk should react sensibly to it. Thanks!
jan.nijtmansplain2018-06-17 16:16:37
The actual bug turned out to be in the function TclParseBackslash(). Fixed now in core-8-6-branch (for the benefit of androwish), core-8-branch and trunk. Thanks for your patience .... ;-)
fvogelplain2018-06-17 20:48:51
Confirmed it works for me as well. Many thanks, that was quick fixing!
jan.nijtmansplain2018-06-18 10:58:20
Still, this bug is not 100% fixed yet, there are multiple ways for generating a UTF-8 representation, backslash handling is not the only one: Demonstration: % string length [format %c 0xd800] 0 The correct answer should be 1. Stay tuned .... fix in progress.
Log in (anonymous is fine) to add a comment.