| Ticket UUID: | 664392 | |||
| Title: | Test failures in uri module for Win32 | |||
| Type: | Bug | Version: | None | |
| Submitter: | patthoyts | Created on: | 2003-01-08 13:51:40 | |
| Subsystem: | uri | Assigned To: | andreas_kupries | |
| Priority: | 6 | Severity: | ||
| Status: | Open | Last Modified: | 2026-11-23 11:06:32 | |
| Resolution: | None | Closed By: | ||
| Closed on: | ||||
| Description: |
The uri package is failing the recent uri::canonicalize
tests under Win32 systems.
The problem is some of the tests are using the file
scheme with a hostname part:
file://localhost/a/b/c
When using Windows a split and join operation results in
file://localhost:/a/b/c
due to code in the uri::join for the file scheme.
Common usage under windows is to permit the drive
letter to be used as the host part and we are
supporting this - however, we must also support the RFC
specification too.
We can expect to use file://c:/autoexec.bat (although
this should strictly be file:///c:/autoexec.bat - thus
using a null host part). Also we must permit
file://localhost/c:/ as this is what the RFC specifies.
Other problems: the path section must be in the URL/URI
style.
% uri::join scheme file path {c:\windows}
file://c:\windows
This _MUST_ be file://c:/windows. Backslashes are
illegal in URLs. This goes for Mac's and VMS too. I
believe that [file normalize] will fix the host's path
into very nearly correct RFC style. Probably just need
some quoting of illegal characters (like space). [file
native] should probably be invoked in the uri::split
function too.
| |||
| User Comments: |
serhiy.storchaka added on 2026-11-23 11:06:32:
The canonicalize failures described here are gone since uri 1.2.7 (tcllib 1.19): with the default HostAsDriveLetter 0, file://localhost/a/b/c round-trips on Windows. What remains on trunk: uri::join scheme file path c:\windows gives file:///c:\windows, and on Windows uri::geturl file:///c:/autoexec.bat tries to open /c:/autoexec.bat. Phil's branch pbrooks-ticket-664392 fixes both; I tested it on Windows with Tcl 8.6 and 9.1 (uri.test passes there, uri-4.1 fails on trunk). Before merging, I suggest:
A side note, not from the branch: a file URL has no port (RFC 8089, 2: file-auth = "localhost" / host), but uri::split file://localhost:80/etc/hosts returns host localhost path :80/etc/hosts instead of an error. The valid forms for a drive letter are file:///c:/autoexec.bat and file://localhost/c:/autoexec.bat; file:/c:/autoexec.bat is equivalent, but join should produce the three-slash form. The new tests uri-api-7.1..7.3 on branch tests-uri use such URLs; they are knownBug on Windows now and pass with Phil's branch. | |||
Home
Blog
Docs
Downloads
Tickets
Timeline
Branches
Tags
Wiki