Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startswith first arg must be bytes or a tuple of bytes, not str #271

Closed
RyuConnor opened this issue Jul 1, 2023 · 12 comments
Closed

startswith first arg must be bytes or a tuple of bytes, not str #271

RyuConnor opened this issue Jul 1, 2023 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@RyuConnor
Copy link

TypeError: TypeError('startswith first arg must be bytes or a tuple of bytes, not str')

Linux 6.3.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 21 Jun 2023 20:46:20 +0000 x86_64 GNU/Linux

displaycal 3.9.10-3 | Build Date: 2023-06-05

Python 3.11.3

Error occurs at the end of calibration and prevents the ICM/ICC profile from being built.

@RyuConnor
Copy link
Author

RyuConnor commented Jul 1, 2023

DisplayCal settings used:

Display & Instrument
Calibration
Profiling

@eoyilmaz
Copy link
Owner

eoyilmaz commented Jul 1, 2023

@RyuConnor can you copy&paste the terminal output, I don't see where this error is generated exactly.

@RyuConnor
Copy link
Author

RyuConnor commented Jul 1, 2023

You'll have to tell me how to do that. The error does not have a log attached.

DisplayCal Error

@p5k369
Copy link
Collaborator

p5k369 commented Jul 1, 2023

Hey @RyuConnor, maybe you start displaycal from some kind of menu, start displaycal instead from a terminal via displaycal. If you do so you will get ouput in that terminal.

@RyuConnor
Copy link
Author

This appears to be the relevant segment.

