Skip to content

Windows tests failure

Environment:

  • Windows 11 Pro
  • Python 3.13.1 (tags/v3.13.1:0671451, Dec 3 2024, 19:06:28) [MSC v.1942 64 bit (AMD64)] on win32
  • go version go1.23.4 windows/amd64
  • gcc.exe (Rev3, Built by MSYS2 project) 13.2.0 Copyright (C) 2023 Free Software Foundation, Inc.

Trace:

--- FAIL: TestOSFileToObject (0.02s) 
--- FAIL: TestOSFileToObject/Writable (0.01s) go-os-file_test.go:58: error is "OSError: [WinError 6] Descripteur non valide", expected 
--- FAIL: TestOSFileToObject/NotReadable (0.00s) go-os-file_test.go:71: error is "OSError: [WinError 6] Descripteur non valide", expected 
--- FAIL: TestOSFileToObject/NotWritable (0.00s) go-os-file_test.go:92: error is "OSError: [WinError 6] Descripteur non valide", expected 
--- FAIL: TestOSFileToObject/WriteLines (0.00s) go-os-file_test.go:110: error is "OSError: [WinError 6] Descripteur non valide", expected 
--- FAIL: TestOSFileToObject/ReadLines (0.00s) go-os-file_test.go:146: error is "OSError: [WinError 6] Descripteur non valide", expected 
--- FAIL: TestOSFileToObject/Seek (0.00s) go-os-file_test.go:162: error is "OSError: [WinError 6] Descripteur non valide", expected go-os-file_test.go:180: error is "remove test-go-os-file.txt: The process cannot access the file because it is being used by another process.", expected -
-- FAIL: TestOSFileFromObject (0.02s) --- FAIL: TestOSFileFromObject/NotReadable (0.00s) go-os-file_test.go:211: error is "handle 4 get error: %!w(string=Bad file descriptor)", expected 
--- FAIL: TestOSFileFromObject/NotWritable (0.00s) go-os-file_test.go:236: error is "handle 4 get error: %!w(string=Bad file descriptor)", expected --- FAIL: TestOSFileFromObject/WriteLines (0.00s) go-os-file_test.go:257: error is "handle 3 get error: %!w(string=Bad file descriptor)", expected 
--- FAIL: TestOSFileFromObject/ReadLines (0.00s) go-os-file_test.go:281: error is "handle 3 get error: %!w(string=Bad file descriptor)", expected go-os-file_test.go:308: error is "remove test-go-os-file.txt: The process cannot access the file because it is being used by another process.", expected 
--- FAIL: TestOSPipeToObject (0.02s) 
--- FAIL: TestOSPipeToObject/WriteLines (0.01s) go-os-file_test.go:328: error is "OSError: [WinError 6] Descripteur non valide", expected 
--- FAIL: TestOSPipeToObject/ReadLines (0.00s) go-os-file_test.go:367: error is "OSError: [WinError 6] Descripteur non valide", expected 
--- FAIL: TestConsole (120.04s) 
--- FAIL: TestConsole/InputOutput (0.02s) go-os-file_test.go:440: error is "OSError: [WinError 6] Descripteur non valide", expected go-os-file_test.go:476: value is false, expected true go-os-file_test.go:477: value is "", expected "test prompt" go-os-file_test.go:478: value is false, expected true go-os-file_test.go:479: value is "", expected "bye!" 
test call test call2 test call3 test call4 test call5 
FAIL 
FAIL 
gitlab.com/pygolo/py/test 121.983s FAIL

Problem seems to be located in "go-os-file_windows.go"

fd := C._open_osfhandle(C.intptr_t(handle), flags)
	if fd < 0 {
		syscall.CloseHandle(handle)
		err := C.GoString(C.strerror(*C._errno()))
		return Object{}, fmt.Errorf("handle %v open error: %w", file.File.Fd(), err)
	}
>>> o_file, err := Py.Object_Call(o_open, GoArgs{int(fd)}, GoKwArgs{"mode": file.Mode, "encoding": file.Encoding})
>>> The call returns an OSError: "[WinError 6] Descripteur non valide"
Edited by Laurent Blanquet
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information