Skip to content

MemoryError when calling format_field on a Formatter object #134020

Closed
@gabe-sherman

Description

@gabe-sherman

Bug report

Bug description:

The below code results in a 'MemoryError' being raised in the format_field function.

import string
obj = string.Formatter()
ret = obj.format_field("test", "5555555555550555")

Traceback

Traceback (most recent call last):
  File "rep.py", line 4, in <module>
    ret = obj.format_field("test", "5555555555550555")
  File "/usr/lib/python3.10/string.py", line 235, in format_field
    return format(value, format_spec)
MemoryError

CPython versions tested on:

3.10

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions