[issue47141] EmailMessage may lack Mime-Version

2022-03-28 Thread Vlastimil Zíma
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

[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-11 Thread Vlastimil Zíma
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

[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-03-03 Thread Vlastimil Zíma
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

[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread Vlastimil Zíma
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

[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread Vlastimil Zíma
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

[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread Vlastimil Zíma
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