Fix scheme handling when location contains colon separator#337
Closed
Fix scheme handling when location contains colon separator#337
Conversation
Co-authored-by: keighrim <9062727+keighrim@users.noreply.github.com>
Co-authored-by: keighrim <9062727+keighrim@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix source MMIF generation bug with --scheme option
Fix scheme handling when location contains colon separator
Nov 19, 2025
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.
urlparse()misinterprets identifiers with colons (e.g.,cpb-aacip-507-v40js9j432:video) as having a URI scheme, causing the code to use the wrong scheme and incorrectly strip characters.Changes
mmif/utils/cli/source.py: Check if parsed scheme matches the provided scheme parameter. When they differ (and it's notfile://), use the scheme parameter with the full location string instead of the misinterpreted components.tests/test_utils_cli.py: Add test case for locations containing colon separators.Example
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/clamsproject/mmif-python/git/refs/tagscurl --silent REDACTED(http block)https://api.github.com/repos/clamsproject/mmif/git/refs/tagscurl --silent REDACTED(http block)https://api.github.com/repos/clamsproject/mmif/tagsexec(compile('''
This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
- It imports setuptools before invoking setup.py, to enable projects that directly
import from
distutils.coreto work with newer packaging standards.- It provides a clear error message when setuptools is not installed.
- It sets
sys.argv[0]to the underlyingsetup.py, when invokingsetup.pysosetuptools doesn't think the script is
-c. This avoids the following warning:manifest_maker: standard file '-c' not found".
- It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize
try:
import setuptools
except ImportError as error:
print(
"ERROR: Can not execute
setup.pysince setuptools is not available in ""the build environment.",
file=sys.stderr,
)
sys.exit(1)
file = %r
sys.argv[0] = file
if os.path.exists(file):
filename = file
with tokenize.open(file) as f:
setup_py_code = f.read()
else:
filename = "<auto-generated setuptools caller>"
setup_py_code = "from setuptools import setup; setup()"
exec(compile(setup_py_code, filename, "exec"))
''' % ('/home/REDACTED/work/mmif-python/mmif-python/setup.py',), "<pip-setuptools-caller>", "exec")) develop --no-deps --user --prefix=` (http block)
Original prompt
--schemeoption #334💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.