From 3fe14b8ed6673b05199a64e2b397202baf75eba9 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 25 Jul 2015 22:55:53 +0200 Subject: [PATCH] * Fix CFile for Python2 --- spacy/cfile.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/cfile.pyx b/spacy/cfile.pyx index 6346302b9..781759466 100644 --- a/spacy/cfile.pyx +++ b/spacy/cfile.pyx @@ -5,6 +5,8 @@ cdef class CFile: def __init__(self, loc, mode): if isinstance(mode, unicode): mode_str = mode.encode('ascii') + else: + mode_str = mode cdef bytes bytes_loc = loc.encode('utf8') if type(loc) == unicode else loc self.fp = fopen(bytes_loc, mode_str) if self.fp == NULL: