Re: Incompatibility bug for 1.1

will guaraldi <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
On Wed, 30 Mar 2005, Matej Cepl wrote:
>
> while trying to make weblogsping plugin working I found out that there 
> is IMHO a bug in Pyblosxom 1.1 Pyblosxom/entries/fileentry.py.
>
> --- fileentry.py 2005/03/30 23:43:56 1.1
> +++ fileentry.py 2005/03/30 23:43:16
> @@ -103,7 +103,8 @@
>         if absolute_path == '':
>             file_path = fn
>         else:
> -            file_path = '/'.join((absolute_path.rstrip('/'), fn))
> +            file_path = os.path.join(absolute_path,fn)
>
>         tb_id = '%s/%s' % (absolute_path, fn)
>         tb_id = re.sub(r'[^A-Za-z0-9]', '_', tb_id)
>
> rstrip function in 2.1.3 doesn't support having _any_ parameters. Moreover,
> this complicated construct is totally useless, because we have (since
> forever) os.path.join function which does exactly the same in compatible
> and stable manner.

Well, no.  os.path.join will use the os.sep.  In this case, I don't think 
we don't want to use os.sep.  Instead we want to use the separator used 
for URIs which is / .

I'm puzzled about rstrip, though.

/will


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.