|
2026-11-07
| ||
| 11:08 | • Closed ticket [75ecc0e6cb]: TclInitSubsystems issues: the sporadic lack of encod... artifact: 32e8d4c586 user: apnadkarni | |
| 11:05 | Fix [75ecc0] - non-zipfs builds with relocated library misses encodings check-in: 1bc3a58eac user: apnadkarni tags: trunk, main | |
|
2026-11-06
| ||
| 15:40 | • Ticket [75ecc0e6cb] TclInitSubsystems issues: the sporadic lack of encodings... artifact: c4744a30a5 user: apnadkarni | |
| 15:32 | Ticket [75ecc0e6cb] - non-zipfs builds with relocated library misses encodings closed check-in: e743ee1843 user: apnadkarni tags: apn-bug-75ecc0e6cb | |
|
2026-10-17
| ||
| 16:53 | • Ticket [75ecc0e6cb] TclInitSubsystems issues: the sporadic lack of encodings... artifact: 8e256e9b83 user: apnadkarni | |
| 07:30 | • Ticket [75ecc0e6cb]: 3 changes artifact: 49b02f7691 user: serhiy.storchaka | |
|
2026-10-16
| ||
| 22:41 | • Ticket [75ecc0e6cb]: 3 changes artifact: a8379bc004 user: dgp | |
| 20:52 | • Ticket [75ecc0e6cb]: 4 changes artifact: 7e873e51c1 user: serhiy.storchaka | |
| 20:52 | Fix [75ecc0e6cb]: add $tcl_library/encoding to the encoding search path again, lost when TIP 732 mov... closed check-in: cbc900f06b user: serhiy.storchaka tags: init-encoding-dirs | |
|
2022-11-22
| ||
| 19:44 | • Ticket [75ecc0e6cb] TclInitSubsystems issues: the sporadic lack of encodings... artifact: 03809c58a5 user: jan.nijtmans | |
| 19:43 | • Ticket [fccb9f322f] unixInit-3.2 fails when encodings dir is in zipfs status... artifact: b68674b256 user: jan.nijtmans | |
|
2018-05-31
| ||
| 14:15 | • Ticket [75ecc0e6cb] TclInitSubsystems issues: the sporadic lack of encodings... artifact: 021ac42b0d user: sebres | |
| 13:50 | • Ticket [75ecc0e6cb]: 4 changes artifact: 4e5e428adf user: sebres | |
| 13:42 | fix 2nd issue of [75ecc0e6cb9899bf]: win, implemented initial callback TclpGetObjNameOfExecutable (f... check-in: 3ff3390603 user: sebres tags: fix-initsubsystem-75ecc0e6cb9899bf | |
| 13:42 | fix 2nd issue of [75ecc0e6cb9899bf]: unix, retrieve correct search-path for library (fixes TclpInitL... check-in: a5c7eee15d user: sebres tags: fix-initsubsystem-75ecc0e6cb9899bf | |
| 13:41 | fix 1st issue of [75ecc0e6cb9899bf]: retrieve correct environment-depended encoding (avoid mistaken ... check-in: 5b6e4aeee0 user: sebres tags: fix-initsubsystem-75ecc0e6cb9899bf | |
|
2018-05-30
| ||
| 18:54 | • Ticket [75ecc0e6cb] TclInitSubsystems issues: the sporadic lack of encodings... artifact: 362596a403 user: sebres | |
| 18:54 | • Ticket [75ecc0e6cb]: 3 changes artifact: e7e3c1be72 user: sebres | |
| 18:53 | • New ticket [75ecc0e6cb]. artifact: 2be723385e user: sebres | |
| Ticket UUID: | 75ecc0e6cb9899bff0fa9e22a10a76b0c244c0a1 | ||
| Title: | TclInitSubsystems issues: the sporadic lack of encodings | ||
| Type: | Bug | Created on: | 2018-05-30 18:53:55 |
| Submitter: | sebres | Assigned to: | apnadkarni |
| Subsystem: | 38. Init - Library - Autoload | Severity: | Severe |
| Priority: | 5 Medium | Last modified: | 2026-11-07 11:08:42 |
| Status: | Closed | Closed by: | apnadkarni |
| Resolution: | Fixed | Closed on: | 2026-11-07 11:08:42 |
| Version: | 8.6.18, 9.1.0 | ||
| Description: | ||||
|
Set the system encoding via environment/locale failed sometimes dependent of the system constellation (distribution and/or some env-settings). Who saw already the test "unixInit-3.2" failed? :) This cumulates from two actual issues: 1. setlocale (called from TclpInitPlatform) may overwrite environment "LANG" (to "C"), so the try searching of current encoding later in Tcl_GetEncodingNameFromEnvironment will failback to "C" (so the call of "setlocale" takes place too early in some cases, resp. get initial environment via getenv("LANG") too late); 2. second thing which can happen, if 1st issue with "setlocale" gets repaired, would be the fact, that Tcl_GetEncodingSearchPath (called from TclpSetInitialEncodings/Tcl_SetSystemEncoding) may return "" before still any interpreter instance created (and it is so if TclpInitPlatform called). Following code can illustrate this behavior:
But setting of proper tcl_library env-variable resolves it:
I saw it already too often, but following cases are affected especially: - usage of portable-like (not installed) tcl's instance or tcl-ed applications (where TCL_LIBRARY environment variable does not set by start); - call of other tcl-instance from tcl-app via [open "| some-tcl-app"] inside the tcl-interpterer with changed environment (LC_... resp. LANG are changed); - call of tcl from development environment (also not istalled), like this:
I've localized the "wrong" places and will try to fix it soon. | ||||
| User Comments: | ||||
sebres added on 2018-05-31 13:50:42:
The branch "fix-initsubsystem-75ecc0e6cb9899bf" provides a fix for this ticket (for 8.6th). All tests passed on my reference systems (*nix as well as windows). sebres added on 2018-05-31 14:15:37:
BTW There is a new C-routine "TclpExtendWithRelativeLibraryPaths" now, which could be used later as replacement for some hard-coded script-parts of the tclInit (which belong to parents relative the path of "nameofexecutable"). I mean this scripts: jan.nijtmans added on 2022-11-22 19:44:35:
This came up again. See: [fccb9f322] serhiy.storchaka added on 2026-10-16 20:52:31:
The system-encoding part was fixed in 9.0 by [17c53b7edd]; 8.6 still shows it for an uninstalled or relocated tclsh. On main, TIP 732 dropped the [encoding dirs] addition from init.tcl, so a --disable-zipfs tclsh with a relocated library has no encoding directories at all (9.1.0). Proposed fix in branch init-encoding-dirs, test encoding-26.1. dgp added on 2026-10-16 22:41:00:
I thought one of the intents of TIP 732 was to simplify and reduce the search paths. Before growing them again, someone involved in TIP 732 should comment. serhiy.storchaka added on 2026-10-17 07:30:00:
It does not grow the search path, it restores what 9.0 does: init.tcl adds [file join $::tcl_library encoding] to [encoding dirs] if it is not there. TIP 732 ([83e88416ac]) moved that part of init.tcl to InitAutoPathObjCmd(), whose comment still says "The function also adds the encoding subdirectory of tcl_library to the encodings search path if not already present", but the code was not moved. So in 9.1 a tclsh without zipfs whose library is not at the compiled-in place has no encoding directories at all. @apnadkarni, was dropping it intended? apnadkarni added on 2026-10-17 16:53:24:
I have to retrace but will need some time before I can look at it. I vaguely recall it was supposed to be done elsewhere (which would mean the comment was not fixed) but I could be wrong. apnadkarni added on 2026-11-06 15:40:08:
Proposed fix in branch apn-bug-75ecc0e6cb. Implementation differs from the init-encoding-dirs branch. Encoding directory should be added irrespective of whether Question, in case anyone feels one way or another -
apnadkarni added on 2026-11-07 11:08:42:
Merged into 9.1 in [1bc3a58eac]. Not applicable to 9.0. Please re-open if you still see an issue. | ||||
