From f2ebdff5c2cb70ea6aae6c390e68fdeb3c65303d Mon Sep 17 00:00:00 2001 From: Nils <> Date: Fri, 9 Jul 2021 00:31:21 +0200 Subject: [PATCH] fix rare hostname lookup crash where case sensitivity is important --- template/.gitignore | 128 ------------------------------------ template/qtgui/nsmclient.py | 5 +- 2 files changed, 3 insertions(+), 130 deletions(-) delete mode 100644 template/.gitignore diff --git a/template/.gitignore b/template/.gitignore deleted file mode 100644 index 2e906ba..0000000 --- a/template/.gitignore +++ /dev/null @@ -1,128 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - - -#Build -*.bin -*.build -build/ -Makefile -site-packages -calfbox/.deps -calfbox/build -calfbox/autom4te.cache -calfbox/Makefile.in -calfbox/aclocal.m4 -calfbox/compile -calfbox/config.h -calfbox/config.h.in -calfbox/config.h.in~ -calfbox/config.status -calfbox/configure -calfbox/depcomp -calfbox/install-sh -calfbox/ltmain.sh -calfbox/missing -calfbox/stamp-h1 diff --git a/template/qtgui/nsmclient.py b/template/qtgui/nsmclient.py index e922ed9..fac7cad 100644 --- a/template/qtgui/nsmclient.py +++ b/template/qtgui/nsmclient.py @@ -4,7 +4,7 @@ PyNSMClient - A New Session Manager Client-Library in one file. The Non-Session-Manager by Jonathan Moore Liles : http://non.tuxfamily.org/nsm/ -New Session Manager, by LinuxAudio.org: https://github.com/linuxaudio/new-session-manager +New Session Manager by Nils Hilbricht et al https://new-session-manager.jackaudio.org With help from code fragments from https://github.com/attwad/python-osc ( DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE v2 ) MIT License @@ -387,7 +387,8 @@ class NSMClient(object): else: #osc.udp://hostname:portnumber/ o = urlparse(nsmOSCUrl) - return o.hostname, o.port + #return o.hostname, o.port #this always make the hostname lowercase. usually it does not matter, but we got crash reports. Alternative: + return o.netloc.split(":")[0], o.port def getExecutableName(self): """Finding the actual executable name can be a bit hard