prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  TSV file with column name "length" causes TypeError
  **Small description**
  Files in TSV format containing a column named `length` cannot be loaded.
  
  **Expected result**
  See content of TSV file.
  
  **Actual result with screenshot**
  An empty file is shown. In the footer line it says:
  ```
  TypeError: 'property' object is not callable
  ```
  
  **Steps to reproduce with sample data and a .vd**
  Create a file named `test.tsv` with this content:
  ```
  length
  1
  ```
  Then, try to open it:
  ```
  vd test.tsv
  ```
  
  **Additional context**
  version 1.5.2
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `visidata/utils.py`
  Content:
  ```
  1 import operator
  2 
  3 'Various helper classes and functions.'
  4 
  5 __all__ = ['AttrDict', 'joinSheetnames', 'moveListItem', 'namedlist', 'classproperty']
  6 
  7 
  8 class AttrDict(dict):
  9     'Augment a dict with more convenient .attr syntax.  not-present keys return None.'
  10     def __getattr__(self, k):
  11         try:
  12             return self[k]
  13         except KeyError:
  14             return None
  15 
  16     def __setattr__(self, k, v):
  17         self[k] = v
  18 
  19     def __dir__(self):
  20         return self.keys()
  21 
  22 
  23 class classproperty(property):
  24     def __get__(self, cls, obj):
  25         return classmethod(self.fget).__get__(None, obj or cls)()
  26 
  27 
  28 def joinSheetnames(*sheetnames):
  29     'Concatenate sheet names in a standard way'
  30     return '_'.join(str(x) for x in sheetnames)
  31 
  32 
  33 def moveListItem(L, fromidx, toidx):
  34     "Move element within list `L` and return element's new index."
  35     toidx = min(max(toidx, 0), len(L)-1)
  36     fromidx = min(max(fromidx, 0), len(L)-1)
  37     r = L.pop(fromidx)
  38     L.insert(toidx, r)
  39     return toidx
  40 
  41 
  42 class OnExit:
  43     '"with OnExit(func, ...):" calls func(...) when the context is exited'
  44     def __init__(self, func, *args, **kwargs):
  45         self.func = func
  46         self.args = args
  47         self.kwargs = kwargs
  48 
  49     def __enter__(self):
  50         return self
  51 
  52     def __exit__(self, exc_type, exc_value, exc_traceback):
  53         try:
  54             self.func(*self.args, **self.kwargs)
  55         except Exception as e:
  56             vd.exceptionCaught(e)
  57 
  58 
  59 def itemsetter(i):
  60     def g(obj, v):
  61         obj[i] = v
  62     return g
  63 
  64 
  65 def namedlist(objname, fieldnames):
  66     'like namedtuple but editable'
  67     class NamedListTemplate(list):
  68         __name__ = objname
  69         _fields = fieldnames
  70 
  71         def __init__(self, L=None, **kwargs):
  72             if L is None:
  73                 L = [None]*self.length()
  74             elif len(L) < self.length():
  75                 L.extend([None]*(self.length() - len(L)))
  76             super().__init__(L)
  77             for k, v in kwargs.items():
  78                 setattr(self, k, v)
  79 
  80         @classmethod
  81         def length(cls):
  82             return len(cls._fields)
  83 
  84         def __getattr__(self, k):
  85             'to enable .fieldname'
  86             try:
  87                 return self[self._fields.index(k)]
  88             except ValueError:
  89                 raise AttributeError
  90 
  91         def __setattr__(self, k, v):
  92             'to enable .fieldname ='
  93             try:
  94                 self[self._fields.index(k)] = v
  95             except ValueError:
  96                 super().__setattr__(k, v)
  97 
  98     for i, attrname in enumerate(fieldnames):
  99         # create property getter/setter for each field
  100         setattr(NamedListTemplate, attrname, property(operator.itemgetter(i), itemsetter(i)))
  101 
  102     return NamedListTemplate
  103
  ```
  --- 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/visidata/utils.py b/visidata/utils.py
  --- a/visidata/utils.py
  +++ b/visidata/utils.py
  @@ -70,17 +70,13 @@
   
           def __init__(self, L=None, **kwargs):
               if L is None:
  -                L = [None]*self.length()
  -            elif len(L) < self.length():
  -                L.extend([None]*(self.length() - len(L)))
  +                L = [None]*len(self._fields)
  +            elif len(L) < len(self._fields):
  +                L.extend([None]*(len(self._fields) - len(L)))
               super().__init__(L)
               for k, v in kwargs.items():
                   setattr(self, k, v)
   
  -        @classmethod
  -        def length(cls):
  -            return len(cls._fields)
  -
           def __getattr__(self, k):
               'to enable .fieldname'
               try:
  @@ -95,8 +91,4 @@
               except ValueError:
                   super().__setattr__(k, v)
   
  -    for i, attrname in enumerate(fieldnames):
  -        # create property getter/setter for each field
  -        setattr(NamedListTemplate, attrname, property(operator.itemgetter(i), itemsetter(i)))
  -
       return NamedListTemplate
  
