hi i am trying to get the extension of the file called in a url (eg"/wp-includes/js/jquery/jquery.js?ver=1.3.2 HTTP/1.1") and get the query perimeters passed to the file too what would be the best way to the extension?
You should probably just rsplit on `.` rather than use `os.path` in this case, as a URL and a filepath are different things. Using `os.path.splitext` would go wrong on an operating system where the file extension separator isn't `.`. Admittedly there are vanishingly few of those today.
bobince
2010-02-16 23:09:28
wouldn't rsplit mathc the ver=1.3.2 path too ?
nashr rafeeg
2010-02-16 23:12:46
You would use it on the results of `urlparse()`.
Ignacio Vazquez-Abrams
2010-02-16 23:14:30
As a rule URL path manipulations should probably be done with posixpath.
Devin Jeanpierre
2010-02-16 23:33:21