[issue21127] Path objects cannot be constructed from str subclasses

2014-04-22 Thread Roundup Robot
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

[issue21127] Path objects cannot be constructed from str subclasses

2014-04-22 Thread Antoine Pitrou
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 ___

[issue21127] Path objects cannot be constructed from str subclasses

2014-04-11 Thread Antony Lee
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

[issue21127] Path objects cannot be constructed from str subclasses

2014-04-10 Thread Antoine Pitrou
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

[issue21127] Path objects cannot be constructed from str subclasses

2014-04-08 Thread Antony Lee
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

[issue21127] Path objects cannot be constructed from str subclasses

2014-04-01 Thread Antony Lee
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

[issue21127] Path objects cannot be constructed from str subclasses

2014-04-01 Thread Ned Deily
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