Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with path separator. #2

Merged
merged 1 commit into from
Apr 29, 2015
Merged

Fix bug with path separator. #2

merged 1 commit into from
Apr 29, 2015

Conversation

ShawnMilo
Copy link
Contributor

In this example, file problem/P2/problem_1.xml exists, but since the HTML contained P2: instead of P2/, lxml fails to locate the file.

Converting edX xml directory '/tmp/content-devops-0001/' to xbundle file '/tmp/out.xml'
Traceback (most recent call last):
  File "xbundle.py", line 624, in <module>
    xb.import_from_directory(infn)
  File "xbundle.py", line 215, in import_from_directory
    self.import_course_from_directory(dir)
  File "xbundle.py", line 240, in import_course_from_directory
    cxml = self.import_xml_removing_descriptor(dir, x)
  File "xbundle.py", line 335, in import_xml_removing_descriptor
    dchild = self.import_xml_removing_descriptor(dir, child)    # recurse
  File "xbundle.py", line 335, in import_xml_removing_descriptor
    dchild = self.import_xml_removing_descriptor(dir, child)    # recurse
  File "xbundle.py", line 335, in import_xml_removing_descriptor
    dchild = self.import_xml_removing_descriptor(dir, child)    # recurse
  File "xbundle.py", line 335, in import_xml_removing_descriptor
    dchild = self.import_xml_removing_descriptor(dir, child)    # recurse
  File "xbundle.py", line 295, in import_xml_removing_descriptor
    dxml = etree.parse(dir / xml.tag / (un+'.xml')).getroot()
  File "lxml.etree.pyx", line 3310, in lxml.etree.parse (src/lxml/lxml.etree.c:72517)
  File "parser.pxi", line 1791, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:105979)
  File "parser.pxi", line 1817, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:106278)
  File "parser.pxi", line 1721, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:105277)
  File "parser.pxi", line 1122, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:100227)
  File "parser.pxi", line 580, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:94350)
  File "parser.pxi", line 690, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:95786)
  File "parser.pxi", line 618, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:94818)
IOError: Error reading file '/tmp/content-devops-0001/problem/P2:problem_1.xml': failed to load external entity "/tmp/content-devops-0001/problem/P2:problem_1.xml"

@ichuang
Copy link
Contributor

ichuang commented Apr 29, 2015

Thanks for the pull requests - I'll merge them, but very shortly will also update this repo from the latest xbundle.py file, which is used in latex2edx (https://github.com/mitocw/latex2edx)

ichuang added a commit that referenced this pull request Apr 29, 2015
@ichuang ichuang merged commit f92dd9a into mitodl:master Apr 29, 2015
@pdpinch
Copy link
Member

pdpinch commented Apr 30, 2015

Thanks @ShawnMilo !

In the future, for anything larger than these bug fixes, please open an issue first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants