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 2016年06月05日 16:58 by JelleZijlstra, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| fspath-exception.patch | JelleZijlstra, 2016年06月05日 17:03 | |||
| Messages (4) | |||
|---|---|---|---|
| msg267432 - (view) | Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) | Date: 2016年06月05日 16:58 | |
The current implementation of os.fspath() outputs something like this if you call os.fspath(0): expected str, bytes or os.PathLike object, not <class 'int' at 0x10a3f3e50> This patch changes the output to: expected str, bytes or os.PathLike object, not int |
|||
| msg267519 - (view) | Author: SilentGhost (SilentGhost) * (Python triager) | Date: 2016年06月06日 06:50 | |
This is behaviour introduced by issue 25548, it would make sense to me to discuss this problem there if you think it's necessary. repr in error messages has been a standard approach in Python for a very long time, however. |
|||
| msg267529 - (view) | Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) | Date: 2016年06月06日 13:55 | |
No, that issue just adds the address to the repr() of types. It is not normal to use repr for type objects in error messages: >>> int(None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' >>> open(None, 0) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: open() argument 2 must be str, not int >>> os.fspath(None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: expected str, bytes or os.PathLike object, not <class 'NoneType' at 0x1086bb638> |
|||
| msg278184 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2016年10月06日 11:09 | |
This has already been fixed in ea7b6a7827a4: >>> import os >>> os.fspath(None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: expected str, bytes or os.PathLike object, not NoneType |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:32 | admin | set | github: 71419 |
| 2016年10月06日 11:09:54 | berker.peksag | set | status: open -> closed superseder: Show the address in the repr for class objects -> nosy: + berker.peksag messages: + msg278184 resolution: out of date type: behavior |
| 2016年06月06日 14:02:31 | JelleZijlstra | link | issue27231 dependencies |
| 2016年06月06日 13:57:15 | JelleZijlstra | set | status: closed -> open resolution: not a bug -> (no value) |
| 2016年06月06日 13:55:27 | JelleZijlstra | set | messages: + msg267529 |
| 2016年06月06日 06:50:15 | SilentGhost | set | status: open -> closed superseder: Show the address in the repr for class objects nosy: + SilentGhost messages: + msg267519 resolution: not a bug stage: resolved |
| 2016年06月05日 17:03:14 | JelleZijlstra | set | files: - fspath-exception.patch |
| 2016年06月05日 17:03:04 | JelleZijlstra | set | files: + fspath-exception.patch |
| 2016年06月05日 16:58:05 | JelleZijlstra | create | |