Re: [Python-Dev] [RELEASED] Python 3.4.5 and Python 3.5.2 are now available
On 26Jun2016 1932, Larry Hastings wrote: https://www.python.org/downloads/release/python-352/ ... /p.s. There appears to be a small oops with the Windows installers for 3.5.2--uploaded to the wrong directory or something. They'll be available soon, honest! That oops is now fixed, but I wanted to mention one other thing. Microsoft Security Essentials, now a very common antivirus/antimalware scanner on Windows, is incorrectly detecting Lib/distutils/command/wininst-14.0.exe as malware (originally reported at http://bugs.python.org/issue27383). My assumption is that someone distributed malware using a bdist_exe package, and our stub executable got picked up in the signature. I rebuilt the executable on my own machine from early source code and it still triggered the scan, so there does not appear to have been any change to the behaviour of the executable. I've already submitted a false positive report, so I expect an update to correct it at some point in the future, but please do not be alarmed to see this warning when installing Python 3.5.2, or when scanning any earlier version of 3.5. Feel free to contact me off-list or steve.dower at microsoft.com if you have concerns. Cheers, Steve ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] When to use EOFError?
On Jun 21 2016, Serhiy Storchaka wrote: > There is a design question. If you read file in some format or with > some protocol, and the data is ended unexpectedly, when to use general > EOFError exception and when to use format/protocol specific exception? > > For example when load truncated pickle data, an unpickler can raise > EOFError, UnpicklingError, ValueError or AttributeError. It is > possible to avoid ValueError or AttributeError, but what exception > should be raised instead, EOFError or UnpicklingError? I think EOFError conveys more information. UnpicklingError can mean a lot of things, EOFError tells you the precise problem: pickle expected more data, but there was nothing left. I think in doubt the more specific exception (in this case EOFError) should be raised. Best, -Nikolaus -- GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F »Time flies like an arrow, fruit flies like a Banana.« ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] When to use EOFError?
On 06/21/2016 01:48 PM, Serhiy Storchaka wrote: There is a design question. If you read file in some format or with some protocol, and the data is ended unexpectedly, when to use general EOFError exception and when to use format/protocol specific exception? I believe that EOFError was created for the situation when a file unexpectedly ends. -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] When to use EOFError?
Nikolaus Rath wrote: I think EOFError conveys more information. UnpicklingError can mean a lot of things, EOFError tells you the precise problem: pickle expected more data, but there was nothing left. I think EOFError should be used for EOF between pickles, but UnpicklingError should be used for EOF in the middle of a pickle. The former is not necessarily an error, but the latter definitely is. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] When to use EOFError?
On 06/27/2016 02:54 PM, Greg Ewing wrote: Nikolaus Rath wrote: I think EOFError conveys more information. UnpicklingError can mean a lot of things, EOFError tells you the precise problem: pickle expected more data, but there was nothing left. I think EOFError should be used for EOF between pickles, but UnpicklingError should be used for EOF in the middle of a pickle. The former is not necessarily an error, but the latter definitely is. Why is hitting the end of a file between pickles an error? -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] When to use EOFError?
The point is that it's not an error. In Andre Malo's use case, at least, EOFError is used as a control flow exception, not as an error. On Mon, Jun 27, 2016 at 3:06 PM, Ethan Furman wrote: > On 06/27/2016 02:54 PM, Greg Ewing wrote: >> >> Nikolaus Rath wrote: >>> >>> I think EOFError conveys more information. UnpicklingError can mean a >>> lot of things, EOFError tells you the precise problem: pickle expected >>> more data, but there was nothing left. >> >> >> I think EOFError should be used for EOF between pickles, >> but UnpicklingError should be used for EOF in the middle of >> a pickle. The former is not necessarily an error, but the >> latter definitely is. > > > Why is hitting the end of a file between pickles an error? > > -- > ~Ethan~ > > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] When to use EOFError?
On 06/27/2016 03:20 PM, Guido van Rossum wrote: The point is that it's not an error. In Andre Malo's use case, at least, EOFError is used as a control flow exception, not as an error. Like StopIteration then: only an error if it escapes. -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] When to use EOFError?
On Mon, Jun 27, 2016, at 12:40, Ethan Furman wrote: > On 06/21/2016 01:48 PM, Serhiy Storchaka wrote: > > > There is a design question. If you read file in some format or with some > > protocol, and the data is ended unexpectedly, when to use general > > EOFError exception and when to use format/protocol specific exception? > > I believe that EOFError was created for the situation when a file > unexpectedly ends. The problem is that's not a good abstraction for the class of errors we're discussing, because it means you've got to pick: the thing your parser parses is a file [and non-files are supported by wrapping them in a StringIO/BytesIO] or it is a str/bytes [and files are supported by reading their data into a string]. Or you could use a third option: a method that accepts a file raises EOFError, and a method that accepts a string raises some other error (ValueError?), and if either is implemented in terms of the other it's got to wrap the exception. (Also, that's nonsense. EOFError is also used when a file *expectedly* ends - EAFP i.e. "Exceptions As Flow-control is Pythonic" ;) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] When to use EOFError?
On Mon, Jun 27, 2016 at 03:47:31PM -0700, Ethan Furman wrote: > On 06/27/2016 03:20 PM, Guido van Rossum wrote: > > >The point is that it's not an error. In Andre Malo's use case, at > >least, EOFError is used as a control flow exception, not as an error. > > Like StopIteration then: only an error if it escapes. Well, not quite -- if you're expected four pickles in a file, and get EOFError after pickle #2, then it's an actual error. But that's up to the caller to decide. EOFError just means there's nothing more to read in a situation where returning an empty (byte) string isn't an option. The meaning you give to that depends on your expectations. I think Greg had the right idea: raise a pickle error if you hit EOF in the middle of a pickle, because that absolutely means your data is corrupt; raise EOFError when you hit EOF at the very beginning of the file, or after a complete pickle. -- Steve ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] [RELEASE] Python 2.7.12
It is my privilege to present you with another release in the Python 2.7 series, Python 2.7.12. Since the release candidate, there were two changes: - The Windows binaries have been changed to use OpenSSL 1.0.2h. - The "about" dialog in IDLE was fixed. Downloads, as always, are on python.org: https://www.python.org/downloads/release/python-2712/ The complete 2.7.12 changelog is available at https://hg.python.org/cpython/raw-file/v2.7.12/Misc/NEWS Yet another Python 2.7.x release is anticipated near the end of the year. Numerologists may wish to upgrade to Python 3 before we hit the unlucky 2.7.13. Servus, Benjamin 2.7 release manager ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com