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

[BUG] weave with some doctypes creates a tempdir that is not deleted #440

Open
bencottier opened this issue Sep 22, 2021 · 1 comment
Open
Labels

Comments

@bencottier
Copy link

description

Using weave with doctype=md2html and leaving fig_path unspecified results in a temp dir (the kind made by mktempdir) left in the out_path. My guess is this code is responsible.

This behaviour is inconsistent with the doc, which says it will default to DEFAULT_FIG_PATH:

  • fig_path::Union{Nothing,AbstractString} = nothing: Where figures will be generated, relative to out_path. By default (i.e. given nothing), Weave will automatically create $(DEFAULT_FIG_PATH) directory.

If a tempdir is used, I would expect it to be deleted after calling the function that creates it.

versions

using InteractiveUtils; versioninfo():

Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code

using Pkg; Pkg.status():

julia> using Pkg; Pkg.status()
      Status `/private/var/folders/g6/w_cfz8c507j6mbt5mdv7wt_h0000gn/T/jl_bzbN9C/Project.toml`
  [44d3d7a6] Weave v0.10.10

minimum reproducible steps

I have only tested with doctype="md2html" but I think it would be true of any doctype that ends with "2pdf" or "2html".

Example document called weave_test.jl:

#' ## Test
x = 1

weave call which creates a tempdir that is not deleted:

weave("./weave_test.jl"; doctype="md2html", out_path=".")

weave call which creates a "figures" dir as expected, and no tempdir:

 weave("./weave_test.jl"; doctype="md2html", out_path=".", fig_path="figures")

The output HTML is as expected:
image

@bencottier bencottier added the bug label Sep 22, 2021
@slwu89
Copy link

slwu89 commented Dec 31, 2021

I can confirm I have the same issue when weaving .jmd files. My platform is:

julia> using InteractiveUtils; versioninfo()
Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.1.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 

and package version:

julia> using Pkg; Pkg.status()
      Status `~/.julia/environments/v1.7/Project.toml`
  [44d3d7a6] Weave v0.10.10

When using a file called test.jmd with:

# hello

this is a test!

```julia 
5 + 5
```

after calling weave("test.jl") in the directory with output there is a temp folder that was not cleaned up "jl_X8p1Qs"

NicholasWMRitchie added a commit to NicholasWMRitchie/Weave.jl that referenced this issue Jul 13, 2022
pfitzseb added a commit that referenced this issue Feb 10, 2023
Force deletion of the temporary figure path to address Issue #440
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants