From 02d58d440e2f0360be64a9700819e7007d282d85 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 2 Mar 2022 23:19:48 +0000 Subject: [PATCH] WORKING both py3.9.10 & 3.8.10 (dj2.2.25) --- core/TESTS/test_imports.py | 2 +- parsers/people.py | 9 ++++----- requirements-p39.txt | 10 ++++++++++ requirements.txt | 1 - 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 requirements-p39.txt diff --git a/core/TESTS/test_imports.py b/core/TESTS/test_imports.py index 585b0fe..3104a72 100644 --- a/core/TESTS/test_imports.py +++ b/core/TESTS/test_imports.py @@ -51,7 +51,7 @@ class SimpleTest(SimpleTestCase): def test_import_parsers_QMs(self): from troggle.core.models.caves import QM, Cave, LogbookEntry def test_import_parsers_people(self): - from html.parser import HTMLParser + from html import unescape from unidecode import unidecode def test_import_parsers_logbooks(self): from django.template.defaultfilters import slugify diff --git a/parsers/people.py b/parsers/people.py index 3b5efef..2de8e02 100644 --- a/parsers/people.py +++ b/parsers/people.py @@ -1,5 +1,5 @@ import csv, re, datetime, os, shutil -from html.parser import HTMLParser +from html import unescape from unidecode import unidecode from pathlib import Path @@ -141,12 +141,11 @@ def GetPersonExpeditionNameLookup(expedition): #print("Calculating GetPersonExpeditionNameLookup for " + expedition.year) personexpeditions = PersonExpedition.objects.filter(expedition=expedition) - htmlparser = HTMLParser() for personexpedition in personexpeditions: possnames = [ ] - f = unidecode(htmlparser.unescape(personexpedition.person.first_name.lower())) - l = unidecode(htmlparser.unescape(personexpedition.person.last_name.lower())) - full = unidecode(htmlparser.unescape(personexpedition.person.fullname.lower())) + f = unidecode(unescape(personexpedition.person.first_name.lower())) + l = unidecode(unescape(personexpedition.person.last_name.lower())) + full = unidecode(unescape(personexpedition.person.fullname.lower())) if l: possnames.append(f + " " + l) possnames.append(f + " " + l[0]) diff --git a/requirements-p39.txt b/requirements-p39.txt new file mode 100644 index 0000000..e160b2d --- /dev/null +++ b/requirements-p39.txt @@ -0,0 +1,10 @@ +asgiref==3.3.4 +confusable-homoglyphs==3.2.0 +coverage==5.5 +Django==2.2.25 +docutils==0.14 +gunicorn==20.1.0 +pytz==2019.1 +sqlparse==0.2.4 +typing-extensions==3.7.4.3 +Unidecode==1.0.23 diff --git a/requirements.txt b/requirements.txt index 1b7e4cb..e160b2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,6 @@ coverage==5.5 Django==2.2.25 docutils==0.14 gunicorn==20.1.0 -Pillow==5.4.1 pytz==2019.1 sqlparse==0.2.4 typing-extensions==3.7.4.3