verification_info: {"golden_diff": "diff --git a/visidata/utils.py b/visidata/utils.py\n--- a/visidata/utils.py\n+++ b/visidata/utils.py\n@@ -70,17 +70,13 @@\n \n         def __init__(self, L=None, **kwargs):\n             if L is None:\n-                L = [None]*self.length()\n-            elif len(L) < self.length():\n-                L.extend([None]*(self.length() - len(L)))\n+                L = [None]*len(self._fields)\n+            elif len(L) < len(self._fields):\n+                L.extend([None]*(len(self._fields) - len(L)))\n             super().__init__(L)\n             for k, v in kwargs.items():\n                 setattr(self, k, v)\n \n-        @classmethod\n-        def length(cls):\n-            return len(cls._fields)\n-\n         def __getattr__(self, k):\n             'to enable .fieldname'\n             try:\n@@ -95,8 +91,4 @@\n             except ValueError:\n                 super().__setattr__(k, v)\n \n-    for i, attrname in enumerate(fieldnames):\n-        # create property getter/setter for each field\n-        setattr(NamedListTemplate, attrname, property(operator.itemgetter(i), itemsetter(i)))\n-\n     return NamedListTemplate\n", "issue": "TSV file with column name \"length\" causes TypeError\n**Small description**\r\nFiles in TSV format containing a column named `length` cannot be loaded.\r\n\r\n**Expected result**\r\nSee content of TSV file.\r\n\r\n**Actual result with screenshot**\r\nAn empty file is shown. In the footer line it says:\r\n```\r\nTypeError: 'property' object is not callable\r\n```\r\n\r\n**Steps to reproduce with sample data and a .vd**\r\nCreate a file named `test.tsv` with this content:\r\n```\r\nlength\r\n1\r\n```\r\nThen, try to open it:\r\n```\r\nvd test.tsv\r\n```\r\n\r\n**Additional context**\r\nversion 1.5.2\r\n\n", "before_files": [{"content": "import operator\n\n'Various helper classes and functions.'\n\n__all__ = ['AttrDict', 'joinSheetnames', 'moveListItem', 'namedlist', 'classproperty']\n\n\nclass AttrDict(dict):\n    'Augment a dict with more convenient .attr syntax.  not-present keys return None.'\n    def __getattr__(self, k):\n        try:\n            return self[k]\n        except KeyError:\n            return None\n\n    def __setattr__(self, k, v):\n        self[k] = v\n\n    def __dir__(self):\n        return self.keys()\n\n\nclass classproperty(property):\n    def __get__(self, cls, obj):\n        return classmethod(self.fget).__get__(None, obj or cls)()\n\n\ndef joinSheetnames(*sheetnames):\n    'Concatenate sheet names in a standard way'\n    return '_'.join(str(x) for x in sheetnames)\n\n\ndef moveListItem(L, fromidx, toidx):\n    \"Move element within list `L` and return element's new index.\"\n    toidx = min(max(toidx, 0), len(L)-1)\n    fromidx = min(max(fromidx, 0), len(L)-1)\n    r = L.pop(fromidx)\n    L.insert(toidx, r)\n    return toidx\n\n\nclass OnExit:\n    '\"with OnExit(func, ...):\" calls func(...) when the context is exited'\n    def __init__(self, func, *args, **kwargs):\n        self.func = func\n        self.args = args\n        self.kwargs = kwargs\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc_value, exc_traceback):\n        try:\n            self.func(*self.args, **self.kwargs)\n        except Exception as e:\n            vd.exceptionCaught(e)\n\n\ndef itemsetter(i):\n    def g(obj, v):\n        obj[i] = v\n    return g\n\n\ndef namedlist(objname, fieldnames):\n    'like namedtuple but editable'\n    class NamedListTemplate(list):\n        __name__ = objname\n        _fields = fieldnames\n\n        def __init__(self, L=None, **kwargs):\n            if L is None:\n                L = [None]*self.length()\n            elif len(L) < self.length():\n                L.extend([None]*(self.length() - len(L)))\n            super().__init__(L)\n            for k, v in kwargs.items():\n                setattr(self, k, v)\n\n        @classmethod\n        def length(cls):\n            return len(cls._fields)\n\n        def __getattr__(self, k):\n            'to enable .fieldname'\n            try:\n                return self[self._fields.index(k)]\n            except ValueError:\n                raise AttributeError\n\n        def __setattr__(self, k, v):\n            'to enable .fieldname ='\n            try:\n                self[self._fields.index(k)] = v\n            except ValueError:\n                super().__setattr__(k, v)\n\n    for i, attrname in enumerate(fieldnames):\n        # create property getter/setter for each field\n        setattr(NamedListTemplate, attrname, property(operator.itemgetter(i), itemsetter(i)))\n\n    return NamedListTemplate\n", "path": "visidata/utils.py"}], "after_files": [{"content": "import operator\n\n'Various helper classes and functions.'\n\n__all__ = ['AttrDict', 'joinSheetnames', 'moveListItem', 'namedlist', 'classproperty']\n\n\nclass AttrDict(dict):\n    'Augment a dict with more convenient .attr syntax.  not-present keys return None.'\n    def __getattr__(self, k):\n        try:\n            return self[k]\n        except KeyError:\n            return None\n\n    def __setattr__(self, k, v):\n        self[k] = v\n\n    def __dir__(self):\n        return self.keys()\n\n\nclass classproperty(property):\n    def __get__(self, cls, obj):\n        return classmethod(self.fget).__get__(None, obj or cls)()\n\n\ndef joinSheetnames(*sheetnames):\n    'Concatenate sheet names in a standard way'\n    return '_'.join(str(x) for x in sheetnames)\n\n\ndef moveListItem(L, fromidx, toidx):\n    \"Move element within list `L` and return element's new index.\"\n    toidx = min(max(toidx, 0), len(L)-1)\n    fromidx = min(max(fromidx, 0), len(L)-1)\n    r = L.pop(fromidx)\n    L.insert(toidx, r)\n    return toidx\n\n\nclass OnExit:\n    '\"with OnExit(func, ...):\" calls func(...) when the context is exited'\n    def __init__(self, func, *args, **kwargs):\n        self.func = func\n        self.args = args\n        self.kwargs = kwargs\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc_value, exc_traceback):\n        try:\n            self.func(*self.args, **self.kwargs)\n        except Exception as e:\n            vd.exceptionCaught(e)\n\n\ndef itemsetter(i):\n    def g(obj, v):\n        obj[i] = v\n    return g\n\n\ndef namedlist(objname, fieldnames):\n    'like namedtuple but editable'\n    class NamedListTemplate(list):\n        __name__ = objname\n        _fields = fieldnames\n\n        def __init__(self, L=None, **kwargs):\n            if L is None:\n                L = [None]*len(self._fields)\n            elif len(L) < len(self._fields):\n                L.extend([None]*(len(self._fields) - len(L)))\n            super().__init__(L)\n            for k, v in kwargs.items():\n                setattr(self, k, v)\n\n        def __getattr__(self, k):\n            'to enable .fieldname'\n            try:\n                return self[self._fields.index(k)]\n            except ValueError:\n                raise AttributeError\n\n        def __setattr__(self, k, v):\n            'to enable .fieldname ='\n            try:\n                self[self._fields.index(k)] = v\n            except ValueError:\n                super().__setattr__(k, v)\n\n    return NamedListTemplate\n", "path": "visidata/utils.py"}]}