From 99387f9572df98af5612ae59644db76a3207ebf2 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 23 Jul 2015 14:30:29 +0200 Subject: [PATCH] * Fix python3 error --- spacy/cfile.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/cfile.pyx b/spacy/cfile.pyx index 89e22d413..01db25bcb 100644 --- a/spacy/cfile.pyx +++ b/spacy/cfile.pyx @@ -4,7 +4,7 @@ from libc.stdio cimport fopen, fclose, fread, fwrite, FILE cdef class CFile: def __init__(self, loc, mode): if isinstance(mode, unicode): - mode_str = mode.decode('ascii') + mode_str = mode.encode('ascii') cdef bytes bytes_loc = loc.encode('utf8') if type(loc) == unicode else loc self.fp = fopen(bytes_loc, mode) if self.fp == NULL: