1 |
Dnia 2014-05-20, o godz. 14:27:04 |
2 |
Mike Gilbert <floppym@g.o> napisał(a): |
3 |
|
4 |
> On Tue, May 20, 2014 at 2:19 PM, Michał Górny <mgorny@g.o> wrote: |
5 |
> > It serves both as public shebang fixing function and replacement of |
6 |
> > _python_rewrite_shebang internal function. For the sake of having common |
7 |
> > code and consistent behavior. |
8 |
> > |
9 |
> > Notes on the 'new' function: |
10 |
> > |
11 |
> > 1. takes a list of files and/or directories to fix. Directories are |
12 |
> > processed recursively, |
13 |
> > |
14 |
> > 2. files, depending on the shebang: |
15 |
> > |
16 |
> > a) with shebang matching $EPYTHON (e.g. already having pythonX.Y) are |
17 |
> > skipped silently (but see 3), |
18 |
> > |
19 |
> > b) with shebang 'compatible' with $EPYTHON (e.g. python3 -> python3.2, |
20 |
> > but not python2 -> python3.2) are mangled verbosely, |
21 |
> > |
22 |
> > c) with shebang 'incompatible' with $EPYTHON (e.g. python3 -> python2.7, |
23 |
> > python3.2 -> python3.3) raise a fatal error, |
24 |
> > |
25 |
> |
26 |
> This fatal behavior is a little annoying. I seem to recall people |
27 |
> asking if there is a way to just force it, no matter if the shebang is |
28 |
> 'compatible' or not. |
29 |
|
30 |
I literally spent weeks cleaning up this function and you already |
31 |
request new features :P. |
32 |
|
33 |
> Unfortunately, I do not have example handy, but I know I have been |
34 |
> asked the question. |
35 |
|
36 |
Well, I think it was about some random package having files with |
37 |
'python3' shebang while they worked with python2.7 as well. I guess we |
38 |
may add some -f/--force option at a point. While at it, it would |
39 |
probably be good if we could work on some consistency in argument |
40 |
parsing of various helper functions. |
41 |
|
42 |
-- |
43 |
Best regards, |
44 |
Michał Górny |