[Bf-extensions-cvs] [445ca6f5] master: BlenderKit: fix slugify function to avoid filename bugs with some more characters

Vilem Duha noreply at git.blender.org
Tue Jul 9 00:50:49 CEST 2019


Commit: 445ca6f590a9ecc01b4deabc20074e0f46c090e4
Author: Vilem Duha
Date:   Tue Jul 2 22:21:33 2019 +0200
Branches: master
https://developer.blender.org/rBA445ca6f590a9ecc01b4deabc20074e0f46c090e4

BlenderKit: fix slugify function to avoid filename bugs with some more characters

===================================================================

M	blenderkit/paths.py

===================================================================

diff --git a/blenderkit/paths.py b/blenderkit/paths.py
index 552ccbbd..c2d2ab06 100644
--- a/blenderkit/paths.py
+++ b/blenderkit/paths.py
@@ -137,10 +137,10 @@ def slugify(slug):
     Normalizes string, converts to lowercase, removes non-alpha characters,
     and converts spaces to hyphens.
     """
-
     import unicodedata, re
     slug = slug.lower()
-    slug.replace('.', '_')
+    slug = slug.replace('.', '_')
+    slug = slug.replace('"', '')
     slug = slug.replace(' ', '_')
     # import re
     # slug = unicodedata.normalize('NFKD', slug)



More information about the Bf-extensions-cvs mailing list