AttributeError: 'str' object has no attribute 'quote_if_needed'

Bug #1890871 reported by niftylettuce
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Authentication-Results-Python
Expired
Undecided
Unassigned

Bug Description

This seems to be a core bug, as we don't check if `value` (Str) has the attribute `quote_if_needed` (Function).

Full stack trace is provided below:

```sh
Error: Traceback (most recent call last):
  File "/var/www/production/source/node_modules/authheaders/scripts/authenticate-message.py", line 36, in <module>
    main()
  File "/var/www/production/source/node_modules/authheaders/scripts/authenticate-message.py", line 25, in main
    header = authheaders.authenticate_message(msg=message, authserv_id=authservId, ip=ip, mail_from=mailFrom, helo=helo, spf=True, dkim=True, arc=True)
  File "/home/deploy/.local/lib/python3.6/site-packages/authheaders/__init__.py", line 298, in authenticate_message
    return str(auth_res)
  File "/home/deploy/.local/lib/python3.6/site-packages/authres/core.py", line 476, in __str__
    return ''.join((self.HEADER_FIELD_NAME, ': ', self.header_value()))
  File "/home/deploy/.local/lib/python3.6/site-packages/authres/core.py", line 492, in header_value
    strs.append(str(result))
  File "/home/deploy/.local/lib/python3.6/site-packages/authres/core.py", line 222, in __str__
    strs.append(str(property_))
  File "/home/deploy/.local/lib/python3.6/site-packages/authres/core.py", line 132, in __str__
    return '%s.%s=%s' % (self.type, self.name, self.value.quote_if_needed())
AttributeError: 'str' object has no attribute 'quote_if_needed'
```

Revision history for this message
Scott Kitterman (kitterman) wrote :

I'm having some trouble seeing how this would happen. Does this happen routinely or is this a one time only issue? Can you provide me with a test case (e.g. values for msg=message, authserv_id, ip, mail_from, and helo in authheaders) that demonstrates the problem. Note that the code in question in authres has been the way it is since 2013 and I've never heard of this before, so I need more of a hint.

Changed in authentication-results-python:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Authentication-Results-Python because there has been no activity for 60 days.]

Changed in authentication-results-python:
status: Incomplete → Expired
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.