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

TypeErrors not formatting values correctly #74091

Closed
DimitrisJim mannequin opened this issue Mar 25, 2017 · 3 comments
Closed

TypeErrors not formatting values correctly #74091

DimitrisJim mannequin opened this issue Mar 25, 2017 · 3 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@DimitrisJim
Copy link
Mannequin

DimitrisJim mannequin commented Mar 25, 2017

BPO 29905
Nosy @josiahcarlson, @vstinner, @giampaolo, @1st1, @DimitrisJim
PRs
  • bpo-29905: Fix TypeError message formatting in asynchat and proactor_events #819
  • bpo-29905: Fix TypeError in asyncio/proactor_events #993
  • [3.6] bpo-29905: Fix TypeError is asyncio/proactor_events (GH-993) #2061
  • [3.5] bpo-29905: Fix TypeError is asyncio/proactor_events (GH-993) #2060
  • 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-06-10.09:00:18.966>
    created_at = <Date 2017-03-25.21:10:20.380>
    labels = ['3.7', 'type-bug', 'library', 'expert-asyncio']
    title = 'TypeErrors not formatting values correctly'
    updated_at = <Date 2017-06-10.09:00:18.953>
    user = 'https://github.com/DimitrisJim'

    bugs.python.org fields:

    activity = <Date 2017-06-10.09:00:18.953>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-06-10.09:00:18.966>
    closer = 'vstinner'
    components = ['Library (Lib)', 'asyncio']
    creation = <Date 2017-03-25.21:10:20.380>
    creator = 'Jim Fasarakis-Hilliard'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 29905
    keywords = []
    message_count = 3.0
    messages = ['290499', '291134', '295624']
    nosy_count = 6.0
    nosy_names = ['josiahcarlson', 'vstinner', 'giampaolo.rodola', 'stutzbach', 'yselivanov', 'Jim Fasarakis-Hilliard']
    pr_nums = ['819', '993', '2061', '2060']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue29905'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @DimitrisJim
    Copy link
    Mannequin Author

    DimitrisJim mannequin commented Mar 25, 2017

    Specifically, in both Lib/async/proactor_events.py and asynchat.py there's a comma where a % should be thereby not formatting the value correctly:

    TypeError('data argument must be byte-ish (%r)', type(data))
    TypeError('data argument must be byte-ish (%r)', type(data))
    

    proposed fix is to change them to:

    TypeError('data argument must be a bytes-like object, not %r' % type(data).__name__)
    TypeError('data argument must be a bytes-like object, not %r' % type(data).__name__)
    

    @DimitrisJim DimitrisJim mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Mar 25, 2017
    @DimitrisJim
    Copy link
    Mannequin Author

    DimitrisJim mannequin commented Apr 4, 2017

    As per #bpo-25002 and, specifically #msg250151, the TypeError in asynchat should probably not be included, I'll just make a PR for the TypeError in asyncio/proactor_events

    @vstinner
    Copy link
    Member

    It seems like the bug has been fixed in all branches, so I close the issue.

    @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
    3.7 (EOL) end of life stdlib Python modules in the Lib dir topic-asyncio type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant