# Issue parsing Ipopt\_jll string option when there is blank space in path

**URL:** <https://discourse.julialang.org/t/issue-parsing-ipopt-jll-string-option-when-there-is-blank-space-in-path/125943>\
**Category:** Optimization (Mathematical)\
**Tags:** bug\
**Created:** [February 15, 2025, 5:39pm UTC](https://discourse.julialang.org/t/issue-parsing-ipopt-jll-string-option-when-there-is-blank-space-in-path/125943 "2025-02-15T17:39:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KSepetanc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksepetanc/32/10841_2.png) [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Post date:** [February 15, 2025, 5:39pm UTC](https://discourse.julialang.org/t/issue-parsing-ipopt-jll-string-option-when-there-is-blank-space-in-path/125943/1 "2025-02-15T17:39:31Z")

</div>

The following code does not work when called from path that has blank space.

```julia
using JuMP, AmplNLWriter, Ipopt_jll

mod = Model(() -> AmplNLWriter.Optimizer(Ipopt_jll.amplexe))
set_attribute(mod, "output_file", joinpath(@ __DIR__ ,"output.txt"))
optimize!(mod)

```

The output is:

> Ipopt 3.14.17: output\_file=/home/karlo/Desktop/mwe  
> Unknown keyword “2/output.txt”

Not sure on what package should I post issue report. Already have opened one on [Yggdrasil](https://github.com/JuliaPackaging/Yggdrasil/issues/10540) issues, but seems it is not due to them.

@amontoison , @odow

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [February 15, 2025, 5:46pm UTC](https://discourse.julialang.org/t/issue-parsing-ipopt-jll-string-option-when-there-is-blank-space-in-path/125943/2 "2025-02-15T17:46:51Z")

</div>

If you `dump(mod)` you’ll see at some point something like

```julia
raw_status_string: String "Error calling the solver. Failed with: ProcessFailedException(Base.Process[Process(setenv(`/path/to/bin/ipopt /path/to/jl_imeXZ0/model.nl -AMPL 'hsllib=/path/to/mwe 2/something.txt' linear_solver=ma27`,[...]), ProcessExited(1))])"

```

As I’ve been trying to say for hours in [Issue parsing Ipopt\_jll string option when there is blank space in path · Issue #10540 · JuliaPackaging/Yggdrasil · GitHub](https://github.com/JuliaPackaging/Yggdrasil/issues/10540), whatever piece of code is calling `ipopt` is not quoting the path correctly. I have no clue of _what_ is calling `ipopt`, but there is where the issue. Or maybe it’s ipopt which can’t parse paths with strings. Either way, nothing to do with Yggdrasil.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [February 15, 2025, 6:13pm UTC](https://discourse.julialang.org/t/issue-parsing-ipopt-jll-string-option-when-there-is-blank-space-in-path/125943/3 "2025-02-15T18:13:02Z")

</div>

Hi @KSepetanc,

I’ve moved this thread to the Optimization section of Discourse: [Optimization (Mathematical) - Julia Programming Language](https://discourse.julialang.org/c/domain/opt/13)

If you have JuMP-related questions in future, please post here first, instead of opening GitHub issues. If it is a bug, I can help direct you to the appropriate place.

In this case, it is a bug in [Escape spaces in cmd · Issue #196 · jump-dev/AmplNLWriter.jl · GitHub](https://github.com/jump-dev/AmplNLWriter.jl/issues/196)

Until I fix it, a work-around is probably:

```Julia
using JuMP, AmplNLWriter, Ipopt_jll

mod = Model(() -> AmplNLWriter.Optimizer(Ipopt_jll.amplexe))
set_attribute(mod, "output_file", escape_string(joinpath(@ __DIR__ ,"output.txt"), " "))
optimize!(mod)

```

Mose’s `dump(mod)` gets you there, but a better way is to call `solution_summary(mod)`. This would explain what happened in more detail.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [February 17, 2025, 6:42pm UTC](https://discourse.julialang.org/t/issue-parsing-ipopt-jll-string-option-when-there-is-blank-space-in-path/125943/4 "2025-02-17T18:42:05Z")

</div>

This is fixed in v1.2.3 of AmplNLWriter.jl.

For earlier versions, the work-around needed to be:

```Julia
output_file = joinpath(@ __DIR__ ,"output.txt")
set_attribute(mod, "output_file", "\"$(output_file)\"")

```

---

<div class="post-metadata">

**Author:** ![KSepetanc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksepetanc/32/10841_2.png) [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Post date:** [February 17, 2025, 6:48pm UTC](https://discourse.julialang.org/t/issue-parsing-ipopt-jll-string-option-when-there-is-blank-space-in-path/125943/5 "2025-02-17T18:48:14Z")

</div>

Thank you for fixing it so quickly. Also for merging other PR’s.
