oracle / oracle/oci-cli

bad character range t-c at position

Open
#602 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

SDK
Dominant language
Python
Stars
669
Forks
236
Avg merge
1m
Merged PRs (30d)
4

Description

oci.exe --auth instance_principal compute instance update --instance-id $instance_id --freeform-tags $freeform_tags_json --force
where
$freeform_tags_json = '{"ChefRunlist":"role[ljk-winlogbeat-core]"}'
fails
Traceback (most recent call last):
File "C:\Users\cloudbase-init\Python\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\cloudbase-init\Python\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\cloudbase-init\bin\oci.exe_main
.py", line 7, in
File "c:\users\cloudbase-init\lib\oracle-cli\lib\site-packages\click\core.py", line 1128, in call
return self.main(*args, **kwargs)
File "c:\users\cloudbase-init\lib\oracle-cli\lib\site-packages\click\core.py", line 1040, in main
args = _expand_args(args)
File "c:\users\cloudbase-init\lib\oracle-cli\lib\site-packages\click\utils.py", line 581, in _expand_args
matches = glob(arg, recursive=glob_recursive)
File "C:\Users\cloudbase-init\Python\lib\glob.py", line 21, in glob
return list(iglob(pathname, recursive=recursive))
File "C:\Users\cloudbase-init\Python\lib\glob.py", line 57, in _iglob
yield from _glob1(dirname, basename, dironly)
File "C:\Users\cloudbase-init\Python\lib\glob.py", line 85, in _glob1
return fnmatch.filter(names, pattern)
File "C:\Users\cloudbase-init\Python\lib\fnmatch.py", line 52, in filter
match = _compile_pattern(pat)
File "C:\Users\cloudbase-init\Python\lib\fnmatch.py", line 46, in _compile_pattern
return re.compile(res).match
File "C:\Users\cloudbase-init\Python\lib\re.py", line 252, in compile
return _compile(pattern, flags)
File "C:\Users\cloudbase-init\Python\lib\re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
File "C:\Users\cloudbase-init\Python\lib\sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "C:\Users\cloudbase-init\Python\lib\sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "C:\Users\cloudbase-init\Python\lib\sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "C:\Users\cloudbase-init\Python\lib\sre_parse.py", line 834, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
File "C:\Users\cloudbase-init\Python\lib\sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "C:\Users\cloudbase-init\Python\lib\sre_parse.py", line 598, in _parse
raise source.error(msg, len(this) + 1 + len(that))
re.error: bad character range t-c at position 39

Environment: Windows Server 2016 Powershell

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Click's argument expansion at click/core.py _expand_args, then follow the glob and fnmatch calls shown in the traceback. Reproduce the Windows PowerShell command with the freeform tag value and determine how bracket characters are interpreted. Done means the command no longer fails with the regular-expression character-range error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.