Fix encoding of path variable

This commit is contained in:
Matthew Honnibal 2016-09-24 21:13:15 +02:00
parent af847e07fc
commit df88690177
1 changed files with 2 additions and 0 deletions

View File

@ -241,6 +241,8 @@ cdef class Vocab:
return tokens return tokens
def dump(self, loc): def dump(self, loc):
if hasattr(loc, 'as_posix'):
loc = loc.as_posix()
cdef bytes bytes_loc = loc.encode('utf8') if type(loc) == unicode else loc cdef bytes bytes_loc = loc.encode('utf8') if type(loc) == unicode else loc
cdef CFile fp = CFile(bytes_loc, 'wb') cdef CFile fp = CFile(bytes_loc, 'wb')