diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0e4d349..6495b41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,17 +32,20 @@ jobs: # Important for versioning plugins: fetch-depth: 0 - - name: Install ripgrep + - name: Install ripgrep (Linux and macOS) + if: runner.os != 'Windows' run: | if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then sudo apt-get update sudo apt-get install -y ripgrep elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then brew install ripgrep - elif [[ "${{ matrix.os }}" == "windows-latest" ]]; then - choco install ripgrep fi + - name: Install ripgrep (Windows) + if: runner.os == 'Windows' + run: choco install ripgrep + - name: Install uv (official Astral action) uses: astral-sh/setup-uv@v5 with: diff --git a/src/used_addr_check/scan_file.py b/src/used_addr_check/scan_file.py index 22259ef..b6de052 100644 --- a/src/used_addr_check/scan_file.py +++ b/src/used_addr_check/scan_file.py @@ -28,8 +28,7 @@ def _extract_addresses_from_file_python_re(text_file_path: Path) -> List[str]: # TODO: could do this in chunks if we wanted, but using ripgrep instead logger.info("Using Python regex search") - with text_file_path.open("r") as file: - results = re.findall(BITCOIN_ADDR_REGEX, file.read()) + results = re.findall(BITCOIN_ADDR_REGEX, text_file_path.read_text(encoding="utf-8")) return [result[0] for result in results]