PyPI / smart-open / 8.0.4

smart-open 8.0.4

Source
https://github.com/piskvorky/smart_open
Tag scanned
v8.0.4
Compared with
v8.0.3 (0 signals introduced since)
Files
83 scanned, 14 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 46 info
Scan time
6.8 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 12 of 12 warn and critical signals; 12 demoted to info.
Disclude version
4.1.0
Scanned (UTC)
2026-10-22 08:18

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info warn → info by review unicode-homoglyph CHANGELOG.md:558:5

    identifier `Сlose` contains homoglyph candidates: С (0421)→C (raw pass, confidence 0.70)

      - Сlose the old body explicitly after `seek` for `S3`. Fix #187 (PR [#188]https://github.com/RaRe-Technologies/smart_open/pull/188, [@inksink]https://github.com/inksink)
    
    # 1.5.7, 18th March 2018
    likely benign LLM, confidence 0.90 A changelog entry containing a Cyrillic letter that looks like Latin C.
    Reasoning

    The Cyrillic С in 'Сlose' is a homoglyph in a changelog prose line; a typo or copy-paste artifact with no code execution or hiding effect.

  2. info warn → info by review unicode-mixed-script CHANGELOG.md:558:5

    identifier `Сlose` mixes scripts: Cyrillic + Latin (raw pass, confidence 0.80)

      - Сlose the old body explicitly after `seek` for `S3`. Fix #187 (PR [#188]https://github.com/RaRe-Technologies/smart_open/pull/188, [@inksink]https://github.com/inksink)
    
    # 1.5.7, 18th March 2018
    likely benign LLM, confidence 0.90 Same changelog word mixing Cyrillic and Latin letters.
    Reasoning

    Same line as the homoglyph finding; mixed script in a changelog word is a typo-level artifact, not a payload.

  3. info warn → info by review decoder-decompress-payload HOWTO.md:382:31

    [embedded python] file imports decoder module(s) base64, gzip and calls `.decompress()` — embedded payload decompressed at runtime (ast pass, confidence 0.75)

    >>> with open(url, 'rb', transport_params=params) as fin:
    ...     response = json.loads(gzip.decompress(fin.read()))
    >>> response["path"]
    'HOWTO.md'
    likely benign LLM, confidence 0.90 Documentation example decompressing gzip-encoded JSON from a URL.
    Reasoning

    This is documentation showing gzip.decompress on a remote file's JSON response in a doctest-like example; no hidden payload or runtime dropper.

  4. info warn → info by review unicode-homoglyph README.md:513:1

    [embedded python] identifier `В` contains homoglyph candidates: В (0412)→B (raw pass, confidence 0.70)

    ...     print(infile.readline()[:41])
    В начале июля, в чрезвычайно жаркое время
    
    ```
    likely benign LLM, confidence 0.85 Russian text in a README example, flagged as homoglyph.
    Reasoning

    Russian prose text in a README sample that is actually Russian literature text used in an example; the Cyrillic В is legitimate language content, not an identifier obfuscation.

  5. info warn → info by review dynamic-execution ci_helpers/helpers.sh:63:1

    command name is a variable (`$@`) not set in this file — the caller or environment decides what runs (ast pass, confidence 0.70)

    
    "$@"
    likely benign LLM, confidence 0.80 CI helper that executes passed-in command arguments.
    Reasoning

    A helper script that runs its arguments as a command is a standard CI wrapper pattern; the caller controls the command, which is expected for this helper.

  6. info unicode-homoglyph integration-tests/test_azure.py:61:13

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

        key = _FILE_PREFIX + "/sanity.txt"
        text = "с гранатою в кармане, с чекою в руке"  # noqa: RUF001  # Cyrillic fixture
        actual = benchmark(write_read, key, text, "w", "r", encoding="utf-8", transport_params={"client": client})
        assert actual == text
  7. info unicode-homoglyph integration-tests/test_azure.py:61:52

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

        key = _FILE_PREFIX + "/sanity.txt"
        text = "с гранатою в кармане, с чекою в руке"  # noqa: RUF001  # Cyrillic fixture
        actual = benchmark(write_read, key, text, "w", "r", encoding="utf-8", transport_params={"client": client})
        assert actual == text
  8. info warn → info by review decoder-decompress-payload integration-tests/test_ftp.py:94:25

    file imports decoder module(s) gzip and calls `.decompress()` — embedded payload decompressed at runtime (ast pass, confidence 0.75)

        ) as f:
            read_contents = gzip.decompress(f.read()).decode()
            assert read_contents == file_contents + appended_content1
    likely benign LLM, confidence 0.90 Integration test decompressing gzip content to check a file.
    Reasoning

    Test code verifying gzip round-trip content; decompression of test data is ordinary.

  9. info unicode-homoglyph integration-tests/test_gcs.py:52:13

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

        key = _GCS_URL + "/sanity.txt"
        text = "с гранатою в кармане, с чекою в руке"  # noqa: RUF001  # Cyrillic fixture
        actual = benchmark(write_read, key, text, "w", "r", encoding="utf-8")
        assert actual == text
  10. info unicode-homoglyph integration-tests/test_gcs.py:52:52

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

        key = _GCS_URL + "/sanity.txt"
        text = "с гранатою в кармане, с чекою в руке"  # noqa: RUF001  # Cyrillic fixture
        actual = benchmark(write_read, key, text, "w", "r", encoding="utf-8")
        assert actual == text
  11. info unicode-homoglyph integration-tests/test_http.py:25:33

    identifier `В` contains homoglyph candidates: В (0412)→B (in string/comment) (raw pass, confidence 0.35)

                text = fin.read()
            assert text.startswith("В начале июля, в чрезвычайно жаркое время,")  # noqa: RUF001  # Cyrillic fixture
            assert text.endswith("улизнуть, чтобы никто не видал.\n")
  12. info unicode-homoglyph integration-tests/test_http.py:33:33

    identifier `В` contains homoglyph candidates: В (0412)→B (in string/comment) (raw pass, confidence 0.35)

                text = fin.read()
            assert text.startswith("В начале июля, в чрезвычайно".encode())  # noqa: RUF001  # Cyrillic fixture
            assert text.endswith("улизнуть, чтобы никто не видал.\n".encode())
  13. info unicode-homoglyph integration-tests/test_http.py:41:33

    identifier `В` contains homoglyph candidates: В (0412)→B (in string/comment) (raw pass, confidence 0.35)

                text = fin.read()
            assert text.startswith("В начале июля, в чрезвычайно жаркое время,")  # noqa: RUF001  # Cyrillic fixture
            assert text.endswith("улизнуть, чтобы никто не видал.\n")
  14. info unicode-homoglyph integration-tests/test_s3.py:78:13

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

        """Round-trip a text object via smart_open against S3."""
        text = "с гранатою в кармане, с чекою в руке"  # noqa: RUF001  # Cyrillic fixture
        actual = benchmark(write_read, uri, text, "w", "r", "utf-8")
        assert actual == text
  15. info unicode-homoglyph integration-tests/test_s3.py:78:52

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

        """Round-trip a text object via smart_open against S3."""
        text = "с гранатою в кармане, с чекою в руке"  # noqa: RUF001  # Cyrillic fixture
        actual = benchmark(write_read, uri, text, "w", "r", "utf-8")
        assert actual == text
  16. info unicode-homoglyph integration-tests/test_s3.py:151:13

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

        """Round-trip a text object with server-side encryption enabled."""
        text = "с гранатою в кармане, с чекою в руке"  # noqa: RUF001  # Cyrillic fixture
        s3_upload = {"ServerSideEncryption": "AES256"}
  17. info unicode-homoglyph integration-tests/test_s3.py:151:52

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

        """Round-trip a text object with server-side encryption enabled."""
        text = "с гранатою в кармане, с чекою в руке"  # noqa: RUF001  # Cyrillic fixture
        s3_upload = {"ServerSideEncryption": "AES256"}
  18. identifier `о` contains homoglyph candidates: о (043E)→o (in string/comment) (raw pass, confidence 0.35)

            """Ensure that we can wrap a smart_open s3 stream in a BufferedWriter."""
            expected = "не думай о секундах свысока"  # noqa: RUF001  # Cyrillic fixture
    
            with (
  19. info warn → info by review encoding-base64 tests/test_azure.py:39:6

    base64-like blob (74 bytes, compression ratio 1.15) (raw pass, confidence 0.60)

        "AccountName=devstoreaccount1;"
        "AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/"
        "K1SZFPTOtr/KBHBeksoGMGw==;"
        "BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"
    likely benign LLM, confidence 0.90 Public Azurite emulator connection string with a base64 account key.
    Reasoning

    This is the well-known Azurite development storage emulator account key, a public test credential used for local testing, not a secret or obfuscated payload.

  20. info unicode-homoglyph tests/test_azure.py:569:21

    identifier `раcцветали` contains homoglyph candidates: р (0440)→p, а (0430)→a, е (0435)→e, а (0430)→a (in string/comment) (raw pass, confidence 0.35)

            """Read gzip."""
            expected = "раcцветали яблони и груши, поплыли туманы над рекой...".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            buf = io.BytesIO()
  21. info unicode-mixed-script tests/test_azure.py:569:21

    identifier `раcцветали` mixes scripts: Cyrillic + Latin (in string/comment) (raw pass, confidence 0.40)

            """Read gzip."""
            expected = "раcцветали яблони и груши, поплыли туманы над рекой...".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            buf = io.BytesIO()
  22. info unicode-homoglyph tests/test_azure.py:946:21

    identifier `а` contains homoglyph candidates: а (0430)→a (in string/comment) (raw pass, confidence 0.35)

            """Gzip."""
            expected = "а не спеть ли мне песню... о любви".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            blob_name = f"test_gzip_{BLOB_NAME}"
            with (
  23. info unicode-homoglyph tests/test_azure.py:946:66

    identifier `о` contains homoglyph candidates: о (043E)→o (in string/comment) (raw pass, confidence 0.35)

            """Gzip."""
            expected = "а не спеть ли мне песню... о любви".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            blob_name = f"test_gzip_{BLOB_NAME}"
            with (
  24. info unicode-homoglyph tests/test_azure.py:964:37

    identifier `о` contains homoglyph candidates: о (043E)→o (in string/comment) (raw pass, confidence 0.35)

            """Ensure that we can wrap a smart_open azure stream in a `BufferedWriter`."""
            expected = "не думай о секундах свысока"  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            blob_name = f"test_buffered_writer_wrapper_works_{BLOB_NAME}"
  25. info unicode-homoglyph tests/test_azure.py:985:55

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

            """Binary iterator."""
            expected = "выйду ночью в поле с конём".encode().split(b" ")  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            blob_name = f"test_binary_iterator_{BLOB_NAME}"
            put_to_container(blob_name=blob_name, contents=b"\n".join(expected))
  26. info unicode-homoglyph tests/test_azure.py:994:55

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

            """Nonexisting container."""
            expected = "выйду ночью в поле с конём".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            with (
                pytest.raises(azure.core.exceptions.ResourceNotFoundError),
  27. info unicode-homoglyph tests/test_azure.py:1159:21

    identifier `а` contains homoglyph candidates: а (0430)→a (in string/comment) (raw pass, confidence 0.35)

            """Does appending to a gzip-compressed Azure Blob work via smart_open.open?"""
            expected = "а не спеть ли мне песню... о любви".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            blob_name = f"test_append_gzip_{BLOB_NAME}.gz"
  28. info unicode-homoglyph tests/test_azure.py:1159:66

    identifier `о` contains homoglyph candidates: о (043E)→o (in string/comment) (raw pass, confidence 0.35)

            """Does appending to a gzip-compressed Azure Blob work via smart_open.open?"""
            expected = "а не спеть ли мне песню... о любви".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            blob_name = f"test_append_gzip_{BLOB_NAME}.gz"
  29. info unicode-homoglyph tests/test_hdfs.py:84:17

    identifier `В` contains homoglyph candidates: В (0412)→B (in string/comment) (raw pass, confidence 0.35)

    
        expected = "В начале июля, в чрезвычайно жаркое время"  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
        assert text[: len(expected)] == expected
  30. info unicode-homoglyph tests/test_s3.py:389:21

    identifier `раcцветали` contains homoglyph candidates: р (0440)→p, а (0430)→a, е (0435)→e, а (0430)→a (in string/comment) (raw pass, confidence 0.35)

            """Read gzip."""
            expected = "раcцветали яблони и груши, поплыли туманы над рекой...".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            buf = io.BytesIO()
  31. info unicode-mixed-script tests/test_s3.py:389:21

    identifier `раcцветали` mixes scripts: Cyrillic + Latin (in string/comment) (raw pass, confidence 0.40)

            """Read gzip."""
            expected = "раcцветали яблони и груши, поплыли туманы над рекой...".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            buf = io.BytesIO()
  32. info unicode-homoglyph tests/test_s3.py:469:55

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

            """Binary iterator."""
            expected = "выйду ночью в поле с конём".encode().split(b" ")  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            _resource("s3").Object(BUCKET_NAME, KEY_NAME).put(Body=b"\n".join(expected))
  33. info unicode-homoglyph tests/test_s3.py:484:68

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

            """Text iterator."""
            expected = ["выйду", "ночью", "в", "поле", "с", "конём"]  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            uri = f"s3://{BUCKET_NAME}/{KEY_NAME}.gz"
  34. info unicode-homoglyph tests/test_s3.py:662:21

    identifier `а` contains homoglyph candidates: а (0430)→a (in string/comment) (raw pass, confidence 0.35)

            """Gzip."""
            expected = "а не спеть ли мне песню... о любви".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            with (
                smart_open.s3.MultipartWriter(BUCKET_NAME, WRITE_KEY_NAME) as fout,
  35. info unicode-homoglyph tests/test_s3.py:662:66

    identifier `о` contains homoglyph candidates: о (043E)→o (in string/comment) (raw pass, confidence 0.35)

            """Gzip."""
            expected = "а не спеть ли мне песню... о любви".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            with (
                smart_open.s3.MultipartWriter(BUCKET_NAME, WRITE_KEY_NAME) as fout,
  36. info unicode-homoglyph tests/test_s3.py:676:37

    identifier `о` contains homoglyph candidates: о (043E)→o (in string/comment) (raw pass, confidence 0.35)

            """Ensure that we can wrap a smart_open s3 stream in a `BufferedWriter`."""
            expected = "не думай о секундах свысока"  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            with (
                smart_open.s3.MultipartWriter(BUCKET_NAME, WRITE_KEY_NAME) as fout,
  37. info unicode-homoglyph tests/test_s3.py:693:55

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

            """Nonexisting bucket."""
            expected = "выйду ночью в поле с конём".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            with (
                pytest.raises(ValueError, match="does not exist"),
  38. info unicode-homoglyph tests/test_s3.py:901:37

    identifier `о` contains homoglyph candidates: о (043E)→o (in string/comment) (raw pass, confidence 0.35)

            """Ensure that we can wrap a smart_open s3 stream in a `BufferedWriter`."""
            expected = "не думай о секундах свысока"  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            with (
                smart_open.s3.SinglepartWriter(BUCKET_NAME, WRITE_KEY_NAME) as fout,
  39. info unicode-homoglyph tests/test_s3.py:918:55

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

            """Nonexisting bucket."""
            expected = "выйду ночью в поле с конём".encode()  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            with (
                pytest.raises(ValueError, match="does not exist, or is forbidden for access"),
  40. info unicode-homoglyph tests/test_s3.py:987:37

    identifier `о` contains homoglyph candidates: о (043E)→o (in string/comment) (raw pass, confidence 0.35)

            """Test that SinglepartWriter.truncate works."""
            expected = "не думай о секундах свысока"  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            with smart_open.s3.SinglepartWriter(BUCKET_NAME, WRITE_KEY_NAME) as fout:
  41. info warn → info by review dynamic-execution tests/test_smart_open.py:571:53

    `open(__file__)` — file reads its own source, common pattern for extracting payloads hidden in comments (ast pass, confidence 0.85)

    
        @mock.patch("smart_open.ssh.open", return_value=open(__file__))  # noqa: PTH123, SIM115  # test fixture path open
        def test_read_ssh(self, mock_open):
            """Is SSH line iterator called correctly?"""
    likely benign LLM, confidence 0.90 Test mock returning a handle to the test file itself.
    Reasoning

    open(__file__) passed as a mock return value in a test fixture; a benign test idiom with no decoding or execution of hidden content.

  42. info unicode-homoglyph tests/test_smart_open.py:1276:48

    identifier `с` contains homoglyph candidates: с (0441)→c (in string/comment) (raw pass, confidence 0.35)

            """SetUp."""
            self.as_text = "куда идём мы с пятачком - большой большой секрет"  # noqa: RUF001  # fixture deliberately uses Cyrillic characters
            self.as_bytes = self.as_text.encode("utf-8")
            self.stringio = io.StringIO(self.as_text)
  43. info warn → info by review payload-bytes-literal tests/test_smart_open.py:1699:9

    concatenated bytes literal contains 249 `\xNN` escapes (85% of content) — binary payload shape (ast pass, confidence 0.85)

        DATA = (
            b"BZh91AY&SY.\xc8N\x18\x00\x01>_\x80\x00\x10@\x02\xff\xf0\x01\x07n\x00?\xe7\xff\xe00\x01\x99\xaa\x00"
            b"\xc0\x03F\x86\x8c#&\x83F\x9a\x03\x06\xa6\xd0\xa6\x93M\x0fQ\xa7\xa8\x06\x804hh\x12$\x11\xa4i4\xf14S"
    likely benign LLM, confidence 0.85 Test fixture containing bz2-compressed bytes.
    Reasoning

    A bz2-compressed test data literal (BZh header) is expected test fixture content for compression tests; binary escapes are normal for compressed sample data.

  44. info warn → info by review dynamic-execution tests/test_smart_open.py:1821:60

    `open(__file__)` — file reads its own source, common pattern for extracting payloads hidden in comments (ast pass, confidence 0.85)

    
            with mock.patch("smart_open.s3.open", return_value=open(__file__, "rb")) as mock_open:  # noqa: PTH123  # test fixture path open
                smart_open.open("s3://bucket/key.gz", "wb")
                mock_open.assert_called_with("bucket", "key.gz", "wb")
    likely benign LLM, confidence 0.90 Test mock returning the test file handle for an S3 write.
    Reasoning

    Same benign test mock pattern using open(__file__) as a fixture return value.

  45. info warn → info by review dynamic-execution tests/test_smart_open.py:1837:60

    `open(__file__)` — file reads its own source, common pattern for extracting payloads hidden in comments (ast pass, confidence 0.85)

    
            with mock.patch("smart_open.s3.open", return_value=open(__file__)) as mock_open:  # noqa: PTH123  # test fixture path open
                smart_open.open(key, "r")
                mock_open.assert_called_with("bucket", "key.gz", "rb")
    likely benign LLM, confidence 0.90 Test mock returning the test file handle for an S3 read.
    Reasoning

    Benign test mock using open(__file__) as the return value of a patched open; no payload extraction.

  46. info warn → info by review decoder-decompress-payload tests/test_smart_open.py:1987:12

    file imports decoder module(s) bz2, gzip and calls `.decompress()` — embedded payload decompressed at runtime (ast pass, confidence 0.75)

        initialize_bucket()
        assert gzip.decompress(gzip_compress(_DECOMPRESSED_DATA)) == _DECOMPRESSED_DATA
    likely benign LLM, confidence 0.90 Test asserting gzip compress/decompress round-trip.
    Reasoning

    A round-trip assertion that compresses then decompresses test data in a unit test; no hidden payload.

Reproduce This Scan

Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.1.0
git clone https://github.com/piskvorky/smart_open smart_open && cd smart_open
git checkout v8.0.4
disclude scan --severity info --diff v8.0.3 .