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

error encountered with textext 0.7.3 and 0.8 using TeXLive 2018 #34

Closed
yuxinopt opened this issue May 31, 2018 · 7 comments
Closed

error encountered with textext 0.7.3 and 0.8 using TeXLive 2018 #34

yuxinopt opened this issue May 31, 2018 · 7 comments

Comments

@yuxinopt
Copy link

Upon Preview I received error:
[Error 145] : 'c:\users\admini~1\appdata\local\temp\tmp9etrww'

Upon Save I received error:

[Error 145] : 'c:\users\admini1\appdata\local\temp\tmphc_sfz'
Traceback (most recent call last):
File "asktext.py", line 583, in cb_ok
self._texcmd_cbox.get_active_text().lower())
File "textext.py", line 286, in callback
tex_cmd, original_scale=current_scale)
File "textext.py", line 389, in do_convert
converter.finish()
File "textext.py", line 703, in finish
self.remove_temp_files()
File "textext.py", line 802, in remove_temp_files
self.try_remove(self.tmp_path)
File "textext.py", line 810, in try_remove
os.rmdir(filename)
WindowsError: [Error 145] : 'c:\users\admini
1\appdata\local\temp\tmphc_sfz'
The same errors occur for both textext0.7.3 and 0.8. I am under Windows 7.

@jcwinkler
Copy link
Member

The deletion of the temporary directory used for compilation of the TeX code fails.

It would be great if you could help us by performing the following test:

  1. Open the file textext.py (it should be in the directory c:\Users\admini1~1\AppData\Roaming\inkscape\extensions in your case)

  2. Navigate to the line containing def try_remove(filename): (it should be line 805 in version 0.8)

  3. Modify the code that it looks like this:

    def try_remove(filename):
        """Try to remove given file, skipping if it doesn't exist"""
        if os.path.isfile(filename):
            inkex.debug(filename) # <-- added
            os.remove(filename)
        elif os.path.isdir(filename):
            inkex.debug(os.listdir(filename)) # <-added
            os.rmdir(filename)
  1. Save the file

  2. Try again to compile a TeX snippet

  3. After the error message a window like this should open:
    grafik

  4. Please post its content here.

Thank you very much!

@yuxinopt
Copy link
Author

yuxinopt commented Jun 1, 2018

Thanks.

I did the test following your guide. Errors remain the same, but no such window pops out.

Best wishes

jcwinkler added a commit to jcwinkler/textext that referenced this issue Jun 1, 2018
It seems that some tex distributions produce additional output compared
to what has been observed so far. Hence, this patch forces deletion of
the temp directory even if it is not empty after the usual TeX files
have been removed.

Resolves textext#34
@jcwinkler
Copy link
Member

Meanwhile I was able to reproduce the problem, see commit 76aab08

It would be nice if you could check this on your system. Please perform the following steps:

  1. Close Inkscape
  2. Open your Inkscape extension directory (should be c:\Users\admini1~1\AppData\Roaming\inkscape\extensions)
  3. Remove the files textext.inx Note: The inx file, not py !!
  4. Open Inkscape again and check if the TexText extension does not show up in the Extension menu. If it shows up, please inform me
  5. Close Inkscape again.
  6. Download the attached zip file textext-tempdir-fix.zip and unpack its content into the Inkscape extension directory from step 2, overwrite all files
  7. Launch Inkscape and try out TexText again. What happens?

Thank you very much in advance!

@yuxinopt
Copy link
Author

yuxinopt commented Jun 2, 2018

jcwinkler, thank you very much!

I did the check, the results are:

  1. Upon removing the textext.inx file, the TeXText extension does not show up in the extension menu.

  2. Upon using the fix.zip files, I got the following errors:
    upon preview: [Error 2] : 'texput.log'

upon save:

[Error 2] : 'texput.log'
Traceback (most recent call last):
File "asktext.py", line 583, in cb_ok
self._texcmd_cbox.get_active_text().lower())
File "textext.py", line 286, in callback
tex_cmd, original_scale=current_scale)
File "textext.py", line 389, in do_convert
converter.finish()
File "textext.py", line 703, in finish
self.remove_temp_files()
File "textext.py", line 802, in remove_temp_files
self.try_remove(self.tmp_path)
File "textext.py", line 815, in try_remove
os.rmdir(filename)
WindowsError: [Error 2] : 'texput.log'

Best regards

@jcwinkler
Copy link
Member

Hmm, I am quite puzzled about what's going on on your system. I use Windows 7 and TexLive too as a test system...

Please perform the following test:

  1. Close Inkscape
  2. Download the attached zip file textext-no-temp-delete.zip and unpack its content into the Inkscape extension directory (c:\Users\admini1~1\AppData\Roaming\inkscape\extensions), overwrite the existing textext.py
  3. Launch Inkscape and try out TexText again. This time a window as described in my first post should appear after hitting "Save". Please post its content.

In the attached file I completely removed the deletion of the temp directory created by TexText so there sould nothing go wrong. Instead the files and dirs TexText wants to delete are displayed only in the window.

Thank you very much.

jcwinkler added a commit to jcwinkler/textext that referenced this issue Jun 6, 2018
Directory is also deleted if it has subdirectories or contains files
which do not begin with tmp. It seems that some tex distributions
produce additional output compared to what has been observed so far.
Hence, this patch forces deletion of the temp directory even if it is
not empty.

See issue textext#34
@yuxinopt
Copy link
Author

yuxinopt commented Jun 7, 2018

Thank you very much for the efforts! In fact I did another test. I rolled back from TeXLive 2018 to TeXLive 2016 and all the errors disappeared.

Best wishes

jcwinkler added a commit to jcwinkler/textext that referenced this issue Jun 12, 2018
Directory is also deleted if it has subdirectories or contains files
which do not begin with tmp. It seems that some tex distributions
produce additional output compared to what has been observed so far.
Hence, this patch forces deletion of the temp directory even if it is
not empty.

See issue textext#34
@jcwinkler
Copy link
Member

Although not directly verified by the user the reason for this issue was a non safe deletion of the temp directory which has been fixed by commit 8c65ec0 and which went into release 0.8 of TexText.

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

2 participants