Skip to content

TypeError: expected string or bytes-like object #16

@thugcee

Description

@thugcee

When I try do use it on my docker-compose.yaml file, which is perfectly valid for the docker-compose command, I get:

Traceback (most recent call last):
  File "/home/ser/.local/bin/compose_format", line 35, in <module>
    if not formatter.format(path, replace=args.replace, strict=not args.non_strict):
  File "/home/ser/.local/lib/python3.10/site-packages/compose_format/__init__.py", line 68, in format
    formatted = self.format_string(data, replace=replace, strict=strict)
  File "/home/ser/.local/lib/python3.10/site-packages/compose_format/__init__.py", line 78, in format_string
    data = self.reorder(load(data, RoundTripLoader), strict=strict)
  File "/home/ser/.local/lib/python3.10/site-packages/compose_format/__init__.py", line 99, in reorder
    ComposeFormat.reorder(item, strict)
  File "/home/ser/.local/lib/python3.10/site-packages/compose_format/__init__.py", line 99, in reorder
    ComposeFormat.reorder(item, strict)
  File "/home/ser/.local/lib/python3.10/site-packages/compose_format/__init__.py", line 99, in reorder
    ComposeFormat.reorder(item, strict)
  [Previous line repeated 1 more time]
  File "/home/ser/.local/lib/python3.10/site-packages/compose_format/__init__.py", line 103, in reorder
    data[i] = ComposeFormat.fix_sexadecimal_numbers(value)
  File "/home/ser/.local/lib/python3.10/site-packages/compose_format/__init__.py", line 113, in fix_sexadecimal_numbers
    match = re.match(SEXADECIMAL_NUMBER, value)
  File "/usr/lib/python3.10/re.py", line 190, in match
    return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions