Skip to content

Write recursion error on linux #396

@Marc-Pierre-Barbier

Description

@Marc-Pierre-Barbier

I was using conan2's command conan graph info . --format=html > output.html which generate a html report to a file

the problem is that conan use colorama to print and the massive input led to a recursion limit.

so inside ansitowin32.py i added this piece of code at the begning of write

 def write(self, text):
        global last_write
        last_write+=1
        f = open("/tmp/conankaboum" + str(last_write), "a")
        f.write(text)
        f.close()
        ....

which wrote a 383KB file called "conankaboum206" and 205 identical files.
i will be creating a similar report on conan's side.
conankaboum206.txt

here is the looping part of the stacktrace

  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 176, in write
    self.write_and_convert(text)
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 204, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 209, in write_plain_text
    self.wrapped.write(text[start:end])
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 46, in write
    self.__convertor.write(text)
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 176, in write
    self.write_and_convert(text)
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 198, in write_and_convert
    text = self.convert_osc(text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions