Hello community,
here is the log from the commit of package python-email_validator for
openSUSE:Factory checked in at 2020-10-25 18:08:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-email_validator (Old)
and /work/SRC/openSUSE:Factory/.python-email_validator.new.3463 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-email_validator"
Sun Oct 25 18:08:38 2020 rev:7 rq:835159 version:1.1.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-email_validator/python-email_validator.changes
2020-05-28 09:09:33.612059341 +0200
+++
/work/SRC/openSUSE:Factory/.python-email_validator.new.3463/python-email_validator.changes
2020-10-25 18:08:42.243463625 +0100
@@ -1,0 +2,8 @@
+Thu Sep 17 11:02:14 UTC 2020 - Dirk Mueller <[email protected]>
+
+- update to 1.1.1:
+ * Fix exception on DNS timeout
+ * Mention Punycode in the README
+ * Flake8 fixes
+
+-------------------------------------------------------------------
Old:
----
v1.1.0.tar.gz
New:
----
v1.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-email_validator.spec ++++++
--- /var/tmp/diff_new_pack.lLk6hK/_old 2020-10-25 18:08:42.815464166 +0100
+++ /var/tmp/diff_new_pack.lLk6hK/_new 2020-10-25 18:08:42.819464170 +0100
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-email_validator
-Version: 1.1.0
+Version: 1.1.1
Release: 0
Summary: A robust email syntax and deliverability validation library
for Python
License: CC0-1.0
++++++ v1.1.0.tar.gz -> v1.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-email-validator-1.1.0/Makefile
new/python-email-validator-1.1.1/Makefile
--- old/python-email-validator-1.1.0/Makefile 2020-04-30 18:50:19.000000000
+0200
+++ new/python-email-validator-1.1.1/Makefile 2020-05-19 13:15:08.000000000
+0200
@@ -9,7 +9,7 @@
.PHONY: lint
lint:
#python setup.py check -rms
- flake8 email_validator tests
+ flake8 --ignore=E501,E126 email_validator tests
.PHONY: test
test:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-email-validator-1.1.0/README.md
new/python-email-validator-1.1.1/README.md
--- old/python-email-validator-1.1.0/README.md 2020-04-30 18:50:19.000000000
+0200
+++ new/python-email-validator-1.1.1/README.md 2020-05-19 13:15:08.000000000
+0200
@@ -26,15 +26,15 @@
if you need strict validation against the email specs exactly, use
[pyIsEmail](https://github.com/michaelherold/pyIsEmail).
-This library was first published in 2015. The current version is 1.1.0
-(posted April 30, 2020). **In this version, the type of the value returned
+This library was first published in 2015. The current version is 1.1.1
+(posted May 19, 2020). **Starting in version 1.1.0, the type of the value
returned
from `validate_email` has changed, but dict-style access to the validated
address information still works, so it is backwards compatible.**
Installation
------------
-This package is on PyPI, so:
+This package [is on PyPI](https://pypi.org/project/email-validator/), so:
```sh
pip install email_validator
@@ -141,8 +141,8 @@
The first is [internationalized domain names (RFC
5891)](https://tools.ietf.org/html/rfc5891), a.k.a IDNA 2008. The DNS
-system has not been updated with Unicode support. Instead,
-internationalized domain names are converted into a special IDNA ASCII
+system has not been updated with Unicode support. Instead, internationalized
+domain names are converted into a special IDNA ASCII
"[Punycode](https://www.rfc-editor.org/rfc/rfc3492.txt)"
form starting with `xn--`. When an email address has non-ASCII
characters in its domain part, the domain part is replaced with its IDNA
ASCII equivalent form in the process of mail transmission. Your mail
@@ -279,7 +279,7 @@
internationalized because
[SMTPUTF8](https://tools.ietf.org/html/rfc6531) is only needed if the
local part of the address is internationalized (the domain part can be
-converted to IDNA ASCII). Also note that the `email` and `domain`
+converted to IDNA ASCII Punycode). Also note that the `email` and `domain`
fields provide a normalized form of the email address and domain name
(casefolding and Unicode normalization as required by IDNA 2008).
@@ -314,7 +314,8 @@
fields (see below).
`ascii_email`: If set, an ASCII-only form of the email address by replacing the
- domain part with [IDNA ASCII](https://tools.ietf.org/html/rfc5891).
+ domain part with [IDNA](https://tools.ietf.org/html/rfc5891)
+ [Punycode](https://www.rfc-editor.org/rfc/rfc3492.txt).
This field will be present when an ASCII-only form of the email
address exists (including if the email address is already ASCII). If
the local part of the email address contains internationalized
@@ -326,16 +327,16 @@
`ascii_local_part`: If set, the local part, which is composed of ASCII
characters only.
-`domain`: The canonical internationalized form of the domain part of the
- address, by round-tripping through IDNA ASCII. If the returned
- string contains non-ASCII characters, either the
+`domain`: The canonical internationalized Unicode form of the domain part of
the
+ email address. If the returned string contains non-ASCII characters,
either the
[SMTPUTF8](https://tools.ietf.org/html/rfc6531) feature of your
mail relay will be required to transmit the message or else the
- email address's domain part must be converted to IDNA ASCII first
- (given in the returned `domain` field).
+ email address's domain part must be converted to IDNA ASCII first: Use
+ `ascii_domain` field instead.
-`ascii_domain`: The [IDNA ASCII](https://tools.ietf.org/html/rfc5891)-encoded
form
- of the domain part of the given email address (after the @-sign), as
+`ascii_domain`: The [IDNA](https://tools.ietf.org/html/rfc5891)
+ [Punycode](https://www.rfc-editor.org/rfc/rfc3492.txt)-encoded
+ form of the domain part of the given email address, as
it would be transmitted on the wire.
`smtputf8`: A boolean indicating that the
@@ -348,12 +349,15 @@
`mx`: A list of (priority, domain) tuples of MX records specified in the
DNS for the domain (see [RFC 5321 section
- 5](https://tools.ietf.org/html/rfc5321#section-5)).
+ 5](https://tools.ietf.org/html/rfc5321#section-5)). May be `None` if
+ the deliverability check could not be completed because of a temporary
+ issue like a timeout.
`mx_fallback_type`: `None` if an `MX` record is found. If no MX records are
actually
specified in DNS and instead are inferred, through an obsolete
mechanism, from A or AAAA records, the value is the type of DNS
- record used instead (`A` or `AAAA`).
+ record used instead (`A` or `AAAA`). May be `None` if the deliverability
check
+ could not be completed because of a temporary issue like a timeout.
Assumptions
-----------
@@ -385,14 +389,13 @@
For Project Maintainers
-----------------------
-The package is distributed as a universal wheel. The wheel is specified
-as universal in the file `setup.cfg` by the `universal = 1` key in the
-`[bdist_wheel]` section.
+The package is distributed as a universal wheel and as a source package.
To release:
* Update the version number.
-* Follow the steps below to publish source and a universal wheel to pypi:
+* Follow the steps below to publish source and a universal wheel to pypi.
+* Make a release at
https://github.com/JoshData/python-email-validator/releases/new.
```sh
pip3 install twine
@@ -403,3 +406,6 @@
git tag v1.0.XXX # replace with version in setup.py
git push --tags
```
+
+Notes: The wheel is specified as universal in the file `setup.cfg` by the
`universal = 1` key in the
+`[bdist_wheel]` section.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-email-validator-1.1.0/email_validator/__init__.py
new/python-email-validator-1.1.1/email_validator/__init__.py
--- old/python-email-validator-1.1.0/email_validator/__init__.py
2020-04-30 18:50:19.000000000 +0200
+++ new/python-email-validator-1.1.1/email_validator/__init__.py
2020-05-19 13:15:08.000000000 +0200
@@ -92,8 +92,8 @@
is False."""
smtputf8 = None
- """If a deliverability check is performed, a list of (priority, domain)
tuples of MX
- records specified in the DNS for the domain."""
+ """If a deliverability check is performed and if it succeeds, a list of
(priority, domain)
+ tuples of MX records specified in the DNS for the domain."""
mx = None
"""If no MX records are actually specified in DNS and instead are
inferred, through an obsolete
@@ -136,25 +136,25 @@
"""Tests use this."""
def __eq__(self, other):
if self.email == other.email and self.local_part == other.local_part
and self.domain == other.domain \
- and self.ascii_email == other.ascii_email and self.ascii_local_part
== other.ascii_local_part \
- and self.ascii_domain == other.ascii_domain \
- and self.smtputf8 == other.smtputf8 \
- and repr(sorted(self.mx) if self.mx else self.mx) ==
repr(sorted(other.mx) if other.mx else other.mx) \
- and self.mx_fallback_type == other.mx_fallback_type:
+ and self.ascii_email == other.ascii_email and self.ascii_local_part
== other.ascii_local_part \
+ and self.ascii_domain == other.ascii_domain \
+ and self.smtputf8 == other.smtputf8 \
+ and repr(sorted(self.mx) if self.mx else self.mx) ==
repr(sorted(other.mx) if other.mx else other.mx) \
+ and self.mx_fallback_type == other.mx_fallback_type:
return True
return False
"""This helps producing the README."""
def as_constructor(self):
return "ValidatedEmail(" \
- + ",".join("\n {}={}".format(
- key,
- repr(getattr(self, key)))
- for key in ('email', 'local_part', 'domain',
- 'ascii_email', 'ascii_local_part',
'ascii_domain',
- 'smtputf8', 'mx', 'mx_fallback_type')
- ) \
- + ")"
+ + ",".join("\n {}={}".format(
+ key,
+ repr(getattr(self, key)))
+ for key in ('email', 'local_part', 'domain',
+ 'ascii_email', 'ascii_local_part',
'ascii_domain',
+ 'smtputf8', 'mx', 'mx_fallback_type')
+ ) \
+ + ")"
def validate_email(
@@ -263,8 +263,9 @@
# Validate the email address's deliverability and update the
# return dict with metadata.
deliverability_info = validate_email_deliverability(ret["domain"],
ret["domain_i18n"], timeout)
- ret.mx = deliverability_info["mx"]
- ret.mx_fallback_type = deliverability_info["mx-fallback"]
+ if "mx" in deliverability_info:
+ ret.mx = deliverability_info["mx"]
+ ret.mx_fallback_type = deliverability_info["mx-fallback"]
return ret
@@ -441,6 +442,12 @@
domain += '.'
try:
+ # We need a way to check how timeouts are handled in the tests. So we
+ # have a secret variable that if set makes this method always test the
+ # handling of a timeout.
+ if getattr(validate_email_deliverability, 'TEST_CHECK_TIMEOUT', False):
+ raise dns.exception.Timeout()
+
resolver = dns.resolver.get_default_resolver()
if timeout:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-email-validator-1.1.0/setup.py
new/python-email-validator-1.1.1/setup.py
--- old/python-email-validator-1.1.0/setup.py 2020-04-30 18:50:19.000000000
+0200
+++ new/python-email-validator-1.1.1/setup.py 2020-05-19 13:15:08.000000000
+0200
@@ -5,7 +5,7 @@
setup(
name='email_validator',
- version='1.1.0',
+ version='1.1.1',
description='A robust email syntax and deliverability validation library
for Python 2.x/3.x.',
long_description=open("README.md", encoding='utf-8').read(),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-email-validator-1.1.0/tests/test_main.py
new/python-email-validator-1.1.1/tests/test_main.py
--- old/python-email-validator-1.1.0/tests/test_main.py 2020-04-30
18:50:19.000000000 +0200
+++ new/python-email-validator-1.1.1/tests/test_main.py 2020-05-19
13:15:08.000000000 +0200
@@ -268,3 +268,12 @@
domain = 'xkxufoekjvjfjeodlfmdfjcu.com'
with pytest.raises(EmailUndeliverableError, match='The domain name {} does
not exist'.format(domain)):
validate_email_deliverability(domain, domain)
+
+
+def test_deliverability_dns_timeout():
+ validate_email_deliverability.TEST_CHECK_TIMEOUT = True
+ response = validate_email_deliverability('gmail.com', 'gmail.com')
+ assert "mx" not in response
+ assert response.get("unknown-deliverability") == "timeout"
+ validate_email('[email protected]')
+ del validate_email_deliverability.TEST_CHECK_TIMEOUT