Skip to content

Conversation

@nsiregar
Copy link
Contributor

@nsiregarnsiregar commented Jul 18, 2019

Add device path support in ntpath.splitdrive

https://bugs.python.org/issue37609

@nsiregarnsiregarforce-pushed the bpo-37609-support-unc-device-path-ntpath-splitdrive branch from f69464e to 589e045CompareJuly 19, 2019 17:28
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the mod role here is not correct. Please see https://devguide.python.org/documenting/#id4.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, I've updated it to use meth.

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be func.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, I've updated it

@nsiregarnsiregarforce-pushed the bpo-37609-support-unc-device-path-ntpath-splitdrive branch from e92813b to eb4e996CompareAugust 24, 2019 09:26
@zooba
Copy link
Member

Sorry for not seeing this earlier, I have a few general suggestions:

  • put a leading underscore on the new functions (or else add full documentation for them)
  • use constant strings in the comparisons, rather than sep*2
  • add some tests using backslashes as well, not just forward slashes

returnp[:0], p


defis_unc_path(path, sep):
Copy link
Contributor

Choose a reason for hiding this comment

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

These functions are clearly private (e.g. parameterized by sep and colon), so the function names should have a leading underscore.

@nsiregar
Copy link
ContributorAuthor

working on it

@eryksun
Copy link
Contributor

eryksun commented Sep 14, 2019

For an alternate and more complete implementation, see the splitdrive.py file that I attached to bpo-37609.

@barneygale
Copy link
Contributor

I managed to fix the issue elsewhere (in #91882), so I'm going to close this PR, but thank you very much for taking a look at it! :)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@nsiregar@zooba@eryksun@barneygale@ZackerySpytz@ambv@the-knights-who-say-ni@ezio-melotti@bedevere-bot