Commit 7651a49
committed
Translate encoder error codes to strings
When decoding, we use raise_oserror() to convert codec error codes to
strings. Adapt that code to be used when encoding as well. Add a new
helper function that returns the exception so we can still raise
`from exc`.
Ideally we'd replace the other two callers of raise_oserror() with
`raise _get_oserror()`, but the former is part of the public API.1 parent 1a98590 commit 7651a49
1 file changed
+9
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
551 | 555 | | |
552 | 556 | | |
553 | 557 | | |
554 | | - | |
555 | | - | |
| 558 | + | |
556 | 559 | | |
557 | 560 | | |
558 | 561 | | |
| |||
0 commit comments