Fix RemoteScriptError in clip_slot callback (logger.info format args)#213
Open
fortunto2 wants to merge 1 commit into
Open
Fix RemoteScriptError in clip_slot callback (logger.info format args)#213fortunto2 wants to merge 1 commit into
fortunto2 wants to merge 1 commit into
Conversation
`Logger.info()` expects a format string as its first argument, but the
clip_slot callback passed three values (two ints + the return value):
self.logger.info(track_index, clip_index, rv)
This raises `TypeError: not all arguments converted during string
formatting` while emitting the record, so a full RemoteScriptError
traceback is written to Live's Log.txt on every `/live/clip_slot/...`
message (get / start_listen / fire / stop). Subscribing to many clip
slots floods the log and stalls Live + the controller at startup.
Use a proper format string instead. device.py has no such line and
track.py / scene.py already use %-formatting — clip_slot.py was the
only handler affected.
Fixes ideoforms#212
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #212.
clip_slot.py'sclip_slot_callbacklogs with:Logger.info()treats its first argument as a format string, so passing three values raisesTypeError: not all arguments converted during string formattingwhile emitting the record — a fullRemoteScriptErrortraceback is written to Live'sLog.txton every/live/clip_slot/...message (get/start_listen/fire/stop).Controllers that subscribe to many clip slots (to mirror
is_playing/is_triggeredacross a grid) therefore flood the log and noticeably stall Live and the controller at startup.This one-line change uses a proper format string:
device.py's equivalent callback has no such line, andtrack.py/scene.pyalready use%-formatted strings, soclip_slot.pywas the only affected handler.