This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年08月25日 18:44 by sbt, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| winerror.patch | sbt, 2012年08月25日 19:06 | review | ||
| Messages (9) | |||
|---|---|---|---|
| msg169153 - (view) | Author: Richard Oudkerk (sbt) * (Python committer) | Date: 2012年08月25日 18:44 | |
Since WindowsError became an alias of OSError, the error number shown in the stringification of an OSError err can either be a windows error code (err.winerror) or a posix style error number (err.errno), with no way to tell which. For instance in >>> os.read(999, 0) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: [Errno 9] Bad file descriptor err.errno == EBADF == 9 and err.winerror == None, but in >>> _winapi.ReadFile(999, 0) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: [Error 6] The handle is invalid err.errno == EBADF == 9 and err.winerror == ERROR_INVALID_HANDLE == 6. (winerror gets priority over errno if it exists.) With the attached patch the second will be shown as >>> _winapi.ReadFile(999, 0) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: [WinError 6] The handle is invalid ^^^ Since this issue only applies to 3.3 and the patch is trivial, it would be nice to get this in before 3.3 is released. |
|||
| msg169224 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年08月27日 21:30 | |
I originally kept it that way to minimize disruption with 3.2, but I agree it's a welcome change. As for acceptance in 3.3, Georg will have to decide. |
|||
| msg169226 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2012年08月27日 21:36 | |
Uh, currently it's "Errno" or "Error", so there is a way to tell which. I'll leave to Antoine to decide what to do here; it's not like changing it a big deal. "WinError" looks kind of ugly to me though. |
|||
| msg169227 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年08月27日 22:13 | |
Well, "Error" and "Errno" are rather hard to distinguish, and the difference isn't obvious either, so Richard's patch is a good improvement IMHO. |
|||
| msg169241 - (view) | Author: Richard Oudkerk (sbt) * (Python committer) | Date: 2012年08月28日 00:33 | |
> Well, "Error" and "Errno" are rather hard to distinguish Embarrassingly, I did not even notice the was a difference. |
|||
| msg169291 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年08月28日 19:22 | |
New changeset 2e587b9bae35 by Richard Oudkerk in branch 'default': Issue #15784: Modify OSError.__str__() to better distinguish between http://hg.python.org/cpython/rev/2e587b9bae35 |
|||
| msg169366 - (view) | Author: Richard Oudkerk (sbt) * (Python committer) | Date: 2012年08月29日 11:25 | |
The changeset is 2e587b9bae35. Georg, could you copy it to your release branch please. |
|||
| msg170029 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2012年09月08日 05:49 | |
Done in 4e941113e4fa. |
|||
| msg170089 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年09月09日 09:18 | |
New changeset 4e941113e4fa by Richard Oudkerk in branch 'default': Issue #15784: Modify OSError.__str__() to better distinguish between http://hg.python.org/cpython/rev/4e941113e4fa |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:35 | admin | set | github: 59988 |
| 2012年09月09日 09:18:56 | python-dev | set | messages: + msg170089 |
| 2012年09月08日 05:49:25 | georg.brandl | set | status: open -> closed messages: + msg170029 |
| 2012年08月29日 11:25:39 | sbt | set | messages: + msg169366 |
| 2012年08月28日 19:22:47 | python-dev | set | nosy:
+ python-dev messages: + msg169291 |
| 2012年08月28日 00:33:37 | sbt | set | messages: + msg169241 |
| 2012年08月27日 22:13:54 | pitrou | set | assignee: sbt messages: + msg169227 components: + Interpreter Core versions: + Python 3.3 |
| 2012年08月27日 21:36:48 | georg.brandl | set | messages: + msg169226 |
| 2012年08月27日 21:30:10 | pitrou | set | messages: + msg169224 |
| 2012年08月27日 21:29:09 | pitrou | set | nosy:
+ georg.brandl |
| 2012年08月25日 19:06:30 | sbt | set | files: - winerror.patch |
| 2012年08月25日 19:06:26 | sbt | set | files: + winerror.patch |
| 2012年08月25日 18:44:37 | sbt | create | |