Skip to content

ValueError: invalid conversion flag #6533

@anki-code

Description

@anki-code

Hi! After latest fixes xonsh is working more and more stable so I've mentioned RustPython in xonsh README, thanks!

rc.xsh:

@aliases.register
def _als():
    a = 1
    b = f"{a!r}"  # `!r` produces the exception

run:

rustpython -V
# Python 3.13.0alpha (heads/master:40acd5529

/.local/bin/rust-xonsh --rc rc.xsh

result:

Traceback (most recent call last):
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/main.py", line 511, in main
    args = premain(argv)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/main.py", line 452, in premain
    start_services(shell_kwargs, args, pre_env=pre_env)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/main.py", line 375, in start_services
    _load_rc_files(shell_kwargs, args, env, execer, ctx)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/main.py", line 330, in _load_rc_files
    rcfiles=rc, rcdirs=rcd, execer=execer, ctx=ctx, env=env, login=login
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/environ.py", line 2656, in xonshrc_context
    rcfile, ctx, env, execer=execer, login=login
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/environ.py", line 2714, in xonsh_script_run_control
    with swap_values(ctx, updates):
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/environ.py", line 2718, in xonsh_script_run_control
    exc_info = sys.exc_info()
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/environ.py", line 2716, in xonsh_script_run_control
    exc_info = run_script_with_cache(filename, execer, ctx)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/codecache.py", line 176, in run_script_with_cache
    ccode = compile_code(filename, code, execer, glb, loc, mode)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/codecache.py", line 138, in compile_code
    execer.filename = old_filename
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/codecache.py", line 136, in compile_code
    raise
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/codecache.py", line 134, in compile_code
    ccode = execer.compile(code, glbs=glb, locs=loc, mode=mode, filename=filename)
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/execer.py", line 148, in compile
    raise e
  File "/Users/pc/.local/lib/rustpython3.13/site-packages/xonsh/execer.py", line 137, in compile
    code = compile(tree, filename, mode)
ValueError: invalid conversion flag

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions