From 81f2d0b9ee65434737adb44dc339f33585317b2e Mon Sep 17 00:00:00 2001 From: adhavan18 Date: Sun, 6 Dec 2026 10:48:09 +0530 Subject: [PATCH] fix: read README.md and requirements as utf-8 in setup.py README.md has non-cp1252 characters (the trophy emoji), so building from source on windows without utf-8 mode failed with UnicodeDecodeError, e.g. pip install -e . or pip install git+https://github.com/roboflow/roboflow-python. --- setup.py | 6 +++--- setup_slim.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 226d94e5..4e2adc21 100644 --- a/setup.py +++ b/setup.py @@ -3,17 +3,17 @@ import setuptools from setuptools import find_packages -with open("./roboflow/__init__.py") as f: +with open("./roboflow/__init__.py", encoding="utf-8") as f: content = f.read() _search_version = re.search(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', content) assert _search_version version = _search_version.group(1) -with open("README.md") as fh: +with open("README.md", encoding="utf-8") as fh: long_description = fh.read() -with open("requirements.txt") as fh: +with open("requirements.txt", encoding="utf-8") as fh: install_requires = fh.read().split("\n") setuptools.setup( diff --git a/setup_slim.py b/setup_slim.py index 1b2dcc10..d650c157 100644 --- a/setup_slim.py +++ b/setup_slim.py @@ -3,17 +3,17 @@ import setuptools from setuptools import find_packages -with open("./roboflow/__init__.py") as f: +with open("./roboflow/__init__.py", encoding="utf-8") as f: content = f.read() _search_version = re.search(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', content) assert _search_version version = _search_version.group(1) -with open("README.md") as fh: +with open("README.md", encoding="utf-8") as fh: long_description = fh.read() -with open("requirements-slim.txt") as fh: +with open("requirements-slim.txt", encoding="utf-8") as fh: install_requires = fh.read().split("\n") setuptools.setup(