Secretions / boar

Automatically exported from code.google.com/p/boar
1 stars 0 forks source link

Error importing file with "\" in the filename #97

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps which will demonstrate the problem:

touch "Bach-Brandenburg Concerto No. 2, \\Andante.mp3"
boar mkrepo /tmp/boar-bug
boar --repo /tmp/boar-bug mksession Demonstration
boar --repo /tmp/boar-bug import . Demonstration

What is the expected output? What do you see instead?

I would expect this to work as it is a valid character (on Linux).
Alternately, as it is *NOT* a valid character on Windows I would expect an 
intelligible error message to that effect.  (FYI Windows is a target platform 
for me so an error message would be a feature.)

Instead I see a stack trace on the import:

Traceback (most recent call last):
  File "/scratch/projects/boar/boar", line 1340, in <module>
    return_code = main()
  File "/scratch/projects/boar/boar", line 1248, in main
    return cmd_import(args[1:])
  File "/scratch/projects/boar/boar", line 634, in cmd_import
    allow_empty = options.allow_empty)
  File "/scratch/projects/boar/workdir.py", line 291, in checkin
    self.get_changes(self.revision, ignore_errors = ignore_errors)
  File "/scratch/projects/boar/workdir.py", line 509, in get_changes
    md5 = self.get_cached_md5sum(fn)
  File "/scratch/projects/boar/workdir.py", line 430, in get_cached_md5sum
    stat = os.stat(abspath)
OSError: [Errno 2] No such file or directory: '/tmp/boar/Bach-Brandenburg 
Concerto No. 2, /Andante.mp3'

What platform are you using? (Windows XP, Windows 7, Linux, ...)

Linux, Ubuntu 10.04.4 LTS (Lucid)

What version of Python are you using?

Python 2.6.5

What version of boar are you using? (Mercurial change id or daily build
date)

Download boar.16-Nov-2012.tar.gz

Please provide any additional information below.

Original issue reported on code.google.com by Flying...@gmail.com on 23 Apr 2013 at 11:57

GoogleCodeExporter commented 9 years ago
wrong title line.  Problem character is the Linux path separator '/', not '\' 
as listed.  Repeat steps are correct.

Original comment by Flying...@gmail.com on 23 Apr 2013 at 11:59

GoogleCodeExporter commented 9 years ago
I'm a little bit confused by your last comment. A forward slash "/" is not a 
valid filename character on linux, but backslash is. You probably mean to state 
the issue as it was written originally, right? 

Original comment by ekb...@gmail.com on 23 Apr 2013 at 2:50

GoogleCodeExporter commented 9 years ago
Yes, go with it as originally written.  Specifically, the "steps to recreate" 
is something I put into a shell script and ran multiple times.  When I remove 
the slash characters the script runs without error.

Original comment by Flying...@gmail.com on 23 Apr 2013 at 2:57

GoogleCodeExporter commented 9 years ago
Yup, all valid characters should work.

Original comment by ekb...@gmail.com on 23 Apr 2013 at 9:15