New submission from Vlastimil Zíma :
When an `EmailMessage` is created without setting its content, it may lack the
`MIME-Version` header. I encountered this behavior when creating a S/MIME
signed message, but I believe it applies to any `EmailMessage` in general.
Example:
from
Vlastimil Zíma added the comment:
Since the issue was dug up, I've created a patch for documentation.
I still think, that it is worth stating the equality is not preserved for
sentinels when copied as the message produced by tests is rather confusing:
class SentinelTestCase(TestCase
Vlastimil Zíma added the comment:
David, first part of your comment should be added to docs. Purpose of sentinels
isn't much intuitive and in my opinion documentation doesn't quite describe it.
An exception in case of pickle or copy would be much easier to understand apart
from unexpected
New submission from Vlastimil Zíma:
Sentinels lose their identity when they are pickled, meaning they are no longer
equal to sentinel with the same name.
from mock import sentinel
import pickle
sentinel.foo == sentinel.foo
True
pickle.loads(pickle.dumps(sentinel.foo)) == sentinel.foo
Vlastimil Zíma added the comment:
I don't question pickle, but I'd expect sentinels to keep their equality when
they are pickled or copied.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20804
Vlastimil Zíma added the comment:
I encountered this problem when I tested code with cache, something like
def test_foo(self):
cache.set('a_key', sentinel.status) # Performs pickle
self.assertEqual(
cache.get('a_key'), # Performs unpickle