• Kirill Smelkov's avatar
    setup: Fix egg_info after addition of δbtail.go · d07824dc
    Kirill Smelkov authored
    `python setup.py egg_info` stopped working after we added non-ASCII
    files, e.g. δbtail.go in 2ab4be93 (wcfs: xbtree: ΔBtail) and δftail.go
    in f980471f (wcfs: zdata: ΔFtail):
    
        (neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/lab.nexedi.com/nexedi/wendelin.core$ python setup.py egg_info
        running egg_info
        writing requirements to wendelin.core.egg-info/requires.txt
        writing wendelin.core.egg-info/PKG-INFO
        writing top-level names to wendelin.core.egg-info/top_level.txt
        writing dependency_links to wendelin.core.egg-info/dependency_links.txt
        writing entry points to wendelin.core.egg-info/entry_points.txt
        package init file '__init__.py' not found (or not a regular file)
        /usr/lib/python2.7/distutils/filelist.py:64: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
          sortable_files.sort()
        Traceback (most recent call last):
          File "setup.py", line 416, in <module>
            """.splitlines()]
          File "/home/kirr/src/tools/go/pygolang/golang/pyx/build.py", line 118, in setup
            setuptools_dso.setup(**kw)
          File "/home/kirr/src/wendelin/venv/z-dev/lib/python2.7/site-packages/setuptools_dso/__init__.py", line 37, in setup
            _setup(**kws)
          File "/home/kirr/src/wendelin/venv/z-dev/lib/python2.7/site-packages/setuptools/__init__.py", line 162, in setup
            return distutils.core.setup(**attrs)
          File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
            dist.run_commands()
          File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
            self.run_command(cmd)
          File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
            cmd_obj.run()
          File "/home/kirr/src/wendelin/venv/z-dev/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
            self.find_sources()
          File "/home/kirr/src/wendelin/venv/z-dev/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
            mm.run()
          File "/home/kirr/src/wendelin/venv/z-dev/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 538, in run
            self.filelist.sort()
          File "/usr/lib/python2.7/distutils/filelist.py", line 64, in sort
            sortable_files.sort()
        UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 0: ordinal not in range(128)
    
    This happens becuase by default setuptools collects filenames as str, not
    unicode, and our git_lsfiles - also registered into setuptools.file_finders
    entrypoint - collects filenames as unicode. Previously everything was working
    because there was no on-ASCII filenames, and so unicode vs str coercion worked
    automatically. But now, after there is filename like 'δbtail.go', it stopped to
    work and raises UnicodeDecodeError.
    
    -> Fix it by adjusting git_lsfiles to collect filenames as UTF-8 encoded
    strings instead of unicode.
    d07824dc
setup.py 15.4 KB