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

fix for test_asynchat and test_asyncore on pep3137 branch #45721

Closed
hupp mannequin opened this issue Nov 3, 2007 · 2 comments
Closed

fix for test_asynchat and test_asyncore on pep3137 branch #45721

hupp mannequin opened this issue Nov 3, 2007 · 2 comments
Labels
stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@hupp
Copy link
Mannequin

hupp mannequin commented Nov 3, 2007

BPO 1380
Nosy @tiran
Files
  • pep3137-asynfix.patch
  • 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 2007-11-03.18:30:55.672>
    created_at = <Date 2007-11-03.18:06:42.804>
    labels = ['tests', 'type-bug', 'library']
    title = 'fix for test_asynchat and test_asyncore on pep3137 branch'
    updated_at = <Date 2008-01-06.22:29:45.430>
    user = 'https://bugs.python.org/hupp'

    bugs.python.org fields:

    activity = <Date 2008-01-06.22:29:45.430>
    actor = 'admin'
    assignee = 'none'
    closed = True
    closed_date = <Date 2007-11-03.18:30:55.672>
    closer = 'christian.heimes'
    components = ['Library (Lib)', 'Tests']
    creation = <Date 2007-11-03.18:06:42.804>
    creator = 'hupp'
    dependencies = []
    files = ['8684']
    hgrepos = []
    issue_num = 1380
    keywords = ['patch']
    message_count = 2.0
    messages = ['57086', '57087']
    nosy_count = 2.0
    nosy_names = ['hupp', 'christian.heimes']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue1380'
    versions = ['Python 3.0']

    @hupp
    Copy link
    Mannequin Author

    hupp mannequin commented Nov 3, 2007

    The attached patch resolves test failues in test_asynchat and
    test_asyncore.

    The asynchat failure was due to interpolating a byte string into a
    unicode string using %s. This resulted in a b'' byte representation
    in the final string. The fix is to use string constants instead of
    byte constants. The result is encoded to bytes later on.

    The asyncore failure was due to an explicit isinstance(data, bytes)
    check on the result of recv. The actual type in this case was buffer.
    I've removed the check since the next line calls

    data.replace(b'\n', b'')

    This all should fail for anything thats not a buffer or bytes.

    @hupp hupp mannequin added stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Nov 3, 2007
    @tiran
    Copy link
    Member

    tiran commented Nov 3, 2007

    Applied in r58831

    Thanks!

    @tiran tiran closed this as completed Nov 3, 2007
    @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
    stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant