From d4130690cb82933b56622d265ffc10e0b887864c Mon Sep 17 00:00:00 2001 From: TheElementalOfDestruction Date: Mon, 31 Jul 2023 06:36:44 -0700 Subject: [PATCH] Fix issue with variable names --- CHANGELOG.md | 4 ++++ README.rst | 4 ++-- extract_msg/__init__.py | 4 ++-- extract_msg/attachments/attachment.py | 2 +- extract_msg/attachments/custom_att.py | 2 +- extract_msg/attachments/emb_msg_att.py | 2 +- extract_msg/constants/re.py | 6 +----- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e2c73bf..2622d4da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +**v0.42.1** +* Fixed some constants being accessed with the wrong name (names were changed in reorganization). +* Removed unused regular expression. + **v0.42.0** * [[TeamMsgExtractor #372](https://github.com/TeamMsgExtractor/msg-extractor/issues/372)] Changed the way that the save functions return a value. This makes the return value from all save functions much more informative, allowing a user to separate if a file or folder (or if more than one) was saved from the function. It also guarantees that all classes from this module will return the relevant path(s) if data is actually saved. * [[TeamMsgExtractor #288](https://github.com/TeamMsgExtractor/msg-extractor/issues/288)] Added feature to allow attachment save functions to simply overwrite existing files of the same name. This can be done with the `overwriteExisting` keyword argument from code or the `--overwrite-existing` option from the command line. diff --git a/README.rst b/README.rst index 647e6761..52b42a8e 100644 --- a/README.rst +++ b/README.rst @@ -242,8 +242,8 @@ your access to the newest major version of extract-msg. .. |License: GPL v3| image:: https://img.shields.io/badge/License-GPLv3-blue.svg :target: LICENSE.txt -.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.42.0-blue.svg - :target: https://pypi.org/project/extract-msg/0.42.0/ +.. |PyPI3| image:: https://img.shields.io/badge/pypi-0.42.1-blue.svg + :target: https://pypi.org/project/extract-msg/0.42.1/ .. |PyPI2| image:: https://img.shields.io/badge/python-3.8+-brightgreen.svg :target: https://www.python.org/downloads/release/python-3816/ diff --git a/extract_msg/__init__.py b/extract_msg/__init__.py index 3b964b71..572e8939 100644 --- a/extract_msg/__init__.py +++ b/extract_msg/__init__.py @@ -27,8 +27,8 @@ # along with this program. If not, see . __author__ = 'Destiny Peterson & Matthew Walker' -__date__ = '2023-07-29' -__version__ = '0.42.0' +__date__ = '2023-07-31' +__version__ = '0.42.1' __all__ = [ # Modules: diff --git a/extract_msg/attachments/attachment.py b/extract_msg/attachments/attachment.py index 2f056a26..72849139 100644 --- a/extract_msg/attachments/attachment.py +++ b/extract_msg/attachments/attachment.py @@ -62,7 +62,7 @@ def getFilename(self, **kwargs) -> str: customFilename = str(customFilename) # First we need to validate it. If there are invalid characters, # this will detect it. - if constants.re.INVALID_FILENAME_CHARACTERS.search(customFilename): + if constants.re.INVALID_FILENAME_CHARS.search(customFilename): raise ValueError('Invalid character found in customFilename. Must not contain any of the following characters: \\/:*?"<>|') filename = customFilename else: diff --git a/extract_msg/attachments/custom_att.py b/extract_msg/attachments/custom_att.py index 93f424e1..9391d5c2 100644 --- a/extract_msg/attachments/custom_att.py +++ b/extract_msg/attachments/custom_att.py @@ -57,7 +57,7 @@ def getFilename(self, **kwargs) -> str: customFilename = str(customFilename) # First we need to validate it. If there are invalid characters, # this will detect it. - if constants.re.INVALID_FILENAME_CHARACTERS.search(customFilename): + if constants.re.INVALID_FILENAME_CHARS.search(customFilename): raise ValueError('Invalid character found in customFilename. Must not contain any of the following characters: \\/:*?"<>|') filename = customFilename else: diff --git a/extract_msg/attachments/emb_msg_att.py b/extract_msg/attachments/emb_msg_att.py index 8ead803a..d5b1728f 100644 --- a/extract_msg/attachments/emb_msg_att.py +++ b/extract_msg/attachments/emb_msg_att.py @@ -52,7 +52,7 @@ def getFilename(self, **kwargs) -> str: customFilename = str(customFilename) # First we need to validate it. If there are invalid characters, # this will detect it. - if constants.re.INVALID_FILENAME_CHARACTERS.search(customFilename): + if constants.re.INVALID_FILENAME_CHARS.search(customFilename): raise ValueError('Invalid character found in customFilename. Must not contain any of the following characters: \\/:*?"<>|') return customFilename else: diff --git a/extract_msg/constants/re.py b/extract_msg/constants/re.py index 0dcd05b9..3300c1b9 100644 --- a/extract_msg/constants/re.py +++ b/extract_msg/constants/re.py @@ -3,10 +3,9 @@ """ __all__ = [ - 'BIN', 'HTML_BODY_START', 'HTML_SAN_SPACE', - 'INVALID_FILENAME_CHARACTERS', + 'INVALID_FILENAME_CHARS', 'INVALID_OLE_PATH', 'RTF_ENC_BODY_START', ] @@ -24,9 +23,6 @@ # Regular expression to find the start of the html body in encapsulated RTF. # This is used for one of the pattern types that makes life easy. RTF_ENC_BODY_START = re.compile(br'\{\\\*\\htmltag[0-9]* ?]*>\}') -# This is used in the workaround for decoding issues in RTFDE. We find `\bin` -# sections and try to remove all of them to help with the decoding. -BIN = re.compile(br'\\bin([0-9]+) ?') # Used in the vaildation of OLE paths. Any of these characters in a name make it # invalid. INVALID_OLE_PATH = re.compile(r'[:/\\!]')