Invalid config object for SMTPConnection

Bug #988180 reported by Aleksandr Smyshliaev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar hookless email
New
Undecided
Unassigned

Bug Description

Using Bazaar version 2.5.0, the script fails with the following traceback:

Traceback (most recent call last):
  File "/home/alex/bzr/bzr-hookless-email/bzr_hookless_email.py", line 389, in <module>
    main()
  File "/home/alex/bzr/bzr-hookless-email/bzr_hookless_email.py", line 73, in main
    branch.update()
  File "/home/alex/bzr/bzr-hookless-email/bzr_hookless_email.py", line 162, in update
    smtp = SMTPConnection(self._config)
  File "/usr/lib/python2.6/site-packages/bzrlib/smtp_connection.py", line 67, in __init__
    self._config_smtp_server = config.get('smtp_server')
AttributeError: 'BranchConfig' object has no attribute 'get'

Revision history for this message
Aleksandr Smyshliaev (a1s) wrote :

It appears that SMTPConnection wants a Stack object for its config argument. Following patch helps:

=== modified file 'bzr_hookless_email.py'
--- bzr_hookless_email.py 2012-03-22 15:15:15 +0000
+++ bzr_hookless_email.py 2012-04-25 06:05:55 +0000
@@ -159,7 +159,7 @@
         self._config = self._branch.get_config()

     def update(self):
- smtp = SMTPConnection(self._config)
+ smtp = SMTPConnection(self._branch.get_config_stack())
         smtp_from = None
         for revision in self._revisions_to_send():
             msg = self._compose_email(revision)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.