Skip to content

Restore newlines to easy-install.pth files.#3583

Merged
tgamblin merged 1 commit intodevelopfrom
bugfix/really-fix-easy-install-pth-syntax
Mar 28, 2017
Merged

Restore newlines to easy-install.pth files.#3583
tgamblin merged 1 commit intodevelopfrom
bugfix/really-fix-easy-install-pth-syntax

Conversation

@tgamblin
Copy link
Copy Markdown
Member

@tgamblin tgamblin commented Mar 28, 2017

Fixes #3575.

Previous syntax fix in 8a873bb was not quite right -- it didn't have newlines.

@lee218llnl @adamjstewart

@lee218llnl
Copy link
Copy Markdown
Contributor

@tgamblin yeah, please see #3575 and #3582

@lee218llnl
Copy link
Copy Markdown
Contributor

Although #3582 does not have a newline after the header. I don't think that one is needed.

@adamjstewart
Copy link
Copy Markdown
Member

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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think being anal about this is useful -- lemme check what happens by default.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@tgamblin tgamblin force-pushed the bugfix/really-fix-easy-install-pth-syntax branch from ec0e1b4 to c355120 Compare March 28, 2017 15:41
Copy link
Copy Markdown
Contributor

@lee218llnl lee218llnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like an extra blank line was added here too

@tgamblin tgamblin merged commit dead67a into develop Mar 28, 2017
@tgamblin tgamblin deleted the bugfix/really-fix-easy-install-pth-syntax branch March 28, 2017 16:34
@tgamblin tgamblin mentioned this pull request Mar 28, 2017
diaena pushed a commit to diaena/spack that referenced this pull request May 26, 2017
Previous syntax fix in 8a873bb was not quite right.
xavierandrade pushed a commit to xavierandrade/spack that referenced this pull request Jun 16, 2017
Previous syntax fix in 8a873bb was not quite right.
EmreAtes pushed a commit to EmreAtes/spack that referenced this pull request Jul 10, 2017
Previous syntax fix in 8a873bb was not quite right.
amklinv pushed a commit that referenced this pull request Jul 17, 2017
Previous syntax fix in 8a873bb was not quite right.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Odd error w/ setuptools

3 participants