This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Valentin.Lorentz, brett.cannon, nedbat, rhettinger, serhiy.storchaka, vstinner
Date 2022-02-16.07:38:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644997109.87.0.282202764319.issue30267@roundup.psfhosted.org>
In-reply-to
Content
For now, there are three uses of commonprefix() in the stdlib:

1. In urllib.request it causes a security issue (see issue46756). commonpath() or just str.startswith() should be used instead.

2. In lib2to3.main. The code contains a workaround around commonprefix(). It could be simplified by using commonpath().

3. In unittest.util. This is the only correct use of commonprefix(). It cannot be replaced by commonpath().

I think that we should add commonprefix() in the string module (or maybe in a new module for operations on sequences), deprecate os.path.commonprefix() in documentation only, several versions later add a deprecation warning in os.path.commonprefix(), and several versions later remove os.path.commonprefix().
History
Date User Action Args
2022-02-16 07:38:29serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, rhettinger, vstinner, nedbat, Valentin.Lorentz
2022-02-16 07:38:29serhiy.storchakasetmessageid: <1644997109.87.0.282202764319.issue30267@roundup.psfhosted.org>
2022-02-16 07:38:29serhiy.storchakalinkissue30267 messages
2022-02-16 07:38:29serhiy.storchakacreate