Skip to content

PyInt.ToString returns wrong strings for values between 128 and 256 #1990

Description

@rmadsen-ks

Environment

  • Pythonnet version: 3.0.0-rc6
  • Python version: 3.7
  • Operating System: Windows 10
  • .NET Runtime: .net 6

This test fails with error -56 != 200

def test_object_string_format():
    """Test int to string."""
    from System import String
    integer_value = 200
    string_value = String.Format("{0}", integer_value)
    assert string_value == "200", f"{string_value} != ""200"""

Solution coming up

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions