python / cpython

The Python programming language
https://www.python.org
Other
62.42k stars 29.97k forks source link

Problem with urlparse in Windows XP after a drag and drop #52213

Closed 2bd7a277-a2d0-4e8e-b456-487d647f50b4 closed 14 years ago

2bd7a277-a2d0-4e8e-b456-487d647f50b4 commented 14 years ago
BPO 7965
Nosy @orsenthil

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = 'https://github.com/orsenthil' closed_at = created_at = labels = ['invalid', 'type-bug', 'library'] title = 'Problem with urlparse in Windows XP after a drag and drop' updated_at = user = 'https://bugs.python.org/PeterL' ``` bugs.python.org fields: ```python activity = actor = 'Christopher.Bare' assignee = 'orsenthil' closed = True closed_date = closer = 'orsenthil' components = ['Library (Lib)'] creation = creator = 'PeterL' dependencies = [] files = [] hgrepos = [] issue_num = 7965 keywords = [] message_count = 3.0 messages = ['99571', '110322', '189259'] nosy_count = 3.0 nosy_names = ['orsenthil', 'PeterL', 'Christopher.Bare'] pr_nums = [] priority = 'normal' resolution = 'not a bug' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue7965' versions = ['Python 3.1', 'Python 2.7', 'Python 3.2'] ```

2bd7a277-a2d0-4e8e-b456-487d647f50b4 commented 14 years ago

When I drag and drop a "file/url" from the file explorer in Windows to my application, I don't get a usable fil name: In the application I get from Windows file:///C:/Documents%20and%20Settings/Peter/Mina%20dokument/Mina%20bilder/BlueHole/IMG_1665.JPG

After call to urlparser.urlparser() with this string as parameter I get back: /C:/Documents%20and%20Settings/Peter/Mina%20dokument/Mina%20bilder/BlueHole/IMG_1665.JPG Which is not a valid path in Windows However, It's easy to fix in my application.

So, is this behavior known and are there any plans to change this?

orsenthil commented 14 years ago

The resultant url you get after doing a urlparse is not a Windows PATH, but url path component. So, when you use in relative manner by doing urljoin, you will see that the original will get constructed properly.

So, there is really no a problem here.

dadbf21f-15e1-4247-8ddc-ac458ff9661d commented 11 years ago

I see Senthil's point, but this tripped me up.