Tk Source Code

View Ticket
Login
Ticket UUID: 7c571871efb77076c15cffb4194916e4e3714752
Title: winDialog tests failures
Type: Bug Version: core-8-6-branch
Submitter: fvogel Created on: 2017-01-09 14:31:53
Subsystem: 86. Test Tools Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2018-05-29 20:00:29
Resolution: Fixed Closed By: fvogel
    Closed on: 2018-05-29 20:00:29
Description:

winDialog tests failures obtained on Windows 7, under an account that is not an administrator of the machine (just a normal user):

winDialog-5.7.6 fails because an error message is displayed in a dialog. Approximate translation of the message originally in French:

bar
You do not have the rights to open the file.

Then the user has to click OK in that dialog, then Cancel in the "Save" dialog, the latter action producing a wrong obtained result in the winDialog-5.7.6 test.

winDialog-5.7.7 and winDialog-5.7.8 fail because of permission denied. No user action here however.

winDialog-5.12.2 produces an error dialog:

user "fvogel" doesn't exist
  while executing
"file normalize [file join ~$::tcl_platform(user) "5 12 2"]"
  (file "D:/tcltk-fossil/tk/tests/winDialog.test" line 521)
...<rest snipped>...

and the test suite brutally exits without running what comes after winDialog-5.12.2

Detailed log of the failures output:

==== winDialog-5.7.6 GetFileName: All/extension FAILED
==== Contents of test case:

    # In 8.6.4 this combination resulted in bar.ext.ext which is bad
    start {set x [tk_getSaveFile -filetypes {{All *}} -defaultextension {ext} -title Save]}
    set msg {}
    then {
        if {[catch {SetText [vista? 0x47C 0x3e9] bar} msg]} {
            Click cancel
        } else {
            Click ok
        }
    }
    set x "[file tail $x]$msg"

---- Result was:

---- Result should have been (exact matching):
bar.ext
==== winDialog-5.7.6 FAILED



==== winDialog-5.7.7 tk_getOpenFile: -defaultextension FAILED
==== Contents of test case:

    unset -nocomplain x
    tcltest::makeFile "" "5 7 7.ext" [initialdir]
    start {set x [tk_getOpenFile  -defaultextension ext  -initialdir [file nativename [initialdir]]  -initialfile "5 7 7" -title Foo]}
    then {
        Click ok
    }
    return $x

---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: couldn't open "D:/tcltk-fossil/tk/win/5 7 7.ext": permission denied
    while executing
"open $fullName w"
    (procedure "tcltest::makeFile" line 13)
    invoked from within
"tcltest::makeFile "" "5 7 7.ext" [initialdir]"
    ("uplevel" body line 3)
    invoked from within
"uplevel 1 $script"
---- errorCode: POSIX EACCES {permission denied}
==== winDialog-5.7.7 FAILED



==== winDialog-5.7.8 tk_getOpenFile: -defaultextension FAILED
==== Contents of test case:

    unset -nocomplain x
    tcltest::makeFile "" "5 7 8.ext" [initialdir]
    start {set x [tk_getOpenFile  -defaultextension ext  -initialdir [file nativename [initialdir]]  -initialfile "5 7 8.ext" -title Foo]}
    then {
        Click ok
    }
    return $x

---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: couldn't open "D:/tcltk-fossil/tk/win/5 7 8.ext": permission denied
    while executing
"open $fullName w"
    (procedure "tcltest::makeFile" line 13)
    invoked from within
"tcltest::makeFile "" "5 7 8.ext" [initialdir]"
    ("uplevel" body line 3)
    invoked from within
"uplevel 1 $script"
---- errorCode: POSIX EACCES {permission denied}
==== winDialog-5.7.8 FAILED

User Comments: fvogel added on 2018-05-29 20:00:29:
Fixed in Tcl core-8-6-branch, core-8-branch and trunk.

fvogel added on 2018-05-15 14:06:36:

This issue really is a Tcl issue.

Follow-up there.


bll added on 2018-05-15 13:23:17:
Just reading the code [ tclWinFile.c / TclpGetUserHome() ]
If the user name is the form name@domain and the NetGetDCName() call
fails, then the result is null.
Or if NetUserGetInfo() fails.

I suppose some debug will need to be added to see exactly where
the error occurs and what the error is.

fvogel added on 2018-05-15 07:27:20:
When I run tclsh86tg.exe as an admin (right click, run as Administrator, enter login+password of the local admin of the computer), then I get no error and the answer of file normalize ~$::tcl_platform(user) is the right one: C:/Users/l-vogel

bll added on 2018-05-14 18:24:32:
Admin account:
E:\>c:windows\64\tcl\bin\tclsh.exe
% file normalize ~$::tcl_platform(user)
C:/Users/bll
% exit

Standard user:
C:\Users\std>.\Desktop\BallroomDJ\windows\64\tcl\bin\tclsh.exe
% file normalize ~$::tcl_platform(user)
C:/Users/std
% file join ~$::tcl_platform(user) 5 12 2
~std/5/12/2
% file normalize [file join ~$::tcl_platform(user) 5 12 2]
C:/Users/std/5/12/2
%

Also on Windows 7.   I wonder what is different.
Locale?

fvogel added on 2018-05-14 17:00:33:

Today, same Win7 machine, same user account, in the bleeding edge of Tcl and Tk core-8-6-branch:

- 5.7.6, 5.7.7, 5.7.8, and 5.12.7 do pass
- the only remaining issue in winDialog.test is that winDialog-5.12.2 produces an error dialog:
user "fvogel" doesn't exist
  while executing
"file normalize [file join ~$::tcl_platform(user) "5 12 2"]"
  (file "D:/tcltk-fossil/tk/tests/winDialog.test" line 521)
...<rest snipped>...

and the test suite brutally exits without running what comes after winDialog-5.12.2

Indeed, in tclsh:

% file normalize ~$::tcl_platform(user)
user "fvogel" doesn't exist
%

Did this ever work?


fvogel added on 2017-01-09 14:48:02:
On the same machine, running the winDialog test suite from an admin account this time:

5.7.6, 5.7.7 and 5.7.8 : same behaviour

5.12.2 now passes and does not longer cause the test suite to exit

New failure: 5.12.7, because return value of the test was 1 (expected 0 or 2), due to errorCode: TCL OPERATION GLOB NOMATCH