-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
12 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
# SPDX-FileCopyrightText: 2023 geisserml <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause | ||
|
||
import os | ||
import io | ||
import re | ||
import shutil | ||
import tempfile | ||
import traceback | ||
from pathlib import Path | ||
import PIL.Image | ||
from os.path import join, abspath | ||
import pypdfium2 as pdfium | ||
import pypdfium2.raw as pdfium_c | ||
import pytest | ||
|
@@ -126,15 +124,15 @@ def test_open_encrypted(): | |
def test_open_nonascii(): | ||
|
||
tempdir = tempfile.TemporaryDirectory(prefix="pypdfium2_") | ||
nonascii_file = join(tempdir.name, "tên file chứakýtự éèáàçß 发短信.pdf") | ||
nonascii_file = Path(tempdir.name) / "tên file chứakýtự éèáàçß 发短信.pdf" | ||
shutil.copy(TestFiles.render, nonascii_file) | ||
|
||
pdf = pdfium.PdfDocument(nonascii_file) | ||
_check_general(pdf) | ||
|
||
# FIXME cleanup permission error on Windows | ||
try: | ||
os.remove(nonascii_file) | ||
nonascii_file.unlink() | ||
tempdir.cleanup() | ||
except Exception: | ||
traceback.print_exc() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# SPDX-FileCopyrightText: 2023 geisserml <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause | ||
|
||
import io | ||
import re | ||
import math | ||
import numpy | ||
import PIL.Image | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters