From c88dca4405454843e4647a2b61f6b4e236e12df5 Mon Sep 17 00:00:00 2001 From: maxtaran2010 Date: Wed, 8 Jul 2026 12:30:24 +0300 Subject: [PATCH] fix: correct typos in comments, docstrings, and docs - pypdf/_font.py: "obect" -> "object" in inline comment - tests/test_writer.py: "emtpy" -> "empty" in docstring - tests/test_reader.py: "rebuiling" -> "rebuilding" in docstring - docs/dev/documentation.md: "requrements" -> "requirements" --- docs/dev/documentation.md | 2 +- pypdf/_font.py | 2 +- tests/test_reader.py | 2 +- tests/test_writer.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/dev/documentation.md b/docs/dev/documentation.md index b70cba5e3e..74b16353d7 100644 --- a/docs/dev/documentation.md +++ b/docs/dev/documentation.md @@ -27,7 +27,7 @@ It is also possible to run it locally: ``` 3. Run `doctest` build. It uses indirectly `sphinx-build` command line tool - installed with docs requrements. See + installed with docs requirements. See [Sphinx's docs](https://www.sphinx-doc.org/en/master/usage/quickstart.html#running-the-build) for details. diff --git a/pypdf/_font.py b/pypdf/_font.py index caafa3ec2e..782759706d 100644 --- a/pypdf/_font.py +++ b/pypdf/_font.py @@ -655,7 +655,7 @@ def as_font_resource(self) -> DictionaryObject: # If we have an embedded Truetype font, we assume that we need to produce a Type 2 CID font resource. if self.font_descriptor.font_file and self.sub_type == "TrueType": # Begin with creating the widths array (part of the descendant font) and the unicode cmap (part - # of the Type 0 font obect). + # of the Type 0 font object). widths_list, to_unicode_stream = self._create_widths_list_and_unicode_stream() # Create the descendant font object diff --git a/tests/test_reader.py b/tests/test_reader.py index d811f4bb56..964f6a356a 100644 --- a/tests/test_reader.py +++ b/tests/test_reader.py @@ -1852,7 +1852,7 @@ def test_iss2761(): @pytest.mark.enable_socket def test_iss2817(): - """Test for rebuiling Xref_ObjStm""" + """Test for rebuilding Xref_ObjStm""" url = "https://github.com/user-attachments/files/16764070/crash-7e1356f1179b4198337f282304cb611aea26a199.pdf" name = "iss2817.pdf" reader = PdfReader(BytesIO(get_data_from_url(url=url, name=name))) diff --git a/tests/test_writer.py b/tests/test_writer.py index ecdd93fbda..03caa8ecb2 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -1705,7 +1705,7 @@ def test_merge_content_stream_to_page(): """Test that new content data is correctly added to page contents in the form of an ArrayObject or StreamObject. The test_add_apstream_object code already correctly checks that - _merge_content_stream_to_page works for an emtpy page. + _merge_content_stream_to_page works for an empty page. """ writer = PdfWriter() page = writer.add_blank_page(100, 100)