Skip to content

Commit 1fae783

Browse files
committed
Py2/3 compatibility: Added __future__ import and an explicit encoding scheme, not relying on py3's implicit utf-8
- Legacy-Id: 16447
1 parent 2d7c962 commit 1fae783

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ietf/nomcom/fields.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Copyright The IETF Trust 2012-2019, All Rights Reserved
2+
# -*- coding: utf-8 -*-
3+
4+
5+
from __future__ import absolute_import, print_function, unicode_literals
6+
27
from django.conf import settings
38
from django.db import models
49
from django.utils.encoding import smart_str
@@ -20,7 +25,7 @@ def pre_save(self, instance, add):
2025
raise ValueError("Trying to read the NomCom public key: " + str(e))
2126

2227
command = "%s smime -encrypt -in /dev/stdin %s" % (settings.OPENSSL_COMMAND, cert_file)
23-
code, out, error = pipe(command, comments.encode())
28+
code, out, error = pipe(command, comments.encode('utf-8'))
2429
if code != 0:
2530
log("openssl error: %s:\n Error %s: %s" %(command, code, error))
2631
if not error:

0 commit comments

Comments
 (0)