Skip to content

Inconsistent text at TypeError in concatenation #76284

Closed

Description

@wolfc01
mannequin
BPO 32103
Nosy @serhiy-storchaka, @wolfc01
Superseder
  • bpo-29116: Make str and bytes error messages on concatenation conform with other sequences
  • 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 = None
    closed_at = <Date 2017-11-21.16:57:58.086>
    created_at = <Date 2017-11-21.14:13:55.386>
    labels = ['interpreter-core', 'type-feature']
    title = 'Inconsistent text at TypeError in concatenation'
    updated_at = <Date 2017-11-21.16:57:58.084>
    user = 'https://github.com/wolfc01'

    bugs.python.org fields:

    activity = <Date 2017-11-21.16:57:58.084>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-21.16:57:58.086>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2017-11-21.14:13:55.386>
    creator = 'wolfc01'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32103
    keywords = []
    message_count = 2.0
    messages = ['306642', '306668']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'wolfc01']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '29116'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue32103'
    versions = ['Python 3.6']

    Activity

    1. wolfc01 commented on Nov 21, 2017

      wolfc01mannequin
      MannequinAuthor
      >>> a = b"jan"
      >>> b = "jan"
      >>> a+b
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      TypeError: can't concat str to bytes
      >>> b+a
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      TypeError: must be str, not bytes
      >>>

      IMHO The latter TypeError text should be "TypeError: can't concat bytes to str"

    2. serhiy-storchaka commented on Nov 21, 2017

      @serhiy-storchaka
      Member

      This is a duplicate of bpo-29116.

    3. transferred this issue fromon Apr 10, 2022
    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

      interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions