koiuo / randrctl

Profile based screen manager for X
GNU General Public License v3.0
47 stars 12 forks source link

Python 3.10 showstopping bug #33

Closed drws closed 2 years ago

drws commented 2 years ago

randrctl stopped working after Python 3.10 upgrade:

# randrctl auto
Traceback (most recent call last):
  File "/usr/sbin/randrctl", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/randrctl/cli.py", line 311, in main
    return cmd(randrctl, args)
  File "/usr/lib/python3.10/site-packages/randrctl/cli.py", line 181, in cmd_auto
    randrctl.switch_auto()
  File "/usr/lib/python3.10/site-packages/randrctl/ctl.py", line 77, in switch_auto
    profiles = self.profile_manager.read_all()
  File "/usr/lib/python3.10/site-packages/randrctl/profile.py", line 32, in read_all
    profiles.append(self.read_file(profile_file))
  File "/usr/lib/python3.10/site-packages/randrctl/profile.py", line 63, in read_file
    if v.get('mode'):
AttributeError: 'str' object has no attribute 'get'

This is the line in question. While I know the project is on pause, this is a question that needs to be asked. Is there a possibility for a fix or is randrctl finished?

koiuo commented 2 years ago

Thanks for reporting. I no longer use the project as I didn't have an access to external displays for about a year by now.

It does look like something trivial to fix though. I'll try reproducing and fixing it later this week. Will let you know.

koiuo commented 2 years ago

Hi. Sorry about the late response, but I could not reproduce this on python 3.10.5.

Maybe if you shared your profiles I could figure out what's wrong exactly.

drws commented 2 years ago

Oh, I see now. It's related with my testing in #32 and it happens if pos or panning field values are not quoted, but interestingly, the same doesn't hold true for the similar scale field. I've done a randrctl dump with the new Python version and reformatted profiles accordingly - it works now and closes this. Sorry for wasting your time.