diff --git a/docs/conf.py b/docs/conf.py
index 0d0c005..e819dde 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -26,7 +26,7 @@ except pkg_resources.DistributionNotFound:
dist = type("I'm a Version", (object, ), {})
with io.open(join(dirname(__file__), "../setup.py")) as fp:
for line in fp:
- m = re.match("\s*version='([^']+)'\s*", line)
+ m = re.match("\\s*version='([^']+)'\\s*", line)
if m:
dist.version = m.group(1)
break
diff --git a/docs/releasing.rst b/docs/releasing.rst
new file mode 100644
index 0000000..838b425
--- /dev/null
+++ b/docs/releasing.rst
@@ -0,0 +1,5 @@
+Releasing steps
+===============
+
+* Run ``make check``, ``python3 setup.py nosetests``, ``python2 setup.py nosetests``
+* Update version number in ``setup.py`` and ``CHANGES.rst``
diff --git a/isso/config.py b/isso/config.py
index 488224b..917641d 100644
--- a/isso/config.py
+++ b/isso/config.py
@@ -38,7 +38,7 @@ def timedelta(string):
"""
keys = ["weeks", "days", "hours", "minutes", "seconds"]
- regex = "".join(["((?P<%s>\d+)%s ?)?" % (k, k[0]) for k in keys])
+ regex = "".join(["((?P<%s>\\d+)%s ?)?" % (k, k[0]) for k in keys])
kwargs = {}
for k, v in re.match(regex, string).groupdict(default="0").items():
kwargs[k] = int(v)
diff --git a/isso/db/comments.py b/isso/db/comments.py
index 7a44efd..f9575b2 100644
--- a/isso/db/comments.py
+++ b/isso/db/comments.py
@@ -37,7 +37,7 @@ class Comments:
' notification INTEGER DEFAULT 0);'])
try:
self.db.execute(['ALTER TABLE comments ADD COLUMN notification INTEGER DEFAULT 0;'])
- except:
+ except Exception:
pass
def add(self, uri, c):
@@ -137,8 +137,7 @@ class Comments:
for f in fields_comments])
sql_threads_fields = ', '.join(['threads.' + f
for f in fields_threads])
- sql = ['SELECT ' + sql_comments_fields + ', ' +
- sql_threads_fields + ' '
+ sql = ['SELECT ' + sql_comments_fields + ', ' + sql_threads_fields + ' '
'FROM comments INNER JOIN threads '
'ON comments.tid=threads.id '
'WHERE comments.mode = ? ']
diff --git a/isso/ext/notifications.py b/isso/ext/notifications.py
index 0bf1ac1..7d62d72 100644
--- a/isso/ext/notifications.py
+++ b/isso/ext/notifications.py
@@ -69,6 +69,7 @@ class SMTPConnection(object):
def __exit__(self, exc_type, exc_value, traceback):
self.client.quit()
+
class SMTP(object):
def __init__(self, isso):
@@ -165,7 +166,7 @@ class SMTP(object):
for comment_to_notify in comments_to_notify:
email = comment_to_notify["email"]
if "email" in comment_to_notify and comment_to_notify["notification"] and email not in notified \
- and comment_to_notify["id"] != comment["id"] and email != comment["email"]:
+ and comment_to_notify["id"] != comment["id"] and email != comment["email"]:
body = self.format(thread, comment, parent_comment, email, admin=False)
subject = "Re: New comment posted on %s" % thread["title"]
self.sendmail(subject, body, thread, comment, to=email)
diff --git a/isso/migrate.py b/isso/migrate.py
index b63af58..c32a63c 100644
--- a/isso/migrate.py
+++ b/isso/migrate.py
@@ -248,7 +248,7 @@ class WordPress(object):
@classmethod
def detect(cls, peek):
- return re.compile("http://wordpress.org/export/(1\.\d)/").search(peek)
+ return re.compile("http://wordpress.org/export/(1\\.\\d)/").search(peek)
class Generic(object):
diff --git a/isso/tests/test_comments.py b/isso/tests/test_comments.py
index fa32039..3c13b43 100644
--- a/isso/tests/test_comments.py
+++ b/isso/tests/test_comments.py
@@ -352,7 +352,7 @@ class TestComments(unittest.TestCase):
self.assertEqual(rv.status_code, 200)
self.assertEqual(rv.headers['ETag'], '"1-2"')
data = rv.data.decode('utf-8')
- data = re.sub('[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]+Z',
+ data = re.sub('[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]+Z',
'2018-04-01T10:00:00Z', data)
self.assertEqual(data, """