Roundup Robot added the comment:
New changeset c24cbd9bd63b by Antoine Pitrou in branch '3.4':
Issue #21127: Path objects can now be instantiated from str subclass instances
(such as numpy.str_).
http://hg.python.org/cpython/rev/c24cbd9bd63b
New changeset aad6d6b819ed by Antoine Pitrou in
Antoine Pitrou added the comment:
Ok, I've committed a patch (to 3.4 and 3.5) that force-casts to str.
Thank you for reporting this bug!
--
resolution: - fixed
stage: - resolved
status: open - closed
type: - behavior
versions: +Python 3.4
___
Antony Lee added the comment:
I am loading some structure from a MATLAB binary file using scipy.io.loadmat.
This structure contains (in particular) paths (written as bytestrings) to other
files which end up being loaded as numpy.str_ objects.
In fact, just trying to store and retrieve
Antoine Pitrou added the comment:
I'm curious: what is the use case for str subclasses in Path objects?
If this is to be supported, I think I'd rather force-cast to str rather than
accept arbitrary subclasses.
--
___
Python tracker
Antony Lee added the comment:
The attached patch should fix the issue.
--
keywords: +patch
Added file: http://bugs.python.org/file34759/pathlib.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21127
New submission from Antony Lee:
Trying to construct a Path object from a str subclass, e.g.
class S(str): pass
Path(S(foo))
fails because the subclass cannot be interned. I think that the interning
should simply be removed for non-exactly-str arguments (it is only here for
performance
Changes by Ned Deily n...@acm.org:
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21127
___
___
Python-bugs-list mailing list