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

Scan returns no results depending on how Python 3.9 is compiled/configured #2595

Open
jklewa opened this issue Dec 30, 2024 · 0 comments
Open
Labels

Comments

@jklewa
Copy link

jklewa commented Dec 30, 2024

Describe the bug

I am running two seemingly identical virtual environments side-by-side. The same Python version and packages are installed.

One's scan works as expected, and the other's returns no results.

  1. /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 -m venv env_working
  2. PYENV_VERSION=3.9.6 pyenv exec python -m venv env_not_working (pyenv 2.5.0, arch -x86_64 pyenv install 3.9.6)

If Python itself is compiled or configured in such a way that it's incompatible with pyatv it would be helpful to know why and possibly detect it with an error/warning.

Error log

/Users/the347/Library/Application\ Support/ATV\ Remote/env_3.9.6__0.16.0/bin/atvremote scan --debug --mdns-debug
2024-12-29 22:35:56 DEBUG [pyatv.scripts]: Running with pyatv 0.16.0
2024-12-29 22:35:56 DEBUG [pyatv.storage.file_storage]: Loading settings from /Users/the347/.pyatv.conf
2024-12-29 22:35:56 DEBUG [pyatv.support.net]: Binding on *:5353
2024-12-29 22:35:56 DEBUG [pyatv.support.net]: Binding on 127.0.0.1:0
2024-12-29 22:35:56 DEBUG [pyatv.support.net]: Binding on 10.0.1.122:0
2024-12-29 22:35:56 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x05\x00\x00\x00\x00\x00\x00\x0c_device-info\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01\x08_airplay\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0f_companion-link\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:56 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x05\x00\x00\x00\x00\x00\x00\x0f_companion-link\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0b_appletv-v2\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0b_touch-able\x04_tcp\x05local\x00\x00\x0c\x80\x01\x05_hscp\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:56 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x05\x00\x00\x00\x00\x00\x00\x05_hscp\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0e_mediaremotetv\x04_tcp\x05local\x00\x00\x0c\x80\x01\x05_raop\x04_tcp\x05local\x00\x00\x0c\x80\x01\x08_airport\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:56 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x02\x00\x00\x00\x00\x00\x00\x08_airport\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:57 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x05\x00\x00\x00\x00\x00\x00\x0c_device-info\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01\x08_airplay\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0f_companion-link\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:57 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x05\x00\x00\x00\x00\x00\x00\x0f_companion-link\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0b_appletv-v2\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0b_touch-able\x04_tcp\x05local\x00\x00\x0c\x80\x01\x05_hscp\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:57 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x05\x00\x00\x00\x00\x00\x00\x05_hscp\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0e_mediaremotetv\x04_tcp\x05local\x00\x00\x0c\x80\x01\x05_raop\x04_tcp\x05local\x00\x00\x0c\x80\x01\x08_airport\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:57 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x02\x00\x00\x00\x00\x00\x00\x08_airport\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:58 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x05\x00\x00\x00\x00\x00\x00\x0c_device-info\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01\x08_airplay\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0f_companion-link\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:58 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x05\x00\x00\x00\x00\x00\x00\x0f_companion-link\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0b_appletv-v2\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0b_touch-able\x04_tcp\x05local\x00\x00\x0c\x80\x01\x05_hscp\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:58 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x05\x00\x00\x00\x00\x00\x00\x05_hscp\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0e_mediaremotetv\x04_tcp\x05local\x00\x00\x0c\x80\x01\x05_raop\x04_tcp\x05local\x00\x00\x0c\x80\x01\x08_airport\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
2024-12-29 22:35:58 DEBUG [pyatv.core.mdns]: Sending multicast DNS request to 224.0.0.251:5353 (Data=bytearray(b'5\xff\x01 \x00\x02\x00\x00\x00\x00\x00\x00\x08_airport\x04_tcp\x05local\x00\x00\x0c\x80\x01\x0c_sleep-proxy\x04_udp\x05local\x00\x00\x0c\x80\x01'))
Scan Results
========================================

How to reproduce the bug?

brew install pyenv
arch -x86_64 pyenv install 3.9.6
PYENV_VERSION=3.9.6 pyenv exec python -m venv env
./env/bin/pip install --upgrade pip
./env/bin/pip install websockets "pyatv==0.16.0"

./env/bin/atvremote scan --debug --mdns-debug

What is expected behavior?

The scan should return results for both virtual environments.

Operating System

macOS (arm64)

Python

3.9

pyatv

0.16.0

Device

Apple TV 4K (gen 2), tvOS 18.1

Additional context

Packages installed in both virtual environments

Package                    Version
-------------------------- ----------
aiohappyeyeballs           2.4.4
aiohttp                    3.11.11
aiosignal                  1.3.2
annotated-types            0.7.0
async-timeout              5.0.1
attrs                      24.3.0
certifi                    2024.12.14
cffi                       1.17.1
chacha20poly1305-reuseable 0.13.2
charset-normalizer         3.4.1
cryptography               44.0.0
frozenlist                 1.5.0
idna                       3.10
ifaddr                     0.2.0
miniaudio                  1.61
multidict                  6.1.0
pip                        24.3.1
propcache                  0.2.1
protobuf                   5.29.2
pyatv                      0.16.0
pycparser                  2.22
pydantic                   2.10.4
pydantic_core              2.27.2
requests                   2.32.3
setuptools                 56.0.0
six                        1.17.0
srptools                   1.0.1
tabulate                   0.9.0
tinytag                    2.0.0
typing_extensions          4.12.2
urllib3                    2.3.0
websockets                 14.1
yarl                       1.18.3
zeroconf                   0.136.2
@jklewa jklewa added the bug label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant