Hiya, Just a quick note to say that due to the _python_rewrite_shebang in python-utils-r1.eclass, lines such as "#!/usr/bin/env python" from linux-newline-formatted files give rise to: * A file does not seem to have a supported shebang: ... * shebang: #!/usr/bin/env python Investigating this further, it's seems to be down to the following line: local shebang=$(head -n 1 "${f}") On the file I'm testing, the first line finishes with \r\n, so the shebang returned is actually "#!/usr/bin/env python\r". When the space is added the check tries to match "...python\r " against *"python "*, which then fails. The version of head I'm using comes from sys-apps/coreutils-8.21. I haven't checked whether older versions of coreutils suffer the same problem. As it turns out, the program I'm trying to convert uses it's own bash scripts to launch python with the target file, so I'm going to make the change there rather than the shebangs. It's therefore not something I'm intending to mess around with further, but if you'd like help testing fixes just let me know... 5:)
Erm, I don't think that you are supposed to install a file with CRLF line endings. I may be wrong but I think you need to 'fix' it to plain LFs first...
That would mean that every python project written in windows would require a dependency on dos2unix and extra code in the ebuild because our single bit of shebang changing code can't deal with it? That cannot be the right way to fix this...
+ 14 Apr 2013; Mike Gilbert <floppym@gentoo.org> python-utils-r1.eclass: + Remove carriage-return from shebang before validating it, bug 465790 by + ikelos.
I also took a look at the python_fix_shebangs function in python-single-r1.eclass; the pattern checking there should be unaffected by the line ending.
That still leaves the question whether we actually want CRLF files installed on Linux. They cause trouble with some simple editors, at least.