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

quit() method of SMTP instance (of smtplib) doesn't return it's result #46501

Closed
funagayama mannequin opened this issue Mar 7, 2008 · 4 comments
Closed

quit() method of SMTP instance (of smtplib) doesn't return it's result #46501

funagayama mannequin opened this issue Mar 7, 2008 · 4 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@funagayama
Copy link
Mannequin

funagayama mannequin commented Mar 7, 2008

BPO 2248
Nosy @gvanrossum, @birkenfeld
Files
  • smtplib.py.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 2008-03-27.13:27:48.056>
    created_at = <Date 2008-03-07.07:42:57.702>
    labels = ['type-feature', 'library']
    title = "quit() method of SMTP instance (of smtplib) doesn't return it's result"
    updated_at = <Date 2008-03-27.13:27:47.914>
    user = 'https://bugs.python.org/funagayama'

    bugs.python.org fields:

    activity = <Date 2008-03-27.13:27:47.914>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-03-27.13:27:48.056>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2008-03-07.07:42:57.702>
    creator = 'funagayama'
    dependencies = []
    files = ['9626']
    hgrepos = []
    issue_num = 2248
    keywords = ['patch']
    message_count = 4.0
    messages = ['63346', '64205', '64288', '64590']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'georg.brandl', 'jafo', 'funagayama']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue2248'
    versions = ['Python 2.6', 'Python 2.5', 'Python 2.4']

    @funagayama
    Copy link
    Mannequin Author

    funagayama mannequin commented Mar 7, 2008

    Hi,

    I've found that the quit() method of SMTP instance (of smtplib) doesn't
    return it's result (such as '221 2.0.0 Bye') .
    Other methods such as helo(), ehlo(), verify() etc.. returns it's result
    correctly so I suppose it's a kind of bug.

    I've made a small patch for this so please take a look at it (It looks
    like someone just forgot to return the value of docmd()).

    below is the code piece to represent the problem.

    >>> import smtplib
    >>> s = smtplib.SMTP('localhost')
    >>> s.helo() #<---- returns result code
    (250, 'localhost')
    >>> s.vrfy('user@example.com') #<---- returns result code
    (554, '5.7.1 <<user@example.com>>: Relay access denied')
    >>> s.quit() #<----- doesn't return anything
    >>>

    Thanks,
    Kei

    @funagayama funagayama mannequin added the stdlib Python modules in the Lib dir label Mar 7, 2008
    @jafo
    Copy link
    Mannequin

    jafo mannequin commented Mar 20, 2008

    Kei: The documentation does not say that quit() returns a value, so the
    current behavior is correct. However, SMTP defines a return value for
    QUIT, so there is a case for smtplib.quit() returning that value.

    This patch does need a documentation change to Doc/library/smtplib.rst

    Guido: You wrote and last touched this code, any objections?

    @jafo jafo mannequin assigned gvanrossum Mar 20, 2008
    @jafo jafo mannequin added the type-feature A feature request or enhancement label Mar 20, 2008
    @gvanrossum
    Copy link
    Member

    No time to review, but making a function return something useful instead
    of None seems a good idea.

    @gvanrossum gvanrossum removed their assignment Mar 21, 2008
    @birkenfeld
    Copy link
    Member

    Added docs and committed as r61977.

    @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-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants