Uploaded image for project: 'Module Tools'
  1. Module Tools
  2. MODTOOLS-47

usfm2osis processes usfm files forever

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: usfm2osis.py
    • Labels:
      None

      Description

      I have created a test case where the script usfm2osis.py keeps processing the input usfm files forever. Each time I interrupt the script through Ctrl-C, it stops at the same line numbers:

      Sorting book files canonically
      Converting USFM documents to OSIS...
      ^CProcess Worker-1:
      Traceback (most recent call last):
      Traceback (most recent call last):
      File "usfm2osis.py", line 1568, in <module>
      File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
      self.run()
      File "usfm2osis.py", line 1450, in run
      k,v=result_queue.get()
      File "/usr/lib/python2.7/multiprocessing/queues.py", line 117, in get
      res = self._recv()
      KeyboardInterrupt
      osis = convertToOsis(job)
      File "usfm2osis.py", line 1343, in convertToOsis
      osis = cvtPrivateUseExtensions(osis, relaxedConformance)
      File "usfm2osis.py", line 1198, in cvtPrivateUseExtensions
      osis = re.sub(r'\z([^\s])\s(.?)(\z\1*)', r'<seg type="x-\1">\2</seg>', osis, flags=re.DOTALL)
      File "/usr/lib/python2.7/re.py", line 151, in sub
      return _compile(pattern, flags).sub(repl, string, count)
      KeyboardInterrupt

      This happens on Ubuntu 12.10 64 bits and Python 2.7.3.

      The test case can be downloaded from the following URL:

      http://bibleconsultants.dyndns.org/downloads/temporal/usfm2osis4ever.zip

      Steps:
      1. Download and unzip usfm2osis4ever.zip
      2. Go into folder usfm2osis
      3. Run ./test
      Result:
      It keeps processing forever.
      Expected result:
      It converts the USFM files to OSIS and completes normally.

        Attachments

          Activity

            People

            • Assignee:
              chrislit Chris Little
              Reporter:
              teusbenschop Teus Benschop
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: