Skip to content

[BUG] Multiline header in savetxt #710

Closed
@Bzero

Description

@Bzero

Describe the bug
When passing a header containing a linebreak to savetxt only the first line is a comment line, all following lines are uncommented.

ulab version: 6.7.2-2D

To Reproduce

np.savetxt('loadtxt.dat', np.array([1,2,3]), header='A header\nwith a second line')

The second line of the header is not a comment line:

# A header
with a second line
1.000000000000000
2.000000000000000
3.000000000000000

Expected behavior

The second line of the header should be a comment line as well as it is the case with numpy:

# A header
# with a second line
1.000000000000000
2.000000000000000
3.000000000000000

Additional context
Relevant for footers too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions