Skip to content
This repository

Read first line from file as link path #244

merged 1 commit into from over 2 years ago

2 participants

Kyle Gibson Carl Meyer
Kyle Gibson

In some cases, (e.g. cherrypy and pyaml) when installed from github, results in a egg-link file that has two paths:


The consequence of such an egg-link is that virtualenv believes that the file is already relative, even if it clearly isn't.

Although asking why the above malformed egg-link occurs is something I am still investigating, I think it should be considered whether using readline is better than read, given that file paths can't contain new lines anyway.

Carl Meyer carljm merged commit 9fb48ac into from
Carl Meyer carljm closed this
Carl Meyer


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 25, 2012
Kyle Gibson kylegibson Read first line from file as link path 017ee49
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1 
2 
@@ -1667,7 +1667,7 @@ def fixup_pth_file(filename):
1667 1667
1668 1668 def fixup_egg_link(filename):
1669 1669 f = open(filename)
1670   - link =
  1670 + link = f.readline().strip()
1671 1671 f.close()
1672 1672 if os.path.abspath(link) != link:
1673 1673 logger.debug('Link in %s already relative' % filename)

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.