Skip to content

Commit 6ebdac0

Browse files
committed
Add draft user warning
1 parent 7fbbd8e commit 6ebdac0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Diff for: shapefile.py

+23
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
import os
1515
import sys
1616
import tempfile
17+
import textwrap
1718
import time
19+
import warnings
1820
import zipfile
1921
from datetime import date
2022
from struct import Struct, calcsize, error, pack, unpack
@@ -93,6 +95,27 @@
9395
from urllib2 import HTTPError, Request, urlopen
9496
from urlparse import urlparse, urlunparse
9597

98+
if sys.version_info < (3, 9):
99+
warnings.showwarning(
100+
textwrap.dedent("""\
101+
Warning!
102+
103+
The PyShp developers propose to drop support for Pythons 3.8 and earlier, including Python 2.
104+
Thereafter, Python version support will follow the official Python release
105+
cycle: https://devguide.python.org/versions/. This will make Python 3.9 the earliest
106+
supported version until October 2025.
107+
108+
The reasoning behind this is available in the following discussion:
109+
https://github.com./GeospatialPython/pyshp/discussions/290
110+
Please post any feedback there.
111+
112+
Many thanks,
113+
"""),
114+
category=UserWarning,
115+
filename=__name__,
116+
lineno=99,
117+
)
118+
96119

97120
# Helpers
98121

0 commit comments

Comments
 (0)