Skip to content

ComposeFile is stuck by a specific docker compose file #37

@horihiro

Description

@horihiro

I tried ComposeFile with the following docker compose file, then the command was stuck.
https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml

Code for reproduction is :

from pycomposefile import ComposeFile

def load_yaml_file(file_name):
    import yaml
    import errno

    try:
        with open(file_name) as stream:  # pylint: disable=unspecified-encoding
            return yaml.safe_load(stream.read().replace('\x00', ''))
    except OSError as ex:
        if getattr(ex, 'errno', 0) == errno.ENOENT:
            raise ValidationError('{} does not exist'.format(file_name)) from ex
        raise
    except (yaml.parser.ParserError, UnicodeDecodeError) as ex:
        raise ValidationError('Error parsing {} ({})'.format(file_name, str(ex))) from ex

parsed_compose_file = ComposeFile(load_yaml_file("./docker-compose.yaml"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions