You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exception below shows up. You'll notice the warning stating that "Windows-1252" was assumed. If I go to io.py and change this line to force "utf-8" as the encoding the file loads just fine. Is there another way to change the encoding of the file I'm loading?
/var/folders/4b/gklb4t292nq0vyg08x59gjzc0000gn/T/ipykernel_29628/2923417831.py:1: UnicodeWarning: unsoundencoding, assumingWindows-1252 (73%confidence)
Ontology('/Users/yoshiki/Downloads/opmi-merged.owl')
---------------------------------------------------------------------------UnicodeDecodeErrorTraceback (mostrecentcalllast)
CellIn[188], line1---->1Ontology('/Users/yoshiki/Downloads/opmi-merged.owl')
File~/miniconda3/envs/db/lib/python3.11/site-packages/pronto/ontology.py:283, inOntology.__init__(self, handle, import_depth, timeout, threads)
281forclsinBaseParser.__subclasses__():
282ifcls.can_parse(typing.cast(str, self.path), buffer):
-->283cls(self).parse_from(_handle) # type: ignore284break285else:
File~/miniconda3/envs/db/lib/python3.11/site-packages/pronto/parsers/rdfxml.py:84, inRdfXMLParser.parse_from(self, handle, threads)
82defparse_from(self, handle, threads=None):
83# Load the XML document into an XML Element tree--->84tree: etree.ElementTree=etree.parse(handle)
86# Load metadata from the `owl:Ontology` element87owl_ontology=tree.find(_NS["owl"]["Ontology"])
File~/miniconda3/envs/db/lib/python3.11/xml/etree/ElementTree.py:1218, inparse(source, parser)
1209"""Parse XML document into element tree. 1210 1211 *source* is a filename or file object containing XML data, (...) 1215 1216 """1217tree=ElementTree()
->1218tree.parse(source, parser)
1219returntreeFile~/miniconda3/envs/db/lib/python3.11/xml/etree/ElementTree.py:580, inElementTree.parse(self, source, parser)
574parser=XMLParser()
575ifhasattr(parser, '_parse_whole'):
576# The default XMLParser, when it comes from an accelerator,577# can define an internal _parse_whole API for efficiency.578# It can be used to parse the whole source without feeding579# it with chunks.-->580self._root=parser._parse_whole(source)
581returnself._root582whileTrue:
File~/miniconda3/envs/db/lib/python3.11/site-packages/pronto/utils/io.py:24, inBufferedReader.read(self, size)
22defread(self, size: Optional[int] =-1) ->bytes:
23try:
--->24returnsuper(BufferedReader, self).read(size)
25exceptValueError:
26iftyping.cast(io.BufferedReader, self.closed):
File~/miniconda3/envs/db/lib/python3.11/site-packages/pronto/utils/io.py:60, inEncodedFile.readinto(self, buffer)
59defreadinto(self, buffer: ByteString) ->int:
--->60chunk=self.read(len(buffer) //2)
61typing.cast(bytearray, buffer)[: len(chunk)] =chunk62returnlen(chunk)
File~/miniconda3/envs/db/lib/python3.11/site-packages/pronto/utils/io.py:56, inEncodedFile.read(self, size)
55defread(self, size: Optional[int] =-1) ->bytes:
--->56chunk=super().read(-1ifsizeisNoneelsesize)
57returnchunk.replace(b"\r\n", b"\n")
File<frozencodecs>:814, inread(self, size)
File<frozencodecs>:507, inread(self, size, chars, firstline)
File~/miniconda3/envs/db/lib/python3.11/encodings/cp1252.py:15, inCodec.decode(self, input, errors)
14defdecode(self,input,errors='strict'):
--->15returncodecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap'codeccan'tdecodebyte0x9dinposition29335: charactermapsto<undefined>
The text was updated successfully, but these errors were encountered:
To reproduce download OWL formatted OPMI from BioPortal.
The exception below shows up. You'll notice the warning stating that "Windows-1252" was assumed. If I go to io.py and change this line to force "utf-8" as the encoding the file loads just fine. Is there another way to change the encoding of the file I'm loading?
The text was updated successfully, but these errors were encountered: