commit | 243757eb79fe4bee33882b1813cf33839117570f | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Fri Nov 05 21:15:39 2010 +0000 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Fri Nov 05 21:15:39 2010 +0000 |
tree | a9403be5a75dedbb5c5b6ea4ee563b7155c707fd | |
parent | 4a5f9677f31d75454ec10a0baefef37b63568a31 [diff] [blame] |
Issue #10180: Pickling file objects is now explicitly forbidden, since unpickling them produced nonsensical results.
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 83bce70..87c833c 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py
@@ -747,6 +747,10 @@ def mode(self): return self.raw.mode + def __getstate__(self): + raise TypeError("can not serialize a '{0}' object" + .format(self.__class__.__name__)) + def __repr__(self): clsname = self.__class__.__name__ try: