lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.17-47-gc5d3bf4

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum branch master updated. 1.17-47-gc5d3bf4



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".

The branch, master has been updated
       via  c5d3bf4a409e2e709dc81c73ab86419e42ab7f14 (commit)
      from  8b5b07af1df45804e82076431906314e64f9be9c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=c5d3bf4a409e2e709dc81c73ab86419e42ab7f14

commit c5d3bf4a409e2e709dc81c73ab86419e42ab7f14
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Oct 23 16:49:14 2022 +0200

    Switch to parse_qs() from urllib.parse
    
    The function was removed from the cgi module in Python 3.8.

diff --git a/online_check/stdnum.wsgi b/online_check/stdnum.wsgi
index 2909c94..62e2d58 100755
--- a/online_check/stdnum.wsgi
+++ b/online_check/stdnum.wsgi
@@ -19,12 +19,12 @@
 
 """Simple WSGI application to check numbers."""
 
-import cgi
 import inspect
 import json
 import os
 import re
 import sys
+import urllib.parse
 
 
 sys.stdout = sys.stderr
@@ -97,7 +97,7 @@ def application(environ, start_response):
         _template = to_unicode(open(os.path.join(basedir, 'template.html'), 
'rt').read())
     is_ajax = environ.get(
         'HTTP_X_REQUESTED_WITH', '').lower() == 'xmlhttprequest'
-    parameters = cgi.parse_qs(environ.get('QUERY_STRING', ''))
+    parameters = urllib.parse.parse_qs(environ.get('QUERY_STRING', ''))
     results = []
     number = ''
     if 'number' in parameters:

-----------------------------------------------------------------------

Summary of changes:
 online_check/stdnum.wsgi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
python-stdnum