From: Radek Czajka Date: Tue, 15 Nov 2011 11:55:22 +0000 (+0100) Subject: fix X-Git-Url: https://git.mdrn.pl/turniej.git/commitdiff_plain/c9d036f4b17b01b352e3a1d20b31fac6fff9b26b?ds=sidebyside fix --- diff --git a/apps/poetry/models.py b/apps/poetry/models.py index 39f3e05..244538a 100644 --- a/apps/poetry/models.py +++ b/apps/poetry/models.py @@ -25,9 +25,11 @@ class Poet(models.Model): def write(self): curdir = os.getcwd() os.chdir(os.path.dirname(self.path)) - text = subprocess.check_output(self.path).decode("utf-8") + proc = subprocess.Popen(self.path, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) os.chdir(curdir) - text = text[:1000] + stdout, stderr = proc.communicate() + text = stdout.decode("utf-8")[:1000] slug = get_hash(text) title = '' if self.first_line_title: diff --git a/apps/poetry/templates/poetry/poet.html b/apps/poetry/templates/poetry/poet.html index 053dce5..68ffaad 100644 --- a/apps/poetry/templates/poetry/poet.html +++ b/apps/poetry/templates/poetry/poet.html @@ -30,7 +30,7 @@

{{ poet.description }}

-

Kod źródłowy: {{ poet.url }}

+

Kod źródłowy: {{ poet.url }}

Twórz-że!