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

Artist ascii codec error \xeb #1709

Closed
m4rkv5 opened this issue Apr 24, 2022 · 6 comments
Closed

Artist ascii codec error \xeb #1709

m4rkv5 opened this issue Apr 24, 2022 · 6 comments
Labels
bug mrp Media Remote Protocol

Comments

@m4rkv5
Copy link

m4rkv5 commented Apr 24, 2022

Describe the bug

Pyatv is working fine except when some songs are playing. Then the script crashes.

Error log

Traceback (most recent call last):
  File "/homebridge/python/pyatv/scripts/atvremote.py", line 719, in _run_application
    return await cli_handler(loop)
  File "/homebridge/python/pyatv/scripts/atvremote.py", line 513, in cli_handler
    return await _handle_commands(args, config, loop)
  File "/homebridge/python/pyatv/scripts/atvremote.py", line 614, in _handle_commands
    ret = await _handle_device_command(args, cmd, atv, loop)
  File "/homebridge/python/pyatv/scripts/atvremote.py", line 652, in _handle_device_command
    return await _exec_command(atv.metadata, cmd, True, *cmd_args)
  File "/homebridge/python/pyatv/scripts/atvremote.py", line 692, in _exec_command
    _pretty_print(value)
  File "/homebridge/python/pyatv/scripts/atvremote.py", line 710, in _pretty_print
    print(data)
UnicodeEncodeError: 'ascii' codec can't encode character '\xeb' in position 84: ordinal not in range(128)

How to reproduce the bug?

Play Tiësto The Business

What is expected behavior?

Media type: Music
Device state: Paused
Title: The Business
Artist: Tiësto
Album: ...
Genre: Dance
Position: 0/166s (0.0%)
Repeat: Off
Shuffle: Off

Operating System

oznu/docker-homebridge

Python

3.6

pyatv

0.9.8

Device

Apple TV 4k 15.4.1

Additional context

.

@m4rkv5 m4rkv5 added the bug label Apr 24, 2022
@postlund
Copy link
Owner

I will look into this, thanks for reporting!

@postlund postlund added the mrp Media Remote Protocol label May 11, 2022
@postlund postlund added this to the v0.10.1 milestone Jun 26, 2022
@postlund
Copy link
Owner

I'm trying to reproduce this myself and neither Apple Music nor Spotify seems to trigger it. How are you playing the track? I suspect it has to do with your locale being incorrectly set to something non-Unicode compliant. Can you give me some additional details regarding how I would reproduce this using the docker image you mention?

@postlund postlund removed this from the v0.10.1 milestone Jun 28, 2022
@m4rkv5
Copy link
Author

m4rkv5 commented Jun 28, 2022

I don't use it any longer. Periodic reading of my Apple TV status result in too high CPU load on my system. If the ascii issue has something to do with my docker image it can be closed.

@postlund
Copy link
Owner

Ok, then I will close it. I would recommend using push updates (either via atvremote or atvscript) instead of polling. Setting up a new connection every time is quite expensive, especially on low-end systems.

@m4rkv5
Copy link
Author

m4rkv5 commented Jun 28, 2022

@postlund With push updates it now responds immediately. Thanks for the hint. I am using push updates via atvscript and node-red-node-daemon now.

@postlund
Copy link
Owner

That's great to hear! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mrp Media Remote Protocol
Projects
None yet
Development

No branches or pull requests

2 participants