prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [requires} in conanfile.txt gives no error
  The typo:
  
  ```
  [requires}
  ...
  ```
  
  in `conanfile.txt` does not give any error indication at all when running `conan install ...`. The way to see that something is wrong is that it doesn't do anything, but finding the cause was not as easy as it could've been.
  
  This is on 0.9.2 on Ubuntu 15.10.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `conans/util/config_parser.py`
  Content:
  ```
  1 import re
  2 from conans.errors import ConanException
  3 
  4 
  5 class ConfigParser(object):
  6     """ util class to load a file with sections as [section1]
  7     checking the values of those sections, and returns each section
  8     as parser.section
  9     Currently used in ConanInfo and ConanFileTextLoader
  10     """
  11     def __init__(self, text, allowed_fields=None, parse_lines=False):
  12         self._sections = {}
  13         self._allowed_fields = allowed_fields or []
  14         pattern = re.compile("^\[([a-z_]{2,50})\]")
  15         current_lines = []
  16         for line in text.splitlines():
  17             line = line.strip()
  18             if not line or line[0] == '#':
  19                 continue
  20             m = pattern.match(line)
  21             if m:
  22                 group = m.group(1)
  23                 if self._allowed_fields and group not in self._allowed_fields:
  24                     raise ConanException("ConfigParser: Unrecognized field '%s'" % group)
  25                 current_lines = []
  26                 self._sections[group] = current_lines
  27             else:
  28                 if parse_lines:
  29                     line = line.split('#')[0]
  30                     line = line.strip()
  31                 current_lines.append(line)
  32 
  33     def __getattr__(self, name):
  34         if name in self._sections:
  35             return "\n".join(self._sections[name])
  36         else:
  37             if self._allowed_fields and name in self._allowed_fields:
  38                 return ""
  39             else:
  40                 raise ConanException("ConfigParser: Unrecognized field '%s'" % name)
  41
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/conans/util/config_parser.py b/conans/util/config_parser.py
  --- a/conans/util/config_parser.py
  +++ b/conans/util/config_parser.py
  @@ -12,19 +12,26 @@
           self._sections = {}
           self._allowed_fields = allowed_fields or []
           pattern = re.compile("^\[([a-z_]{2,50})\]")
  -        current_lines = []
  +        current_lines = None
           for line in text.splitlines():
               line = line.strip()
               if not line or line[0] == '#':
                   continue
  -            m = pattern.match(line)
  -            if m:
  -                group = m.group(1)
  -                if self._allowed_fields and group not in self._allowed_fields:
  -                    raise ConanException("ConfigParser: Unrecognized field '%s'" % group)
  +            field = None
  +            if line[0] == '[':
  +                m = pattern.match(line)
  +                if m:
  +                    field = m.group(1)
  +                else:
  +                    raise ConanException("ConfigParser: Bad syntax '%s'" % line)
  +            if field:
  +                if self._allowed_fields and field not in self._allowed_fields:
  +                    raise ConanException("ConfigParser: Unrecognized field '%s'" % field)
                   current_lines = []
  -                self._sections[group] = current_lines
  +                self._sections[field] = current_lines
               else:
  +                if current_lines is None:
  +                    raise ConanException("ConfigParser: Unexpected line '%s'" % line)
                   if parse_lines:
                       line = line.split('#')[0]
                       line = line.strip()
  
verification_info: {"golden_diff": "diff --git a/conans/util/config_parser.py b/conans/util/config_parser.py\n--- a/conans/util/config_parser.py\n+++ b/conans/util/config_parser.py\n@@ -12,19 +12,26 @@\n         self._sections = {}\n         self._allowed_fields = allowed_fields or []\n         pattern = re.compile(\"^\\[([a-z_]{2,50})\\]\")\n-        current_lines = []\n+        current_lines = None\n         for line in text.splitlines():\n             line = line.strip()\n             if not line or line[0] == '#':\n                 continue\n-            m = pattern.match(line)\n-            if m:\n-                group = m.group(1)\n-                if self._allowed_fields and group not in self._allowed_fields:\n-                    raise ConanException(\"ConfigParser: Unrecognized field '%s'\" % group)\n+            field = None\n+            if line[0] == '[':\n+                m = pattern.match(line)\n+                if m:\n+                    field = m.group(1)\n+                else:\n+                    raise ConanException(\"ConfigParser: Bad syntax '%s'\" % line)\n+            if field:\n+                if self._allowed_fields and field not in self._allowed_fields:\n+                    raise ConanException(\"ConfigParser: Unrecognized field '%s'\" % field)\n                 current_lines = []\n-                self._sections[group] = current_lines\n+                self._sections[field] = current_lines\n             else:\n+                if current_lines is None:\n+                    raise ConanException(\"ConfigParser: Unexpected line '%s'\" % line)\n                 if parse_lines:\n                     line = line.split('#')[0]\n                     line = line.strip()\n", "issue": "[requires} in conanfile.txt gives no error\nThe typo:\n\n```\n[requires}\n...\n```\n\nin `conanfile.txt` does not give any error indication at all when running `conan install ...`. The way to see that something is wrong is that it doesn't do anything, but finding the cause was not as easy as it could've been.\n\nThis is on 0.9.2 on Ubuntu 15.10.\n\n", "before_files": [{"content": "import re\nfrom conans.errors import ConanException\n\n\nclass ConfigParser(object):\n    \"\"\" util class to load a file with sections as [section1]\n    checking the values of those sections, and returns each section\n    as parser.section\n    Currently used in ConanInfo and ConanFileTextLoader\n    \"\"\"\n    def __init__(self, text, allowed_fields=None, parse_lines=False):\n        self._sections = {}\n        self._allowed_fields = allowed_fields or []\n        pattern = re.compile(\"^\\[([a-z_]{2,50})\\]\")\n        current_lines = []\n        for line in text.splitlines():\n            line = line.strip()\n            if not line or line[0] == '#':\n                continue\n            m = pattern.match(line)\n            if m:\n                group = m.group(1)\n                if self._allowed_fields and group not in self._allowed_fields:\n                    raise ConanException(\"ConfigParser: Unrecognized field '%s'\" % group)\n                current_lines = []\n                self._sections[group] = current_lines\n            else:\n                if parse_lines:\n                    line = line.split('#')[0]\n                    line = line.strip()\n                current_lines.append(line)\n\n    def __getattr__(self, name):\n        if name in self._sections:\n            return \"\\n\".join(self._sections[name])\n        else:\n            if self._allowed_fields and name in self._allowed_fields:\n                return \"\"\n            else:\n                raise ConanException(\"ConfigParser: Unrecognized field '%s'\" % name)\n", "path": "conans/util/config_parser.py"}], "after_files": [{"content": "import re\nfrom conans.errors import ConanException\n\n\nclass ConfigParser(object):\n    \"\"\" util class to load a file with sections as [section1]\n    checking the values of those sections, and returns each section\n    as parser.section\n    Currently used in ConanInfo and ConanFileTextLoader\n    \"\"\"\n    def __init__(self, text, allowed_fields=None, parse_lines=False):\n        self._sections = {}\n        self._allowed_fields = allowed_fields or []\n        pattern = re.compile(\"^\\[([a-z_]{2,50})\\]\")\n        current_lines = None\n        for line in text.splitlines():\n            line = line.strip()\n            if not line or line[0] == '#':\n                continue\n            field = None\n            if line[0] == '[':\n                m = pattern.match(line)\n                if m:\n                    field = m.group(1)\n                else:\n                    raise ConanException(\"ConfigParser: Bad syntax '%s'\" % line)\n            if field:\n                if self._allowed_fields and field not in self._allowed_fields:\n                    raise ConanException(\"ConfigParser: Unrecognized field '%s'\" % field)\n                current_lines = []\n                self._sections[field] = current_lines\n            else:\n                if current_lines is None:\n                    raise ConanException(\"ConfigParser: Unexpected line '%s'\" % line)\n                if parse_lines:\n                    line = line.split('#')[0]\n                    line = line.strip()\n                current_lines.append(line)\n\n    def __getattr__(self, name):\n        if name in self._sections:\n            return \"\\n\".join(self._sections[name])\n        else:\n            if self._allowed_fields and name in self._allowed_fields:\n                return \"\"\n            else:\n                raise ConanException(\"ConfigParser: Unrecognized field '%s'\" % name)\n", "path": "conans/util/config_parser.py"}]}