Skip to content

Commit 9d8ea67

Browse files
Merge pull request #396 from TeamMsgExtractor/next-release
Version 0.46.2
2 parents 0c4ad35 + 52e1755 commit 9d8ea67

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
**v0.46.2**
2+
* Adjusted typing information on regular expressions. They were using a subscript that was added in Python 3.9 (apparently that is something the type checker doesn't check for), which made the module incompatible with Python 3.8. If you are using Python 3.9 or higher a version check will switch to the more specific typing.
3+
14
**v0.46.1**
25
* [[TeamMsgExtractor #394](https://github.com/TeamMsgExtractor/msg-extractor/issues/394)] Fix typo in props that caused the wrong number of bytes to be given to a struct.
36

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ your access to the newest major version of extract-msg.
259259
.. |License: GPL v3| image:: https://img.shields.io/badge/License-GPLv3-blue.svg
260260
:target: LICENSE.txt
261261

262-
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.46.1-blue.svg
263-
:target: https://pypi.org/project/extract-msg/0.46.1/
262+
.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.46.2-blue.svg
263+
:target: https://pypi.org/project/extract-msg/0.46.2/
264264

265265
.. |PyPI2| image:: https://img.shields.io/badge/python-3.8+-brightgreen.svg
266266
:target: https://www.python.org/downloads/release/python-3816/

extract_msg/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2828

2929
__author__ = 'Destiny Peterson & Matthew Walker'
30-
__date__ = '2023-11-09'
31-
__version__ = '0.46.1'
30+
__date__ = '2023-11-11'
31+
__version__ = '0.46.2'
3232

3333
__all__ = [
3434
# Modules:

extract_msg/constants/re.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,26 @@
1717
from typing import Final
1818

1919

20+
# Allow better typing in versions above 3.8.
21+
import sys
22+
if sys.version_info >= (3, 9):
23+
_RE_STR_TYPE = re.Pattern[str]
24+
_RE_BYTES_TYPE = re.Pattern[bytes]
25+
else:
26+
_RE_STR_TYPE = re.Pattern
27+
_RE_BYTES_TYPE = re.Pattern
28+
29+
2030
# Characters that are invalid in a filename.
21-
INVALID_FILENAME_CHARS : Final[re.Pattern[str]] = re.compile(r'[\\/:*?"<>|]')
31+
INVALID_FILENAME_CHARS : Final[_RE_STR_TYPE] = re.compile(r'[\\/:*?"<>|]')
2232
# Regular expression to find sections of spaces for htmlSanitize.
23-
HTML_SAN_SPACE : Final[re.Pattern[str]] = re.compile(' +')
33+
HTML_SAN_SPACE : Final[_RE_STR_TYPE] = re.compile(' +')
2434
# Regular expression to find the start of the html body.
25-
HTML_BODY_START : Final[re.Pattern[bytes]] = re.compile(b'<body[^>]*>')
35+
HTML_BODY_START : Final[_RE_BYTES_TYPE] = re.compile(b'<body[^>]*>')
2636
# Regular expression to find the start of the html body in encapsulated RTF.
2737
# This is used for one of the pattern types that makes life easy.
28-
RTF_ENC_BODY_START : Final[re.Pattern[bytes]] = re.compile(br'\{\\\*\\htmltag[0-9]* ?<body[^>]*>\}')
38+
RTF_ENC_BODY_START : Final[_RE_BYTES_TYPE] = re.compile(br'\{\\\*\\htmltag[0-9]* ?<body[^>]*>\}')
2939
# Used in the vaildation of OLE paths. Any of these characters in a name make it
3040
# invalid.
31-
INVALID_OLE_PATH : Final[re.Pattern[str]] = re.compile(r'[:/\\!]')
41+
INVALID_OLE_PATH : Final[_RE_STR_TYPE] = re.compile(r'[:/\\!]')
3242

0 commit comments

Comments
 (0)