DisplayCAL: Adding 33 fixed points to /tmp/DisplayCAL-_qr5sb74/N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT.ti3
value could not be a str: 1931_2
DisplayCAL: Adding 34 fixed points to /tmp/DisplayCAL-_qr5sb74/N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT.ti1
Create profile from measurement data...
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/wx/lib/delayedresult.py", line 267, in wrapper
    result = workerFn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/DisplayCAL/worker.py", line 1843, in __call__
    result = self.producer(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/DisplayCAL/worker.py", line 10653, in create_profile
    cmd, args = self.prepare_colprof(
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/DisplayCAL/worker.py", line 13209, in prepare_colprof
    if line.startswith("COLOR_REP"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Here is the complete log output just in case.

XDG: [Errno 2] No translation file found for domain: 'xdg-user-dirs'
Acquired lock file: <DisplayCAL.main.AppLock object at 0x7f6044d5bd10>
displaycal 3.9.10 2022-11-21T22:56:25Z
arch rolling n/a x86_64
Python 3.11.3 (main, Jun  5 2023, 09:32:32) [GCC 13.1.1 20230429]
Faulthandler 
wxPython 4.2.0 gtk3 (phoenix) wxWidgets 3.2.2.1
Encoding: utf-8
File system encoding: utf-8
Loading /home/hellfire/.config/DisplayCAL/DisplayCAL.ini
listening
writing to lock file: port: 15411
Starting up...
SDL2: libSDL2-2.0.so.0
Audio module: wx 4.2.0
Enumerating display devices and communication ports...
/usr/bin
ArgyllCMS 2.3.1
Argyll has virtual display support
...ok.
Checking video card gamma table access for display 1...
Dispwin: Warning - new_dispwin: Expected VideoLUT depth 11 doesn't match actual 10
VideoLUT has 1024 entries, interpolating to 256
Dispwin: Warning - new_dispwin: Expected VideoLUT depth 11 doesn't match actual 10
Dispwin: Warning - new_dispwin: Expected VideoLUT depth 11 doesn't match actual 10
Verify: 'test.cal' IS loaded (discrepancy 0.0%)
Dispwin: Warning - new_dispwin: Expected VideoLUT depth 11 doesn't match actual 10
...ok.
Initializing GUI...

...ok.
Ready.
Setting up scripting host at 127.0.0.1:15411
Reloading /home/hellfire/.config/DisplayCAL/DisplayCAL.ini
--------------------------------------------------------------------------------
Calibrate & profile
Detecting output levels range...
DisplayCAL: Inhibited org.freedesktop.ScreenSaver
DisplayCAL: Inhibited org.freedesktop.PowerManagement.Inhibit
--------------------------------------------------------------------------------
Session log: 0_16

Working directory:
  /
   tmp/
    DisplayCAL-_qr5sb74/

Command line:
  /usr/bin/dispread
    -v
    -k
    /usr/share/DisplayCAL/linear.cal
    -d1
    -c1
    -yn
    -P0.5,0.5,1.0
    -X
    WLEDFamily_07Feb11.ccss
    0_16

DisplayCAL: Starting interaction with subprocess
DisplayCAL: Waiting for send buffer
DisplayCAL: Detected instrument placement (screen/spot) message
DisplayCAL: Skipping place instrument on screen message...
DisplayCAL: Send buffer received:  
DisplayCAL: Sending buffer: ' '
DisplayCAL: Reached EOF (OK)
dispread exitcode: 0
RGB level 0 is 0.090753 cd/m2
RGB level 16 is 0.430099 cd/m2
Assuming full range output levels
--------------------------------------------------------------------------------
Session log: N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT

Working directory:
  /
   tmp/
    DisplayCAL-_qr5sb74/

Command line:
  /usr/bin/dispcal
    -v2
    -d1
    -c1
    -yn
    -P0.5,0.5,1.0
    -Q2012_2
    -X
    WLEDFamily_07Feb11.ccss
    -qm
    -t6500
    -b120.0
    -g2.2
    -f1.0
    -k0
    -A4.0
    -b
    'N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT'

DisplayCAL: Starting interaction with subprocess
DisplayCAL: Waiting for send buffer
DisplayCAL: Detected instrument placement (screen/spot) message
DisplayCAL: Skipping place instrument on screen message...
DisplayCAL: Send buffer received:  
DisplayCAL: Sending buffer: ' '
DisplayCAL: Waiting for send buffer
DisplayCAL: Send buffer received: 2
DisplayCAL: Sending buffer: '2'
DisplayCAL: Sending buffer: ' '
DisplayCAL: Waiting for send buffer
DisplayCAL: Send buffer received: 7
DisplayCAL: Sending buffer: '7'
DisplayCAL: Reached EOF (OK)
dispcal exitcode: 0
--------------------------------------------------------------------------------
Session log: N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT

Working directory:
  /
   tmp/
    DisplayCAL-_qr5sb74/

Command line:
  /usr/bin/dispread
    -v
    -d1
    -c1
    -yn
    -P0.5,0.5,1.0
    -X
    WLEDFamily_07Feb11.ccss
    -k
    'N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT.cal'
    'N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT'

DisplayCAL: Starting interaction with subprocess


DisplayCAL: Detected instrument placement (screen/spot) message
DisplayCAL: Waiting for send buffer
DisplayCAL: Skipping place instrument on screen message...
DisplayCAL: Send buffer received:  
DisplayCAL: Sending buffer: ' '
DisplayCAL: Reached EOF (OK)
dispread exitcode: 0
Extracting neutrals from /tmp/DisplayCAL-_qr5sb74/N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT.ti3
--------------------------------------------------------------------------------
Creating matrix from primaries
Using chromatic adaptation transform matrix: Bradford
--------------------------------------------------------------------------------
Creating shaper tags in separate step
Using chromatic adaptation transform matrix: Bradford
Extracting neutrals from /tmp/DisplayCAL-_qr5sb74/N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT.ti3
{0: {'SAMPLE_ID': 1, 'RGB_R': 0.0, 'RGB_G': 0.0, 'RGB_B': 0.0, 'XYZ_X': 0.0779188, 'XYZ_Y': 0.0791627, 'XYZ_Z': 0.156147}, 1: {'SAMPLE_ID': 5, 'RGB_R': 1.9608, 'RGB_G': 1.9608, 'RGB_B': 1.9608, 'XYZ_X': 0.101692, 'XYZ_Y': 0.103884, 'XYZ_Z': 0.184689}, 2: {'SAMPLE_ID': 6, 'RGB_R': 3.9216, 'RGB_G': 3.9216, 'RGB_B': 3.9216, 'XYZ_X': 0.162002, 'XYZ_Y': 0.16769, 'XYZ_Z': 0.254097}, 3: {'SAMPLE_ID': 7, 'RGB_R': 5.8824, 'RGB_G': 5.8824, 'RGB_B': 5.8824, 'XYZ_X': 0.27277, 'XYZ_Y': 0.285694, 'XYZ_Z': 0.383701}, 4: {'SAMPLE_ID': 8, 'RGB_R': 9.8039, 'RGB_G': 9.8039, 'RGB_B': 9.8039, 'XYZ_X': 0.632326, 'XYZ_Y': 0.655904, 'XYZ_Z': 0.822461}, 5: {'SAMPLE_ID': 9, 'RGB_R': 13.726, 'RGB_G': 13.726, 'RGB_B': 13.726, 'XYZ_X': 1.22964, 'XYZ_Y': 1.27355, 'XYZ_Z': 1.47266}, 6: {'SAMPLE_ID': 10, 'RGB_R': 17.647, 'RGB_G': 17.647, 'RGB_B': 17.647, 'XYZ_X': 2.0828, 'XYZ_Y': 2.17632, 'XYZ_Z': 2.47016}, 7: {'SAMPLE_ID': 11, 'RGB_R': 21.569, 'RGB_G': 21.569, 'RGB_B': 21.569, 'XYZ_X': 3.25866, 'XYZ_Y': 3.38003, 'XYZ_Z': 3.86785}, 8: {'SAMPLE_ID': 12, 'RGB_R': 25.49, 'RGB_G': 25.49, 'RGB_B': 25.49, 'XYZ_X': 4.71187, 'XYZ_Y': 4.91612, 'XYZ_Z': 5.60644}, 9: {'SAMPLE_ID': 13, 'RGB_R': 29.412, 'RGB_G': 29.412, 'RGB_B': 29.412, 'XYZ_X': 6.47217, 'XYZ_Y': 6.75297, 'XYZ_Z': 7.72093}, 10: {'SAMPLE_ID': 14, 'RGB_R': 33.333, 'RGB_G': 33.333, 'RGB_B': 33.333, 'XYZ_X': 8.51261, 'XYZ_Y': 8.86506, 'XYZ_Z': 10.1863}, 11: {'SAMPLE_ID': 15, 'RGB_R': 37.255, 'RGB_G': 37.255, 'RGB_B': 37.255, 'XYZ_X': 10.8613, 'XYZ_Y': 11.2939, 'XYZ_Z': 12.8282}, 12: {'SAMPLE_ID': 16, 'RGB_R': 41.176, 'RGB_G': 41.176, 'RGB_B': 41.176, 'XYZ_X': 13.5082, 'XYZ_Y': 14.0807, 'XYZ_Z': 16.0355}, 13: {'SAMPLE_ID': 17, 'RGB_R': 45.098, 'RGB_G': 45.098, 'RGB_B': 45.098, 'XYZ_X': 16.3864, 'XYZ_Y': 17.1725, 'XYZ_Z': 19.6339}, 14: {'SAMPLE_ID': 18, 'RGB_R': 49.02, 'RGB_G': 49.02, 'RGB_B': 49.02, 'XYZ_X': 19.6544, 'XYZ_Y': 20.5796, 'XYZ_Z': 23.5118}, 15: {'SAMPLE_ID': 19, 'RGB_R': 52.941, 'RGB_G': 52.941, 'RGB_B': 52.941, 'XYZ_X': 23.2563, 'XYZ_Y': 24.2977, 'XYZ_Z': 27.8397}, 16: {'SAMPLE_ID': 20, 'RGB_R': 56.863, 'RGB_G': 56.863, 'RGB_B': 56.863, 'XYZ_X': 27.2267, 'XYZ_Y': 28.3917, 'XYZ_Z': 32.6609}, 17: {'SAMPLE_ID': 21, 'RGB_R': 60.784, 'RGB_G': 60.784, 'RGB_B': 60.784, 'XYZ_X': 31.5984, 'XYZ_Y': 33.0158, 'XYZ_Z': 37.5594}, 18: {'SAMPLE_ID': 22, 'RGB_R': 64.706, 'RGB_G': 64.706, 'RGB_B': 64.706, 'XYZ_X': 36.2448, 'XYZ_Y': 37.8858, 'XYZ_Z': 42.7473}, 19: {'SAMPLE_ID': 23, 'RGB_R': 68.627, 'RGB_G': 68.627, 'RGB_B': 68.627, 'XYZ_X': 41.4861, 'XYZ_Y': 43.2877, 'XYZ_Z': 48.9369}, 20: {'SAMPLE_ID': 24, 'RGB_R': 72.549, 'RGB_G': 72.549, 'RGB_B': 72.549, 'XYZ_X': 46.9174, 'XYZ_Y': 49.0537, 'XYZ_Z': 55.6289}, 21: {'SAMPLE_ID': 25, 'RGB_R': 76.471, 'RGB_G': 76.471, 'RGB_B': 76.471, 'XYZ_X': 52.6665, 'XYZ_Y': 55.0908, 'XYZ_Z': 62.4885}, 22: {'SAMPLE_ID': 26, 'RGB_R': 80.392, 'RGB_G': 80.392, 'RGB_B': 80.392, 'XYZ_X': 58.9496, 'XYZ_Y': 61.3866, 'XYZ_Z': 70.0144}, 23: {'SAMPLE_ID': 27, 'RGB_R': 84.314, 'RGB_G': 84.314, 'RGB_B': 84.314, 'XYZ_X': 65.6097, 'XYZ_Y': 68.4849, 'XYZ_Z': 77.5459}, 24: {'SAMPLE_ID': 28, 'RGB_R': 88.235, 'RGB_G': 88.235, 'RGB_B': 88.235, 'XYZ_X': 72.7618, 'XYZ_Y': 75.8562, 'XYZ_Z': 86.0772}, 25: {'SAMPLE_ID': 29, 'RGB_R': 92.157, 'RGB_G': 92.157, 'RGB_B': 92.157, 'XYZ_X': 79.947, 'XYZ_Y': 83.4858, 'XYZ_Z': 94.2775}, 26: {'SAMPLE_ID': 30, 'RGB_R': 96.078, 'RGB_G': 96.078, 'RGB_B': 96.078, 'XYZ_X': 87.7893, 'XYZ_Y': 91.4544, 'XYZ_Z': 104.144}, 27: {'SAMPLE_ID': 31, 'RGB_R': 100.0, 'RGB_G': 100.0, 'RGB_B': 100.0, 'XYZ_X': 96.7035, 'XYZ_Y': 100.0, 'XYZ_Z': 113.844}}
--------------------------------------------------------------------------------
Adding rTRC from interpolation to N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT
Adding gTRC from interpolation to N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT
Adding bTRC from interpolation to N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT
--------------------------------------------------------------------------------
Session log: N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT

Working directory:
  /
   tmp/
    DisplayCAL-_qr5sb74/

Command line:
  /usr/bin/targen
    -v
    -d3
    -e4
    -s17
    -g49
    -m0
    -f391
    -A1.0
    -G
    -N0.5
    -B4
    -b0
    -V1.6
    -c
    'N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT.icc'
    'N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT'

DisplayCAL: Waiting for EOF
DisplayCAL: Reached EOF (OK)
targen exitcode: 0
--------------------------------------------------------------------------------
Session log: N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT

Working directory:
  /
   tmp/
    DisplayCAL-_qr5sb74/

Command line:
  /usr/bin/dispread
    -v
    -d1
    -c1
    -yn
    -P0.5,0.5,1.0
    -X
    WLEDFamily_07Feb11.ccss
    -k
    'N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT.cal'
    'N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT'

DisplayCAL: Starting interaction with subprocess
DisplayCAL: Waiting for send buffer
DisplayCAL: Detected instrument placement (screen/spot) message
DisplayCAL: Skipping place instrument on screen message...
DisplayCAL: Send buffer received:  
DisplayCAL: Sending buffer: ' '
DisplayCAL: Reached EOF (OK)
dispread exitcode: 0
DisplayCAL: Adding 33 fixed points to /tmp/DisplayCAL-_qr5sb74/N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT.ti3
value could not be a str: 1931_2
DisplayCAL: Adding 34 fixed points to /tmp/DisplayCAL-_qr5sb74/N173HHE-G32 #1 2023-07-01 20-02 120cdm² D6500 2.2 M-S LabLUT.ti1
Create profile from measurement data...
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/wx/lib/delayedresult.py", line 267, in wrapper
    result = workerFn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/DisplayCAL/worker.py", line 1843, in __call__
    result = self.producer(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/DisplayCAL/worker.py", line 10653, in create_profile
    cmd, args = self.prepare_colprof(
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/DisplayCAL/worker.py", line 13209, in prepare_colprof
    if line.startswith("COLOR_REP"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

DisplayCAL: Uninhibited org.freedesktop.ScreenSaver
DisplayCAL: Uninhibited org.freedesktop.PowerManagement.Inhibit
Executing BaseApp.OnExit()
Running application exit handlers
Waiting for thread ScriptingHost.ConnectionHandler to exit
ScriptingHost.ConnectionHandler exited
Exiting displaycal
Ran application exit handlers

@eoyilmaz eoyilmaz self-assigned this Jul 3, 2023
@eoyilmaz eoyilmaz added the bug Something isn't working label Jul 3, 2023
eoyilmaz added a commit that referenced this issue Jul 3, 2023
p5k369 pushed a commit that referenced this issue Jul 4, 2023
@RyuConnor
Copy link
Author

Is there a work around for this bug until a new version with this fix is released? I haven't been able to calibrate my laptop for two years due to this error. :(

@p5k369
Copy link
Collaborator

p5k369 commented Jan 6, 2024

Hey @RyuConnor,
sorry for the late reply. Are you installing displaycal via arch package manager? Please note that there is a newer version which should contain that fix. You also can clone the develop branch and run displaycal from there.

@RyuConnor
Copy link
Author

Hello @p5k369. Thank you for helping me. Unfortunately, despite the fact that the Arch Maintainer of DisplayCal built version 3.9.11 long after the original release date, they did not include this fix as part of their build.

The Maintainer is unlikely to update the official package again until 3.9.12 gets pushed and even then it might take a few months for that to happen based on past precedent.

I have tried my hand at manually updating the package with help from the ArchWiki. It has not gone well. I am not ashamed to admit, that I'm out of my depth.

@p5k369
Copy link
Collaborator

p5k369 commented Jan 16, 2024

Hey @RyuConnor,
we could ping the maintainer for a release but that might not help you immediatly.
You could however get displaycal working in a virtual environment as described here: https://github.com/eoyilmaz/displaycal-py3?tab=readme-ov-file#how-to-install
You're on linux, so you will get it running. Also I'm willing to support you until you get it working if you wish.

@eoyilmaz
Copy link
Owner

I'm going to release 3.9.12 soon, fyi...

@eoyilmaz
Copy link
Owner

3.9.12 is released please try it.

@RyuConnor
Copy link
Author

It still crashes at the end.

"Argyll CMS xicclu: Invalid white XYZ: 0.9651 0.9998 0.8232"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants