Skip to content

2to3 conversion, manual sync of fixes from upstream egh/spydaap#6

Draft
Saijin-Naib wants to merge 1 commit intoexaile:masterfrom
Saijin-Naib:master
Draft

2to3 conversion, manual sync of fixes from upstream egh/spydaap#6
Saijin-Naib wants to merge 1 commit intoexaile:masterfrom
Saijin-Naib:master

Conversation

@Saijin-Naib
Copy link
Copy Markdown

I've gotten it about as far as I can figure at this point, but I think the logging function needs a rework to work properly under Python3:

spydaap 
spydaap server started (use --help for more options).  Press Ctrl-C to exit.
Traceback (most recent call last):
  File "/usr/bin/spydaap", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/spydaap/cli.py", line 207, in main
    really_main(opts)
  File "/usr/lib/python3.12/site-packages/spydaap/cli.py", line 99, in really_main
    rebuild_cache()
  File "/usr/lib/python3.12/site-packages/spydaap/cli.py", line 86, in rebuild_cache
    container_cache.build(md_cache)
  File "/usr/lib/python3.12/site-packages/spydaap/containers.py", line 43, in build
    entries = [n for n in md_cache if pl.contains(n)]
                          ^^^^^^^^
  File "/usr/lib/python3.12/site-packages/spydaap/cache.py", line 55, in __next__
    if self.n >= len(self.cache):
                 ^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer
Exception ignored in: <spydaap.cli.logging object at 0x7f78283f2a80>
AttributeError: 'logging' object has no attribute 'flush'
Exception ignored in sys.unraisablehook: <built-in function unraisablehook>
AttributeError: 'logging' object has no attribute 'flush'

Hopefully this is somewhat helpful as a starting point to carry forward fixing up spydaap for Python3, and thus Exaile 4.x usage.

@genodeftest
Copy link
Copy Markdown
Member

You might want to try to use and enforce type hinting.

  File "/usr/lib/python3.12/site-packages/spydaap/cache.py", line 55, in __next__
    if self.n >= len(self.cache):
                 ^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer

This looks very wrong to me, but unrelated to logging. Why would the length ever be a float? I'd recommend investigating the parsers

@Saijin-Naib
Copy link
Copy Markdown
Author

I am unsure about the existing functions. I ran 2to3 with python 3.12.x and made some basic fixes to names/imports it missed, but anything beyond is above me at the moment.

@rokm
Copy link
Copy Markdown
Member

rokm commented Feb 22, 2026

We have a py3 branch here that I made long ago when we were porting exaile to python3.

Back then I was testing exaile's DAAP client and I recall it was working. That doesn't seem to be the case anymore, though - while exaile's DAAP plugin successfully retrieves the tracks, it doesn't add them to collection because they seem to fail the track.is_supported() test (which at the first glance seems to be due to not having a local-path based URI).

@Saijin-Naib Saijin-Naib marked this pull request as draft March 4, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants