Restore newlines to easy-install.pth files.#3583
Conversation
|
Although #3582 does not have a newline after the header. I don't think that one is needed. |
|
I think I like this one better. It adds a newline to both lines and isn't a super long line. |
| "del sys.path[sys.__plen:]; " | ||
| "p=getattr(sys,'__egginsert',0); " | ||
| "sys.path[p:p]=new; " | ||
| "sys.__egginsert = p+len(new)\n") |
There was a problem hiding this comment.
perhaps it is petty, but I believe a typical easy-install.pth does not have the newline after the footer. Since empty lines are ignored in .pth files, it should be OK, though. I do like the breaking of the long line.
There was a problem hiding this comment.
I think being anal about this is useful -- lemme check what happens by default.
There was a problem hiding this comment.
It might not be a new line, just an EOL character before the EOF character. Back in the day, I wrote a Python script that output an input file for a Fortran program. The Fortran program couldn't read the file because I had forgotten to add \n to the end of the file and it had hit an EOF character before the EOL character.
There was a problem hiding this comment.
I did a manual install of pyflakes in my own python installation, and it looks like setuptools does put a newline at the end of the file. Also, my original implementation of this had the newline and it worked -- so I'm inclined to keep the newline.
There was a problem hiding this comment.
Caveat: the easy-install.pth file my install generated didn't have the final egginsert line. So it may be as @lee218llnl says that that line doesn't have a newline. Still, though, it works when I try it.
Previous syntax fix in 8a873bb was not quite right.
ec0e1b4 to
c355120
Compare
lee218llnl
left a comment
There was a problem hiding this comment.
OK, I don't see any harm in the newline, so I'll allow it.
| "p=getattr(sys,'__egginsert',0); " | ||
| "sys.path[p:p]=new; " | ||
| "sys.__egginsert = p+len(new)\n") | ||
|
|
There was a problem hiding this comment.
looks like an extra blank line was added here too
Previous syntax fix in 8a873bb was not quite right.
Previous syntax fix in 8a873bb was not quite right.
Previous syntax fix in 8a873bb was not quite right.
Previous syntax fix in 8a873bb was not quite right.
Fixes #3575.
Previous syntax fix in 8a873bb was not quite right -- it didn't have newlines.
@lee218llnl @adamjstewart