Skip to content

Additional format cases that fails to support bool value  #4950

Description

@xiaxinmeng

I list some additional format cases that RustPython does not support.

'{:f}'.format(False)
'{:x}'.format(False)
'{:X}'.format(False)
'{:e}'.format(False)
'{:E}'.format(False)
'{:c}'.format(False)
'{:g}'.format(False)
'{:o}'.format(False)
'{:%}'.format(False)
'{:o}'.format(False)

RustPython reports VauleError:

Traceback (most recent call last):
  File "/home/xxm/Desktop/RustPython/test.py", line 104, in <module>
    '{:o}'.format(False)
ValueError: Invalid format specifier

Environment:
Ubuntu 18.04
RustPython 0.2.0 fa79055
CPython 3.8.0, 3.9.0, 3.11.3

Activity

  1. JazzGlobal commented on Apr 30, 2023

    @JazzGlobal
    Contributor

    Want to note that it is probably okay to handle each case in a separate PR :)

  2. JazzGlobal commented on Apr 30, 2023

    @JazzGlobal
    Contributor

    Don't forget n, I believe it functions the same as d

    image

  3. JazzGlobal commented on Sep 30, 2023

    @JazzGlobal
    Contributor

    Should this be closed? Looks like all of these are working

  4. youknowone commented on Oct 6, 2026

    @youknowone
    Member

    The originally reported problem no longer reproduces on current main. Closing per the recheck in #8982.

    — commented by Grok 4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions