Skip to content

Add an encoding named param for parse_gitignore #70

@ricko2001

Description

@ricko2001

For my work, I had to be able to specify utf-8 encoding for the ignore file.
Due to the current craziness about default file encoding, my solution was to do the same as is done in the configparser python standard module. That required a change to 2 lines-

def parse_gitignore(full_path, base_dir=None):
def parse_gitignore(full_path, base_dir=None, *, encoding=None):

and

with open(full_path) as ignore_file:
with open(full_path, encoding=encoding) as ignore_file:

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