Skip to content

Commit 67f2ef6

Browse files
committed
Compress the IDNA table
1 parent 83fe2ac commit 67f2ef6

4 files changed

Lines changed: 6 additions & 2475 deletions

File tree

MANIFEST.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
include README.md LICENSE CHANGELOG.md
22
include tox.ini pytest.ini .coveragerc
3-
exclude TODO.md appveyor.yml
3+
exclude TODO.md
4+
exclude .appveyor.yml
45

5-
include src/hyperlink/idna-tables-properties.csv
6+
include src/hyperlink/idna-tables-properties.csv.gz
67

78
graft docs
89
prune docs/_build

src/hyperlink/hypothesis.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from typing import (
1919
Callable, Iterable, List, Optional, Sequence, Text, TypeVar, cast
2020
)
21+
from gzip import open as open_gzip
2122

2223
from . import DecodedURL, EncodedURL
2324

@@ -60,9 +61,9 @@ def idna_characters():
6061
# https://www.iana.org/assignments/idna-tables-6.3.0/
6162
# idna-tables-6.3.0.xhtml#idna-tables-properties
6263
dataFileName = join(
63-
dirname(__file__), "idna-tables-properties.csv"
64+
dirname(__file__), "idna-tables-properties.csv.gz"
6465
)
65-
with open(dataFileName) as dataFile:
66+
with open_gzip(dataFileName, "rt") as dataFile:
6667
reader = csv_reader(dataFile, delimiter=",")
6768
next(reader) # Skip header row
6869
for row in reader:

0 commit comments

Comments
 (0)