Like this:
os.path.basename(url.replace('/', os.sep).replace('\\', os.sep))


On Aug 25, 5:56 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> So how should one remove the path without knowing whether is a Linux
> or a Windows path?
>
> Massimo
>
> On Aug 25, 12:39 am, Richard <richar...@gmail.com> wrote:
>
> > if there is a Windows path passed to my Linux based web2py server,
> > then os.path.basename() is not going to remove the directory. Could
> > that be the problem?
> > Richard
>
> > On Aug 24, 6:51 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > Nothing changed between 1.66.1 and 1.66.2 in this respect. I am
> > > puzzled. The file is tored by the function store in sql.py. That
> > > function calls os.path.basename. Can you add some print statements in
> > > there and check whether the function is not doing its job?
>
> > > Massimo
>
> > > On Aug 23, 11:43 pm, Richard <richar...@gmail.com> wrote:
>
> > > > I can confirm it happened with 1.66.1. Is it worth testing with
> > > > 1.66.2?
> > > > Richard
>
> > > > On Aug 24, 10:05 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > > I have double checked and it seems to me this has been fixed about a
> > > > > couple of months ago (before your post).
> > > > > The problem is that data stored before this was fixed may contain the
> > > > > full path.
>
> > > > > Can you verify the problem is fixed in 1.66.2?
>
> > > > > Massimo
>
> > > > > On Aug 23, 6:58 pm, Richard <richar...@gmail.com> wrote:
>
> > > > > > I would like to upgrade my web2py when this is fixed, so is it worth
> > > > > > creating an issue on Google Code to track it?
> > > > > > Or has it already been fixed?
>
> > > > > > Richard
>
> > > > > > On Aug 20, 4:26 pm, Richard <richar...@gmail.com> wrote:
>
> > > > > > > great!
> > > > > > > Apparently some old versions of IE include the full path.
>
> > > > > > > Richard
>
> > > > > > > On Aug 19, 5:39 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > > > > > Yes, this may be a bug on windows. I will fix it.
>
> > > > > > > > On Aug 18, 9:04 pm, Richard <richar...@gmail.com> wrote:
>
> > > > > > > > > hello,
>
> > > > > > > > > From an upload form should 
> > > > > > > > > request.vars.<upload_name>.filename contain
> > > > > > > > > the original file basename, full path, or the raw string of 
> > > > > > > > > whatever
> > > > > > > > > was in content-disposition?
> > > > > > > > > I had assumed it was the basename but from some error tickets 
> > > > > > > > > found it
> > > > > > > > > must be the raw string.
>
> > > > > > > > > Would it be worth parsing this variable into something 
> > > > > > > > > consistent?
> > > > > > > > > On my Linux box I am occasionally getting filenames like "C:\
> > > > > > > > > \Documents and Settings\\user\\Desktop\\file.txt", which 
> > > > > > > > > can't be
> > > > > > > > > parsed with os.path.basename().
>
> > > > > > > > > Richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to