Modify

Ticket #220 (new defect)

Opened 2 years ago

Last modified 44 years ago

yaml.dump indent parameter not affecting scalars in sequences

Reported by: xulfir@… Owned by: xi
Priority: low Component: pyyaml
Severity: minor Keywords:
Cc:

Description

It seems that scalars in sequences aren't being affected by yaml.dump's indent parameter. This can create odd alignment mismatches when alternate indent values are used.

In python:

y = ['a', {'b':'c','d':{'e':'f','g':'h'},'i':['j','k']}, ['l', {'m':'n', 'o':'p'}, ['q','r']]]
print yaml.dump(y, default_flow_style=False, indent=4)

I expect:

-   a
-   b: c
    d:
        e: f
        g: h
    i:
    -   j
    -   k
-   -   l
    -   m: n
        o: p
    -   -   q
        -   r

Instead I get:

- a
-   b: c
    d:
        e: f
        g: h
    i:
    - j
    - k
-   - l
    -   m: n
        o: p
    -   - q
        - r

Attachments

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.