Skip to content

Conversation

idomic
Copy link
Contributor

@idomic idomic commented Jun 6, 2020

Copy link
Contributor

@taleinat taleinat left a comment

Choose a reason for hiding this comment

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

Looking good, a few minor notes.

Comment on lines 594 to 602
@classmethod
def _calc_sys_path_for_underpth_nosite(self, sys_prefix, lines):
sys_path = []
for line in lines:
if not line or line[0] == '#':
continue
abs_path = os.path.abspath(os.path.join(sys_prefix, line))
sys_path.append(abs_path)
return sys_path
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right removed it.
I couldn't find where to put the last parts of it: https://bugs.python.org/file46433/underpth_blank_lines.diff

@@ -0,0 +1,2 @@
Added support for empty .pth lines in the :mod:`site.py`
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is a bugfix rather than a new feature, I'd re-word this as something like "ignore empty or whitespace-only lines".

Copy link
Contributor

Choose a reason for hiding this comment

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

Also mention that this is what the documentation already says.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed to:
Ignore empty or whitespace-only lines according to the existing documentation.

# Issue 33689
pth_dir, pth_fn = self.make_pth("\n\n \n\n")
known_paths = site.addpackage(pth_dir, pth_fn, set())
self.assertEqual(len(known_paths), 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.assertEqual(len(known_paths), 0)
self.assertEqual(known_paths, set())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@idomic
Copy link
Contributor Author

idomic commented Jun 20, 2020

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@taleinat: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from taleinat June 20, 2020 21:28
@idomic
Copy link
Contributor Author

idomic commented Jun 27, 2020

@taleinat ping

Copy link
Contributor

@taleinat taleinat left a comment

Choose a reason for hiding this comment

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

LGTM

@taleinat taleinat added the type-bug An unexpected behavior, bug, or error label Sep 19, 2020
@taleinat
Copy link
Contributor

This is certainly a bug fix, but since it may break backwards-compatibility in delicate ways, I'm not going to backport it to earlier versions. Expect this to land in 3.10.

@taleinat taleinat merged commit 0c71a66 into python:master Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants