Repository: sphinx-doc/sphinx

Issue:
AttributeError on building translated document
### Problem
- Sphinx raises `AttributeError` on building translated document

#### Procedure to reproduce the problem
```
make html
```

#### Error logs / results
```
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/cmd/build.py", line 288, in build_main
    app.build(args.force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/application.py", line 339, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 327, in build_update
    len(to_build))
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 340, in build
    updated_docnames = set(self.read())
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 448, in read
    self._read_serial(docnames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 470, in _read_serial
    self.read_doc(docname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 514, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/io.py", line 318, in read_doc
    pub.publish()
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/envs/latest/lib/python3.5/site-packages/docutils/core.py", line 218, in publish
    self.apply_transforms()
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/envs/latest/lib/python3.5/site-packages/docutils/core.py", line 199, in apply_transforms
    self.document.transformer.apply_transforms()
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/transforms/__init__.py", line 90, in apply_transforms
    Transformer.apply_transforms(self)
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/envs/latest/lib/python3.5/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms
    transform.apply(**kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/transforms/i18n.py", line 465, in apply
    node.delattr('translated')
AttributeError: 'Text' object has no attribute 'delattr'
```
- https://readthedocs.org/projects/sphinx-ja/builds/8122170/

#### Expected results
Build succeeded.

### Reproducible project / your project
- Sphinx!


Discussion:

Patch:
diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py
index f98c72b37..dd0a08983 100644
--- a/sphinx/util/nodes.py
+++ b/sphinx/util/nodes.py
@@ -67,6 +67,9 @@ def match(self, node):
             if self.classes and not isinstance(node, self.classes):
                 return False
 
+            if self.attrs and isinstance(node, nodes.Text):
+                return False
+
             for key, value in self.attrs.items():
                 if key not in node:
                     return False


Test patch:
diff --git a/tests/test_util_nodes.py b/tests/test_util_nodes.py
index 2fab10c1c..04b437a4f 100644
--- a/tests/test_util_nodes.py
+++ b/tests/test_util_nodes.py
@@ -82,6 +82,10 @@ def test_NodeMatcher():
     matcher = NodeMatcher(nodes.title)
     assert len(doctree.traverse(matcher)) == 0
 
+    # search with Any does not match to Text node
+    matcher = NodeMatcher(blah=Any)
+    assert len(doctree.traverse(matcher)) == 0
+
 
 @pytest.mark.parametrize(
     'rst,node_cls,count',