367 compiled sucessfully in w10 py311 but createprocess fails call to dispread to measure
DisplayCAL now runs properly on Windows with Python 3.9, 3.10 and 3.11.
Ok, it fails to attach a TTY right to the subprocess and hangs, and I actually get a nice isatty NoneType AttributeError on Windows if launched via pythonw. Log is likewise busted for the same reason.
So, wexpect/tty issues it appears. Will see what I can do about them.
Ok, so it appears that frozen version does something extra in its script to make wexpect work:
From wexpect.py - that's probably the secret sauce, it runs a subscript that does something to grab the console... and utterly fails. The executable is launched but sits there. I need more logs from wexpect to see what's up.
2024-06-18 13:04:14,535 Traceback (most recent call last):
File "C:\Projects\displaycal_venv\Lib\site-packages\DisplayCAL\wexpect.py", line 2621, in __init__
SetConsoleOutputCP(cp)
TypeError: SetConsoleOutputCP() argument 1 must be int, not str
And that's that. Not sure how you want to set it to utf-8 with this API by string. It should be number 65001.
There's more, I have a patch cooking, though while it's working, I'm not sure it's fully correct and I need to clean it up.
Specifically new Python as launched by wexpect gets no standard handles (stdin/out/err), while the Argyll subprocess created from that is told to inherit the handles - because new Python sets this process flag for itself, presumably so that it can thread and subprocess as expected. Since there's no stdio, Argyll processes told to run interactively just terminate. I can tell it to have its new fresh stdio, and it seems to work. One thing I'm not sure is whether the console is inherited or created anew ignoring all the settings we gave it.
Plus there's yet another Unicode bug in WAIT_TEMPLATE which I fixed.
See https://github.com/eoyilmaz/displaycal-py3/pull/383 for the additional fixes. This is on top of this branch.
Hi, not sure if this is the place to post this or this should be a new issue.
I tried going through the windows manual install process in the readme to build and run this branch.
Encountering the below error where the argyll executable could not be started. I'm including the terminal output below if it's helpful.
I'm on Windows 11 and Python 3.11.3.
Thanks for the effort at modernizing DisplayCAL!
Cheers Nelson
$ python -m DisplayCAL
Acquired lock file: <DisplayCAL.main.AppLock object at 0x00000214103BA510>
__main__.py 3.9.12 2024-07-11T16:59:35Z
Windows 10 Education Version 2009 Build 22631.3737 x86_64
Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)]
CA file C:\Users\Nelson Lim\.virtualenvs\displaycal-py3-Ub8jokFz\Lib\site-packages\certifi\cacert.pem
Faulthandler
wxPython 4.2.1 msw (phoenix) wxWidgets 3.2.2.1
Encoding: utf-8
File system encoding: utf-8
Loading C:\Users\Nelson Lim\AppData\Roaming\DisplayCAL\DisplayCAL.ini
listening
writing to lock file: port: 15411
No module named 'comtypes.gen'
Error - could not import WMI: No module named 'wmi'
C:\NL\2_Areas\dev\displaycal-py3\DisplayCAL\wxMeasureFrame.py:42: Warning: No module named 'DisplayCAL.lib64.python311.RealDisplaySizeMM'
warnings.warn(str(exception), Warning)
Starting up...
Audio module: pyglet 2.0.15
Enumerating display devices and communication ports...
C:\Users\Nelson Lim\AppData\Roaming\DisplayCAL\dl\Argyll_V2.1.2\bin
ArgyllCMS 2.1.2
Argyll has virtual display support
...ok.
Checking video card gamma table access for display 1...
Verify: 'test.cal' IS loaded (discrepancy 0.0%)
...ok.
Checking video card gamma table access for display 2...
Verify: 'test.cal' IS loaded (discrepancy 0.0%)
...ok.
Initializing GUI...
input_value_clipping_bmp should have been hidden
output_profile_ctrl should have been hidden
instrument_name: i1 DisplayPro, ColorMunki Display
display_name : Generic PnP Monitor
...ok.
Ready.
Setting up scripting host at 127.0.0.1:15411
Check for application update...
DisplayCAL is up-to-date.
┌──────────────────────────────────────────────────────────────────────────────┐
│ An update is available: ArgyllCMS 3.2.0 │
└──────────────────────────────────────────────────────────────────────────────┘
-> Update now
Using CA file C:\Users\Nelson Lim\.virtualenvs\displaycal-py3-Ub8jokFz\Lib\site-packages\certifi\cacert.pem
Connecting to https://www.argyllcms.com:443...
Downloading https://www.argyllcms.com//Argyll_V3.2.0_win64_exe.zip → C:\Users\Nelson Lim\AppData\Roaming\DisplayCAL\dl\Argyll_V3.2.0_win64_exe.zip
...ok.
Warning - DisplayCAL-apply-profiles not running?
Enumerating display devices and communication ports...
C:\Users\Nelson Lim\AppData\Roaming\DisplayCAL\dl\Argyll_V3.2.0\bin
ArgyllCMS 3.2.0
Argyll has virtual display support
...ok.
--------------------------------------------------------------------------------
Calibrate & profile
Detecting output levels range...
--------------------------------------------------------------------------------
Session log: 0_16
Working directory:
C:\
Users\
NELSON~1\
AppData\
Local\
Temp\
DisplayCAL-iwot_97o\
Command line:
C:\Users\Nelson Lim\AppData\Roaming\DisplayCAL\dl\Argyll_V3.2.0\bin\dispread.exe
-v
-k
C:\NL\2_Areas\dev\displaycal-py3\DisplayCAL\linear.cal
-d2
-c1
-yn
"-P0.5382692908466105,0.4411571334648258,1.6218274111675128"
-F
0_16
┌──────────────────────────────────────────────────────────────────────────────┐
│ The process C:\Users\Nelson │
│ Lim\AppData\Roaming\DisplayCAL\dl\Argyll_V3.2.0\bin\dispread.exe could not │
│ be started. │
└──────────────────────────────────────────────────────────────────────────────┘
@nelsonlim You should try my branch, yes it includes this one. That is supposed to work, drop me a line if it does not.
@nelsonlim please report this in another ticket, I'm ready to merge this one.