Skip to content

Commit

Permalink
5.3.1
Browse files Browse the repository at this point in the history
- Ignore `UnicodeDecodeError` exceptions when querying for `TXT` records (close #124)
  • Loading branch information
seanthegeek committed Jan 14, 2024
1 parent f09eb1e commit 120ef5a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

5.3.1
-----

- Ignore `UnicodeDecodeError` exceptions when querying for `TXT` records (close #124)

5.3.0
-----

Expand Down
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ cd docs
make clean
make html
touch build/html/.nojekyll
cp -rf build/html/* ../../checkdmarc-docs/
if [ ! -d "../../checkdmarc-docs" ]; then
cp -rf build/html/* ../../checkdmarc-docs/
fi
cd ..
rm -rf dist/ build/
hatch build
2 changes: 1 addition & 1 deletion checkdmarc/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
See the License for the specific language governing permissions and
limitations under the License."""

__version__ = "5.3.0"
__version__ = "5.3.1"

OS = platform.system()
OS_RELEASE = platform.release()
Expand Down
8 changes: 7 additions & 1 deletion checkdmarc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ def query_dns(domain: str, record_type: str, nameservers: list[str] = None,
_resource_record = [
resource_record[0][:0].join(resource_record)
for resource_record in resource_records if resource_record]
records = [r.decode() for r in _resource_record]
records = []
for r in _resource_record:
try:
r = r.decode()
except UnicodeDecodeError:
pass
records.append(r)
else:
records = list(map(
lambda r: r.to_text().replace('"', '').rstrip("."),
Expand Down

0 comments on commit 120ef5a

Please sign in to comment.