Skip to content

PyString with non-byte value in formatting of collections #192

Closed

Description

@jeff5

Sufficient to reproduce:

from java.lang import String
print [String(u"\u51fa")]

However, these work.

>>> print u"\u51fa"
出
>>> print String(u"\u51fa")
出

Definitely closer to #190 than the circumstances of #20.

Originally posted by @yogi1967 in #20 (comment)

Activity

  1. yogi1967 commented on Jun 26, 2022

    @yogi1967

    This is a real pain and catches me unawares. Testing doesn't help, as I typically don't have characters that will cause this. Pls fix. Thx.

  2. added this to the Jython 2.7.3 milestone on Jun 26, 2022
  3. added a commit that references this issue on Jun 28, 2022
    39eca87
  4. yogi1967 commented on Jun 28, 2022

    @yogi1967

    Thanks for the fix!

  5. yogi1967 commented on Jun 28, 2022

    @yogi1967

    Curious when 2.7.3 is targeted for release? Thanks

  6. jeff5 commented on Jul 1, 2022

    @jeff5
    MemberAuthor

    Thanks for the fix!

    I thought it worth trying to get into 2.7.3.

    It shaves a bit more off the speed of Jython :(. The same test, whether a string fits into ascii/bytes, is now quite widespread in the code base. I'm looking where we can avoid the work.

    Curious when 2.7.3 is targeted for release? Thanks

    We're very close to a beta of that. (Next week?) I think we have reached acceptable quality.

  7. yogi1967 commented on Jul 3, 2022

    @yogi1967

    Hi Jeff, could you also fix this too please?

    You will see that line 5 is fine, lines 6 shows garbage, line 7 errors.. All trying to do the same thing... I always have to do this to avoid "%s" %(theStr) instead of str()

    from javax.swing import JOptionPane, JLabel
    from java.lang import String
    euroSymb=String(u"\u20ac")
    gbpSymb=String(u"\u00A3")
    JOptionPane.showMessageDialog(None, JLabel("Symbols: %s %s" %(euroSymb, gbpSymb)), "test", JOptionPane.INFORMATION_MESSAGE, None)
    JOptionPane.showMessageDialog(None, JLabel("Symbols: " + str(euroSymb)+str(gbpSymb)), "test", JOptionPane.INFORMATION_MESSAGE, None)
    print "Symbols: " + str(currSymb) + str(gbpSymb)
    
  8. jeff5 commented on Jul 3, 2022

    @jeff5
    MemberAuthor

    Hi Jeff, could you also fix this too please?

    This is discussed on #195.

  9. added a commit that references this issue on Apr 2, 2024
    6ee04ab
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions