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

Bug python 3.4.X #67

Closed
marioidival opened this issue May 21, 2015 · 7 comments
Closed

Bug python 3.4.X #67

marioidival opened this issue May 21, 2015 · 7 comments

Comments

@marioidival
Copy link
Contributor

Hi, I tried send an email with pyramid_mailer using mailer.send_immediately(message_instance) I given this: *** TypeError: unorderable types: str() > int()

https://www.dropbox.com/s/rvxggi0wqdtdarl/Captura%20de%20tela%202015-05-21%2017.19.38.png?dl=0

@marioidival marioidival changed the title Bug python 3.4 Bug python 3.4.3 May 21, 2015
@marioidival
Copy link
Contributor Author

This bug is in stmp package of python 3.4.X
Pyramid Mailer don't run with 3.4.X

https://www.dropbox.com/s/71g1kxcfqufueko/Captura%20de%20tela%202015-05-21%2017.33.10.png?dl=0

@marioidival marioidival changed the title Bug python 3.4.3 Bug python 3.4.X May 21, 2015
@mmerickel
Copy link
Member

The issue appears to be that we are not properly converting the debug value into an int in Mailer.from_settings. This should be a simple fix if you want to do a pull request with a test. Otherwise someone else will get to it, I'm just not sure when.

@marioidival
Copy link
Contributor Author

Yes! Fixed 💃

@marioidival
Copy link
Contributor Author

@mmerickel

    @classmethod
    def from_settings(cls, settings, prefix='mail.'):
        """Create a new instance of 'Mailer' from settings dict.

        :param settings: a settings dict-like
        :param prefix: prefix separating 'pyramid_mailer' settings
        """
        settings = settings or {}

        kwarg_names = [prefix + k for k in (
                       'host', 'port', 'username',
                       'password', 'tls', 'ssl', 'keyfile',
                       'certfile', 'queue_path', 'debug', 'default_sender',
                       'sendmail_app', 'sendmail_template')]

        size = len(prefix)

        kwargs = dict(((k[size:], settings[k]) for k in settings.keys() if
                        k in kwarg_names))

        for key in ('tls', 'ssl'):
            val = kwargs.get(key)
            if val:
                kwargs[key] = asbool(val)

        for key in ('debug', 'port'):
            val = kwargs.get(key)
            if val:
                kwargs[key] = int(val)

        # list values
        for key in ('sendmail_template', ):
            if key in kwargs:
                kwargs[key] = aslist(kwargs.get(key))

        return cls(**kwargs)

@marioidival
Copy link
Contributor Author

@mmerickel If I send the pull-request, how long will the new release coming out? (I'm on a task that goes into production in a few moments)

marioidival added a commit to marioidival/pyramid_mailer that referenced this issue May 21, 2015
mmerickel added a commit that referenced this issue May 21, 2015
Coverting debug and port values in Mailer.from_settings #67
@mmerickel
Copy link
Member

Fixed in #67.

@mmerickel
Copy link
Member

I just released 0.14.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants