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

rfc822.py line 395 strings connection #47184

Closed
erezbibi mannequin opened this issue May 21, 2008 · 2 comments
Closed

rfc822.py line 395 strings connection #47184

erezbibi mannequin opened this issue May 21, 2008 · 2 comments
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@erezbibi
Copy link
Mannequin

erezbibi mannequin commented May 21, 2008

BPO 2935
Nosy @jackdied
Files
  • rfc822.py: my bug fix
  • 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 2008-08-01.18:45:40.655>
    created_at = <Date 2008-05-21.14:44:37.839>
    labels = ['invalid', 'library', 'type-crash']
    title = 'rfc822.py line 395 strings connection'
    updated_at = <Date 2008-08-01.18:45:40.653>
    user = 'https://bugs.python.org/erezbibi'

    bugs.python.org fields:

    activity = <Date 2008-08-01.18:45:40.653>
    actor = 'jackdied'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-08-01.18:45:40.655>
    closer = 'jackdied'
    components = ['Library (Lib)']
    creation = <Date 2008-05-21.14:44:37.839>
    creator = 'erezbibi'
    dependencies = []
    files = ['10391']
    hgrepos = []
    issue_num = 2935
    keywords = []
    message_count = 2.0
    messages = ['67157', '70582']
    nosy_count = 2.0
    nosy_names = ['jackdied', 'erezbibi']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue2935'
    versions = ['Python 2.5']

    @erezbibi
    Copy link
    Mannequin Author

    erezbibi mannequin commented May 21, 2008

    Python 2.5 on Windows
    rfc822.py line 395
    text = name + ": " + value

    if 'value' is not a string python will generate an exception. It might
    be due to a broken website, but it is not a reason to crash.

    I'm using ClientCookie with a Request object (but I don't know the
    faulty URL)

    >>> req = urllib2.Request (url)
    >>> page = ClientCookie.urlopen (req)
    Traceback (most recent call last):
      ...
      File "build\bdist.win32\egg\ClientCookie\_urllib2_support.py", line
    824, in urlopen
        return _opener.open(url, data)
      File "C:\Python25\lib\urllib2.py", line 380, in open
        response = meth(req, response)
      File "build\bdist.win32\egg\ClientCookie\_urllib2_support.py", line
    412, in http_response
        headers[hdr] = val
      File "C:\Python25\lib\rfc822.py", line 395, in __setitem__
        text = name + ": " + value
    TypeError: cannot concatenate 'str' and 'NoneType' objects

    A simple fix is to replace
    text = name + ": " + value
    with
    text = ("%s: %s" % (name, value))
    In rfc822.py line 395

    @erezbibi erezbibi mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels May 21, 2008
    @jackdied
    Copy link
    Contributor

    jackdied commented Aug 1, 2008

    This is a bug in the external ClientCookie module (and their website
    hasn't been updated since 2006).

    Marking closed.

    @jackdied jackdied closed this as completed Aug 1, 2008
    @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 type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant