Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tk.split() doesn't work with nested Unicode strings #62301

Closed
serhiy-storchaka opened this issue May 30, 2013 · 4 comments
Closed

Tk.split() doesn't work with nested Unicode strings #62301

serhiy-storchaka opened this issue May 30, 2013 · 4 comments
Assignees
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 18101
Nosy @ezio-melotti, @serwy, @serhiy-storchaka
Files
  • tkinter_split_nested_unicode.patch: Patch for 3.3+
  • tkinter_split_nested_unicode-2.7.patch: Patch for 2.7
  • tkinter_split_nested_unicode_2.patch: Patch for 3.3+
  • tkinter_split_nested_unicode-2.7_2.patch: Patch for 2.7
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2013-07-11.17:54:57.125>
    created_at = <Date 2013-05-30.13:59:21.378>
    labels = ['type-bug', 'expert-tkinter']
    title = "Tk.split() doesn't work with nested Unicode strings"
    updated_at = <Date 2013-07-11.17:54:57.124>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2013-07-11.17:54:57.124>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2013-07-11.17:54:57.125>
    closer = 'serhiy.storchaka'
    components = ['Tkinter']
    creation = <Date 2013-05-30.13:59:21.378>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['30426', '30427', '30516', '30517']
    hgrepos = []
    issue_num = 18101
    keywords = ['patch']
    message_count = 4.0
    messages = ['190359', '190867', '190868', '192882']
    nosy_count = 6.0
    nosy_names = ['gpolo', 'ezio.melotti', 'roger.serwy', 'Arfrever', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue18101'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

    @serhiy-storchaka
    Copy link
    Member Author

    Tk.split() doesn't work with nested Unicode strings, but works with nested bytes.

    >>> import tkinter
    >>> t = tkinter.Tcl()
    >>> t.split('a {b c}')
    ('a', ('b', 'c'))
    >>> t.split(b'a {b c}')
    ('a', ('b', 'c'))
    >>> t.split(('a {b c}',))
    ('a {b c}',)
    >>> t.split((b'a {b c}',))
    (('a', ('b', 'c')),)

    I think this is unintentional. Here is a patch which processes strings inside a tuple as bytes objects. It also adds tests for Tk.splitline() and Tk.split().

    @serhiy-storchaka serhiy-storchaka added topic-tkinter type-bug An unexpected behavior, bug, or error labels May 30, 2013
    @serhiy-storchaka serhiy-storchaka self-assigned this Jun 8, 2013
    @serhiy-storchaka
    Copy link
    Member Author

    Ezio, have you reviewed the main code?

    @serhiy-storchaka
    Copy link
    Member Author

    Here are patches with updated tests as Ezio suggested.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 11, 2013

    New changeset f53cdd4e2689 by Serhiy Storchaka in branch '2.7':
    Issue bpo-18101: Tcl.split() now process Unicode strings nested in a tuple as it
    http://hg.python.org/cpython/rev/f53cdd4e2689

    New changeset 9486c07929a1 by Serhiy Storchaka in branch '3.3':
    Issue bpo-18101: Tcl.split() now process strings nested in a tuple as it
    http://hg.python.org/cpython/rev/9486c07929a1

    New changeset 16c48d553ddb by Serhiy Storchaka in branch 'default':
    Issue bpo-18101: Tcl.split() now process strings nested in a tuple as it
    http://hg.python.org/cpython/rev/16c48d553ddb

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-tkinter type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant