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
Running Anaconda on Windows, Python 3.6.4. Current master branch. Parsing an 837 file using map '837Q3.I.5010.X223.A1.xml', explicit path to map directory (base_path).
During x12xml, I get the below error associated with the following line in dataele.py:
Line 52 : for eElem in et.parse(fd).iter('data_ele'):
It looks like ElementTree is okay either taking the raw path string (os.path.join...) or a file descriptor with the 'rb' mode. 'r' mode gives the same error. To minimize side effects I changed line 48 to :
I'd submit a pull request, but I'm not certain if this behavior is Windows-only.
Traceback (most recent call last):
File "C:\Users\jtern\Anaconda3\Scripts\x12xml-script.py", line 11, in
load_entry_point('pyx12==2.3.3', 'console_scripts', 'x12xml')()
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\scripts\x12xml.py", line 120, in main
fd_997=None, fd_html=None, fd_xmldoc=fd_xml, map_path=args.map_path)
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\x12n_document.py", line 78, in x12n_document
control_map = pyx12.map_if.load_map_file(map_file, param, map_path)
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\map_if.py", line 1543, in load_map_file
imap = map_if(etree.getroot(), param, map_path)
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\map_if.py", line 199, in init
self.data_elements = dataele.DataElements(base_path)
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\dataele.py", line 52, in init
for eElem in et.parse(fd).iter('data_ele'):
File "C:\Users\jtern\Anaconda3\lib\xml\etree\ElementTree.py", line 1196, in parse
tree.parse(source, parser)
File "C:\Users\jtern\Anaconda3\lib\xml\etree\ElementTree.py", line 597, in parse
self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 1
The text was updated successfully, but these errors were encountered:
Running Anaconda on Windows, Python 3.6.4. Current master branch. Parsing an 837 file using map '837Q3.I.5010.X223.A1.xml', explicit path to map directory (base_path).
During x12xml, I get the below error associated with the following line in dataele.py:
Line 52 : for eElem in et.parse(fd).iter('data_ele'):
It looks like ElementTree is okay either taking the raw path string (os.path.join...) or a file descriptor with the 'rb' mode. 'r' mode gives the same error. To minimize side effects I changed line 48 to :
fd = open(os.path.join(base_path, dataele_file),'rb')
Worked with the next 6 837 files I processed.
I'd submit a pull request, but I'm not certain if this behavior is Windows-only.
Traceback (most recent call last):
File "C:\Users\jtern\Anaconda3\Scripts\x12xml-script.py", line 11, in
load_entry_point('pyx12==2.3.3', 'console_scripts', 'x12xml')()
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\scripts\x12xml.py", line 120, in main
fd_997=None, fd_html=None, fd_xmldoc=fd_xml, map_path=args.map_path)
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\x12n_document.py", line 78, in x12n_document
control_map = pyx12.map_if.load_map_file(map_file, param, map_path)
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\map_if.py", line 1543, in load_map_file
imap = map_if(etree.getroot(), param, map_path)
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\map_if.py", line 199, in init
self.data_elements = dataele.DataElements(base_path)
File "C:\Users\jtern\Anaconda3\lib\site-packages\pyx12-2.3.3-py3.6.egg\pyx12\dataele.py", line 52, in init
for eElem in et.parse(fd).iter('data_ele'):
File "C:\Users\jtern\Anaconda3\lib\xml\etree\ElementTree.py", line 1196, in parse
tree.parse(source, parser)
File "C:\Users\jtern\Anaconda3\lib\xml\etree\ElementTree.py", line 597, in parse
self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 1
The text was updated successfully, but these errors were encountered: