Hello community,

here is the log from the commit of package python-validators for 
openSUSE:Factory checked in at 2019-12-11 12:10:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-validators (Old)
 and      /work/SRC/openSUSE:Factory/.python-validators.new.4691 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-validators"

Wed Dec 11 12:10:22 2019 rev:8 rq:754542 version:0.14.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-validators/python-validators.changes      
2019-09-23 12:03:20.525945674 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-validators.new.4691/python-validators.changes
    2019-12-11 12:11:27.476580524 +0100
@@ -1,0 +2,7 @@
+Thu Dec  5 23:15:30 UTC 2019 - Martin Herkt <[email protected]>
+
+- Update to 0.14.1:
+  * Updated domain validator regex to not allow numeric only TLDs
+  * Allow for idna encoded domains
+
+-------------------------------------------------------------------

Old:
----
  validators-0.14.0.tar.gz

New:
----
  validators-0.14.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-validators.spec ++++++
--- /var/tmp/diff_new_pack.DBWnhT/_old  2019-12-11 12:11:29.788579552 +0100
+++ /var/tmp/diff_new_pack.DBWnhT/_new  2019-12-11 12:11:29.792579550 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-validators
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-validators
-Version:        0.14.0
+Version:        0.14.1
 Release:        0
 Summary:        Python Data Validation
 License:        MIT

++++++ validators-0.14.0.tar.gz -> validators-0.14.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validators-0.14.0/CHANGES.rst 
new/validators-0.14.1/CHANGES.rst
--- old/validators-0.14.0/CHANGES.rst   2019-08-21 09:50:01.000000000 +0200
+++ new/validators-0.14.1/CHANGES.rst   2019-12-04 18:50:10.000000000 +0100
@@ -2,6 +2,13 @@
 ---------
 
 
+0.14.1 (2019-12-04)
+^^^^^^^^^^^^^^^^^^^
+
+- Updated domain validator regex to not allow numeric only TLDs (#133, pull 
request courtesy jmeridth)
+- Allow for idna encoded domains (#133, pull request courtesy jmeridth)
+
+
 0.14.0 (2019-08-21)
 ^^^^^^^^^^^^^^^^^^^
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validators-0.14.0/PKG-INFO 
new/validators-0.14.1/PKG-INFO
--- old/validators-0.14.0/PKG-INFO      2019-08-21 09:54:05.000000000 +0200
+++ new/validators-0.14.1/PKG-INFO      2019-12-04 18:55:00.000000000 +0100
@@ -1,11 +1,11 @@
 Metadata-Version: 2.1
 Name: validators
-Version: 0.14.0
+Version: 0.14.1
 Summary: Python Data Validation for Humans™.
 Home-page: https://github.com/kvesteri/validators
 Author: Konsta Vesterinen
 Author-email: [email protected]
-License: BSD
+License: MIT
 Description: 
         validators
         ----------
@@ -15,7 +15,7 @@
 Platform: any
 Classifier: Environment :: Web Environment
 Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
+Classifier: License :: OSI Approved :: MIT License
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python
 Classifier: Programming Language :: Python :: 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validators-0.14.0/setup.py 
new/validators-0.14.1/setup.py
--- old/validators-0.14.0/setup.py      2018-11-13 13:33:50.000000000 +0100
+++ new/validators-0.14.1/setup.py      2019-09-19 11:43:15.000000000 +0200
@@ -41,7 +41,7 @@
     name='validators',
     version=get_version(),
     url='https://github.com/kvesteri/validators',
-    license='BSD',
+    license='MIT',
     author='Konsta Vesterinen',
     author_email='[email protected]',
     description='Python Data Validation for Humans™.',
@@ -56,7 +56,7 @@
     classifiers=[
         'Environment :: Web Environment',
         'Intended Audience :: Developers',
-        'License :: OSI Approved :: BSD License',
+        'License :: OSI Approved :: MIT License',
         'Operating System :: OS Independent',
         'Programming Language :: Python',
         'Programming Language :: Python :: 2',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validators-0.14.0/tests/test_domain.py 
new/validators-0.14.1/tests/test_domain.py
--- old/validators-0.14.0/tests/test_domain.py  2019-05-08 08:46:23.000000000 
+0200
+++ new/validators-0.14.1/tests/test_domain.py  2019-12-04 12:06:42.000000000 
+0100
@@ -13,7 +13,9 @@
     '3.cn',
     'a.cn',
     'sub1.sub2.sample.co.uk',
-    'somerandomexample.xn--fiqs8s'
+    'somerandomexample.xn--fiqs8s',
+    'kräuter.com',
+    'über.com'
 ])
 def test_returns_true_on_valid_domain(value):
     assert domain(value)
@@ -29,7 +31,11 @@
     '_example.com',
     'example_.com',
     'example',
-    'a......b.com'
+    'a......b.com',
+    'a.123',
+    '123.123',
+    '123.123.123',
+    '123.123.123.123'
 ])
 def test_returns_failed_validation_on_invalid_domain(value):
     assert isinstance(domain(value), ValidationFailure)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validators-0.14.0/validators/__init__.py 
new/validators-0.14.1/validators/__init__.py
--- old/validators-0.14.0/validators/__init__.py        2019-08-21 
09:50:09.000000000 +0200
+++ new/validators-0.14.1/validators/__init__.py        2019-12-04 
18:49:36.000000000 +0100
@@ -19,4 +19,4 @@
            'ipv4_cidr', 'ipv6', 'ipv6_cidr', 'length', 'mac_address', 'slug',
            'truthy', 'url', 'ValidationFailure', 'validator', 'uuid')
 
-__version__ = '0.14.0'
+__version__ = '0.14.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validators-0.14.0/validators/domain.py 
new/validators-0.14.1/validators/domain.py
--- old/validators-0.14.0/validators/domain.py  2019-05-08 08:46:23.000000000 
+0200
+++ new/validators-0.14.1/validators/domain.py  2019-12-04 12:06:42.000000000 
+0100
@@ -1,15 +1,31 @@
 import re
 
+import six
+
 from .utils import validator
 
+if six.PY3:
+    text_type = str
+    unicode = str
+else:
+    text_type = unicode
+
 pattern = re.compile(
     r'^(?:[a-z0-9]'  # First character of the domain
     r'(?:[a-z0-9-_]{0,61}[a-z0-9])?\.)'  # Sub domain + hostname
     r'+[a-z0-9][a-z0-9-_]{0,61}'  # First 61 characters of the gTLD
-    r'[a-z0-9]$'  # Last character of the gTLD
+    r'[a-z]$'  # Last character of the gTLD
 )
 
 
+def to_unicode(obj, charset='utf-8', errors='strict'):
+    if obj is None:
+        return None
+    if not isinstance(obj, bytes):
+        return text_type(obj)
+    return obj.decode(charset, errors)
+
+
 @validator
 def domain(value):
     """
@@ -40,4 +56,7 @@
 
     :param value: domain string to validate
     """
-    return pattern.match(value)
+    try:
+        return pattern.match(to_unicode(value).encode('idna').decode('ascii'))
+    except UnicodeError:
+        return False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/validators-0.14.0/validators.egg-info/PKG-INFO 
new/validators-0.14.1/validators.egg-info/PKG-INFO
--- old/validators-0.14.0/validators.egg-info/PKG-INFO  2019-08-21 
09:54:05.000000000 +0200
+++ new/validators-0.14.1/validators.egg-info/PKG-INFO  2019-12-04 
18:55:00.000000000 +0100
@@ -1,11 +1,11 @@
 Metadata-Version: 2.1
 Name: validators
-Version: 0.14.0
+Version: 0.14.1
 Summary: Python Data Validation for Humans™.
 Home-page: https://github.com/kvesteri/validators
 Author: Konsta Vesterinen
 Author-email: [email protected]
-License: BSD
+License: MIT
 Description: 
         validators
         ----------
@@ -15,7 +15,7 @@
 Platform: any
 Classifier: Environment :: Web Environment
 Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
+Classifier: License :: OSI Approved :: MIT License
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python
 Classifier: Programming Language :: Python :: 2


Reply via email to