diff --git a/pipreqs/__init__.py b/pipreqs/__init__.py index 0491276..79ecee4 100755 --- a/pipreqs/__init__.py +++ b/pipreqs/__init__.py @@ -1,3 +1,3 @@ __author__ = 'Vadim Kravcenko' __email__ = 'vadim.kravcenko@gmail.com' -__version__ = '0.4.11' +__version__ = '0.4.12' diff --git a/pipreqs/pipreqs.py b/pipreqs/pipreqs.py index 24eeeb7..9e6a084 100644 --- a/pipreqs/pipreqs.py +++ b/pipreqs/pipreqs.py @@ -111,7 +111,7 @@ def get_all_imports( candidates += [os.path.splitext(fn)[0] for fn in files] for file_name in files: file_name = os.path.join(root, file_name) - with open(file_name, "r", encoding=encoding) as f: + with open(file_name, "r", encoding=encoding, errors="ignore") as f: contents = f.read() try: tree = ast.parse(contents) @@ -202,7 +202,7 @@ def get_locally_installed_packages(encoding=None): for item in files: if "top_level" in item: item = os.path.join(root, item) - with open(item, "r", encoding=encoding) as f: + with open(item, "r", encoding=encoding, errors="ignore") as f: package = root.split(os.sep)[-1].split("-") try: package_import = f.read().strip().split("\n")