question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version 5.1 dumps strings differently on different platforms

See original GitHub issue

After 5.1 has been released, our CI builds started to fail. The reason is different outputs on Linux, Mac and Windows, depending on Python version. The problem displays as different way to dump string containing tabs, on different platforms. I’d accept any of dump variants from 5.1 if it would be consistent across platforms. But having it different creates a mess with automated tests.

I have made simple unit test to reproduce the problem (https://github.com/Blazemeter/taurus/pull/1076). The code to reproduce is:

class MyTestCase(unittest.TestCase):
    def test_case(self):
        data = {"str": "\tpart1\tpart2\t"}
        res = yaml.safe_dump(data,
                             default_flow_style=False, explicit_start=True, canonical=False,
                             allow_unicode=True, encoding='utf-8', width=float("inf"))
        res = res.decode('utf8')
        self.assertEqual('---\nstr: "\\tpart1\\tpart2\\t\"\n', res)

This test works fine on Linux with any Python version, Windows with Python 3. It fails on MacOS with Python 2.7 and on Windows with Python 2.7.

I double-checked that version of PyYAML is 5.1 on all builds.

Relevant CI links: Linux and Mac: https://travis-ci.org/Blazemeter/taurus/builds/507459846 Windows: https://ci.appveyor.com/project/undera/taurus/builds/23134929

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
perlpunkcommented, Dec 2, 2019

Closing. Please reopen if necessary. Thanks!

0reactions
perlpunkcommented, Dec 2, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit test failure on macOS with newer version of PyYAML · Issue #72 ...
There seems to be known issue just fixed in PyYAML (Version 5.1 dumps strings differently on different platforms). To confirm, please change setup.py...
Read more >
Unreal Engine 5.1 Release Notes
Overview of new and updated features in Unreal Engine 5.1. ... Avoid temporary objects and strings as much as possible. Use the IUhtSession....
Read more >
vm-hpux1131-5.1SP1RP3P6 - Veritas
As a result, multiple disk groups with similar 'base_minor' number were imported. RESOLUTION: The code is fixed to correctly re-minor the disk group...
Read more >
Release Notes - OpenSSH
Avoids keys being clobbered if the user created multiple resident keys with the same application string but different user IDs. * ssh-keygen(1), ssh(1), ......
Read more >
1.2 Release Notes Red Hat Software Collections 1 | Red Hat ...
It provides current versions of the GNU Compiler Collection, GNU Debugger, Eclipse development platform, and other development, debugging, and performance ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found