Menu

#529 Line-length (width) not respected with dump function

resolved
line-length (1)
major
bug
2025-09-03
2024-10-30
No

Hi,

While using this great library, I faced a small issue with the width setting.

ruamel version used: 0.18.6

Expected behaviour:
When I set width=80, then no line generated by the dump function will have a length > than 80 characters.

Actual behaviour:
It is not really the case, some have 84 chars

I created a github project that demonstrate the issue (including a test failing due to the length exceed)
https://github.com/sebastienvermeille/ruamel-length-limit-issue-example

Let me know if I can help anyhow, (I'm not a python expert but can try :)

Discussion

  • Anthon van der Neut

    • status: open --> resolved
     
  • Anthon van der Neut

    I think this is fixed in 0.18.13

     
  • chints

    chints - 2025-09-03

    This change has caused issue where i am using it. I am using conda environment yaml which has a registry url as list items. This url line has 82 character but while reading, editing and dumping via library is adding a new line after list -
    This started happening after this update.

     

Log in to post a comment.

MongoDB Logo MongoDB