Message172881
| Author |
eli.bendersky |
| Recipients |
eli.bendersky, flox, patrick.vrijlandt, terry.reedy |
| Date |
2012年10月14日.13:30:50 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1350221451.23.0.0474957560121.issue12321@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I think this may be intentional. Absolute searches on a ElementTree are discouraged with a warning:
def find(self, path, namespaces=None):
# assert self._root is not None
if path[:1] == "/":
path = "." + path
warnings.warn(
"This search is broken in 1.3 and earlier, and will be "
"fixed in a future version. If you rely on the current "
"behaviour, change it to %r" % path,
FutureWarning, stacklevel=2
)
return self._root.find(path, namespaces)
See what happens when an "absolute path" is attemped? The code just hacks it into a relative path and prints a menacing warning.
So, I would not change the documentation at this point. However, the problem should go away if and when the XPath support is improved to really support absolute paths. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年10月14日 13:30:51 | eli.bendersky | set | recipients:
+ eli.bendersky, terry.reedy, flox, patrick.vrijlandt |
| 2012年10月14日 13:30:51 | eli.bendersky | set | messageid: <1350221451.23.0.0474957560121.issue12321@psf.upfronthosting.co.za> |
| 2012年10月14日 13:30:51 | eli.bendersky | link | issue12321 messages |
| 2012年10月14日 13:30:50 | eli.bendersky | create |
|