Skip to content

Automatic include-path specification interacts poorly with spaces in filepaths #659

@WardBrian

Description

@WardBrian

Summary:

mkdir "space in directory name"
cd "space in directory name"
touch foo.stan
echo "#include foo.stan" > bar.stan
cd ..
python -c 'import cmdstanpy; cmdstanpy.CmdStanModel(stan_file="./space in directory name/bar.stan")'

For me this fails with

Command ['make', 'STANCFLAGS+=--include-paths=/home/brian/Dev/py/cmdstanpy/space in directory name', '/tmp/tmp9q5etflx/tmp9r9gf0ec']
        error during processing No such file or directory

due to the include path argument being interpreted as passing multiple model files at once,
but another user reported to me that they get an error from stanc about specifically not finding the #included file.

I don't see an obvious fix for this in general, since even determining if files are #included relies on us using stanc.

Current Version:

cmdstan: (2, 31)
cmdstanpy: 1.1.0
OS: Ubuntu 20.04. I believe on Windows this results in different behavior (but still fails!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions