Skip to content

Add an encoding named param for parse_gitignore #70

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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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