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

Whitespace in directory path causing problems on MacOS #82

Open
gimsieke opened this issue Mar 8, 2021 · 8 comments
Open

Whitespace in directory path causing problems on MacOS #82

gimsieke opened this issue Mar 8, 2021 · 8 comments
Assignees

Comments

@gimsieke
Copy link
Contributor

gimsieke commented Mar 8, 2021

(related to #18)

As reported by @gsfs in #80 (comment)

@gimsieke gimsieke self-assigned this Mar 8, 2021
@gimsieke
Copy link
Contributor Author

gimsieke commented Mar 8, 2021

George, could you be so kind as to either attach the zipped log file to this issue—not via email though, this apparently doesn’t work—or to send it to Martin and me at [email protected]?

@gsfs
Copy link

gsfs commented Mar 8, 2021

I got this log file by running d2t in the directory above where the .tex file was located by using the command:
$d2t 802\ Spring\ 2021/pset4newproblems.docx

I get similar problems if I go into that subdirectory and simply run:
d2t pset4newproblems.docx

Here's the log file:
pset4newproblems.d2t.log.zip

@gimsieke
Copy link
Contributor Author

gimsieke commented Mar 8, 2021

But it seems to run until the end without a severe error. Does it produce any output, that is, a .tex file?

I don’t know what to make of No such file or directory - file:/Users/gsfs/Documents/GSFS/Teaching/802%20Spring%202021/pset4newproblems.docx.tmp/word/embeddings/oleObject1.bin. Maybe the MathType→MathML converter is expecting a file path instead of a file URI?

Can you send me the docx input? If you don’t want to attach it here publicly you can send it to [email protected]⁠.

@gsfs
Copy link

gsfs commented Mar 9, 2021

I made a short test file. Here's the input, output, and log:
test.docx
test.tex.zip
test.d2t.log
I had to zip the output because drag and drop for a .tex file didn't work. The output looks OK except for the equations.
Finally, here's the output and log with the same file but in a directory without blank spaces in the name:
noblanks.tex.zip
noblanks.d2t.log

@gimsieke
Copy link
Contributor Author

@sbulka, can you have a look at it? I reproduced the issue on Cygwin. I put test.docx into a directory C:\test dir\ and called, from the directory that I cloned docx2tex into recursively, ./d2t -d /cygdrive/c/test\ dir/test.docx in Cygwin or cmd /c d2t.bat "c:/test dir/test.docx" in a Windows shell.

For both invocations, I get errors such as:

Errno::ENOENT: No such file or directory - file:/C:/test%20dir/test.docx.tmp/word/embeddings/oleObject6.bin
      initialize at org/jruby/RubyFile.java:368
            open at org/jruby/RubyIO.java:1137
            open at org/jruby/RubyKernel.java:306
      initialize at uri:classloader:/ole/storage/base.rb:48
            open at uri:classloader:/ole/storage/base.rb:85
  read_from_file at uri:classloader:/file_parser/ole.rb:10
      initialize at uri:classloader:/file_parser/ole.rb:7
      set_parser at uri:classloader:/mathtype.rb:36
      initialize at uri:classloader:/mathtype.rb:16
          <main> at <script>:1

despite the file URIs pointing to existing files. Could it be that jruby is having problems with percent encoding in file URIs?

While you’re at it, you might want to look at this message:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.util.io.FilenoUtil (file:/C:/test%20dir/docx2tex/calabash/extensions/transpect/mathtype-extension/lib/jruby-complete-9.1.8.0.jar) to method sun.nio.ch.SelChImpl.getFD()
WARNING: Please consider reporting this to the maintainers of org.jruby.util.io.FilenoUtil

@sbulka
Copy link

sbulka commented Mar 16, 2021

I will investigate, may take some time though.

@sbulka
Copy link

sbulka commented Mar 21, 2021

Ok, the mathtype-extension expliticly states it only accepts file paths, no URI. I don't think we can change this easily. https://github.com/transpect/mathtype-extension#options

solution:

The issue also occured on a path containing '#' for me (Windows, no cygwin). Should also be solved if the unescaped os-path is used.

Regarding the reflection warning, I couldn't reproduce that. Maybe it's a matter of java version? Mine is:

openjdk version "16" 2021-03-16
OpenJDK Runtime Environment (build 16+36-2231)
OpenJDK 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)

@mkraetke
Copy link
Member

mkraetke commented Mar 22, 2021

Thanks for your advice. I've got the Java warning too:

unsupported Java version "15", defaulting to 1.7
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.util.io.FilenoUtil (file:/C:/cygwin64/home/kraetke/word2tex/trunk/calabash/extensions/transpect/mathtype-extension/lib/jruby
-complete-9.1.8.0.jar) to method sun.nio.ch.SelChImpl.getFD()
WARNING: Please consider reporting this to the maintainers of org.jruby.util.io.FilenoUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

My Java:

java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)

Since it's stated that the Java version "15" is unsupported, it might be sufficient to just include a more recent JRuby version?

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

No branches or pull requests

4 participants