Opened 8 months ago

Closed 8 months ago

#31402 closed defect (fixed)

"sage -tox -e doctest" underquotes filenames; fix "sage -startuptime" with file arguments

Reported by: mkoeppe Owned by:
Priority: critical Milestone: sage-9.3
Component: scripts Keywords:
Cc: yzh, gh-tobiasdiez, gh-kliem Merged in:
Authors: Matthias Koeppe Reviewers: Jonathan Kliem
Report Upstream: N/A Work issues:
Branch: ba373e0 (Commits, GitHub, GitLab) Commit: ba373e04f0452b07ae1b62d3b860d12b08452e36
Dependencies: #31377 Stopgaps:

Status badges

Description (last modified by mkoeppe)

$ mkdir "path with whitespace"
$ touch "path with whitespace"/xyz.py
$ tox -e doctest -- "path with whitespace"
doctest run-test: commands[0] | tox -c /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/tox.ini -e doctest -- 'path with whitespace'
doctest run-test-pre: PYTHONHASHSEED='1503375210'
doctest run-test: commands[0] | sh -c '/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/../sage -t -p 0 ../path' with whitespace
too many failed tests, not using stored timings

Also other environments are affected.

We fix it by doing what was first proposed in #30474: change sage --coverage so that it can invoke sage --coverageall if necessary. Then we get rid of sh -c (which causes the quoting bug) for all "sagedirect" environments.

Change History (14)

comment:1 Changed 8 months ago by mkoeppe

  • Dependencies set to #31377

comment:2 Changed 8 months ago by mkoeppe

  • Branch set to u/mkoeppe/tox__e_doctest_underquotes_filenames

comment:3 Changed 8 months ago by mkoeppe

  • Authors set to Matthias Koeppe
  • Cc gh-tobiasdiez added
  • Commit set to e51722283c5804d5de555f805bb7d66086be023b
  • Description modified (diff)
  • Status changed from new to needs_review

Last 10 new commits:

f02963bMerge branch 't/31389/remove_clash_of_tdlib__with_tdlib_pyx_in__src_sage_graphs_graph_decompositions' into t/31377/__configure___enable_editable
2b293f8src/setup.py: Install the jupyter kernel using sage_install
b05e4babuild/make/Makefile.in (sagelib-clean): Remove generated .c and .cpp files
271d427src/setup.py: Fix sage.misc.sageinspect by setting Cython.Compiler.Options.embed_pos_in_docstring
f6b2fc4src/sage/repl/interpreter.py: Fix a doctest for editable installs of sagelib
9a0731asage.interacs.debugger: Remove deprecated module
e5d47ceMerge branch 't/31390/remove_deprecated_sage_interacts_debugger' into t/31377/__configure___enable_editable
21ca491Merge branch 't/31377/__configure___enable_editable' into t/31402/tox__e_doctest_underquotes_filenames
cf5d468Merge sage-coverageall script into sage-coverage
e517222src/tox.ini: Remove remaining 'sh' invocations

comment:4 Changed 8 months ago by mkoeppe

  • Status changed from needs_review to needs_work

comment:5 Changed 8 months ago by mkoeppe

Also sage -startuptime seems to get in an infinite loop when receiving a filename containing spaces

comment:6 Changed 8 months ago by git

  • Commit changed from e51722283c5804d5de555f805bb7d66086be023b to a14a99fff60d3d728e2c2105bdb461b5b4d81319

Branch pushed to git repo; I updated commit sha1. New commits:

a14a99fsrc/bin/sage-startuptime.py: Do not get caught in infinite loops

comment:7 Changed 8 months ago by mkoeppe

  • Priority changed from major to critical
  • Status changed from needs_work to needs_review
  • Summary changed from tox -e doctest underquotes filenames to "sage -tox -e doctest" underquotes filenames; fix "sage -startuptime" with file arguments

comment:8 Changed 8 months ago by mkoeppe

  • Cc gh-kliem added

comment:9 Changed 8 months ago by gh-kliem

  • Reviewers set to Jonathan Kliem
  • Status changed from needs_review to needs_work

Needs the following change:

  • src/bin/sage-coverage

    diff --git a/src/bin/sage-coverage b/src/bin/sage-coverage
    index fba827328f..80b3b0eca6 100755
    a b if args.all: 
    6060    if not args.filename:
    6161        coverage_all(os.path.join(os.environ["SAGE_SRC"], 'sage'))
    6262    elif len(args.filename) == 1:
    63         coverage_all(args.filename)
     63        coverage_all(args.filename[0])
    6464    else:
    6565        print("sage-coverage: error: --all only accepts one filename argument")
    6666        sys.exit(1)

because args.filename is a list and then sage --coverage --all src/sage/geometry/polyhedron/base.py does not work anymore.

Once done, you can put this on positive review on my behalf.

comment:10 Changed 8 months ago by git

  • Commit changed from a14a99fff60d3d728e2c2105bdb461b5b4d81319 to 5da5c111f3130adddf883e69b6827790987e2053

Branch pushed to git repo; I updated commit sha1. New commits:

5da5c11src/bin/sage-coverage: Fixup for --all with file argument

comment:11 Changed 8 months ago by mkoeppe

  • Status changed from needs_work to positive_review

Thanks for catching this!

comment:12 Changed 8 months ago by git

  • Commit changed from 5da5c111f3130adddf883e69b6827790987e2053 to ba373e04f0452b07ae1b62d3b860d12b08452e36
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. Last 10 new commits:

e272614src/setup.py: Pass gdb_debug to cythonize, as in sage_build_cython
67072f3src/setup.py: Use include, not exclude in find_namespace_packages to get top_level info right
0bcf8a4build/pkgs/sagelib/spkg-install: When switching from editable install to traditional install, remove the egg-link
981124csage_setup.find.installed_files_by_module: Make doctest work for editable installs too
8b5d51bsrc/sage_setup: Generalize doctests to editable install using new function _cythonized_dir
89969bf.gitignore: Ignore src/cython_debug
eb631b2build/make/Makefile.in: Remove src/cython_debug
daec3e8src/sage/repl/interpreter.py: Do not test that IPython displays the location of the Cython-generated .c file
8b3f390Merge tag '9.3.beta8' into t/31377/__configure___enable_editable
ba373e0Merge branch 't/31377/__configure___enable_editable' into t/31402/tox__e_doctest_underquotes_filenames

comment:13 Changed 8 months ago by mkoeppe

  • Status changed from needs_review to positive_review

comment:14 Changed 8 months ago by vbraun

  • Branch changed from u/mkoeppe/tox__e_doctest_underquotes_filenames to ba373e04f0452b07ae1b62d3b860d12b08452e36
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.