Bug 158534 - extension stripped from filename
extension stripped from filename
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: bittorrent (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Howarth
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-23 08:50 EDT by jeroen
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-24 06:57:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jeroen 2005-05-23 08:50:22 EDT
When downloading a torrent
(http://www.mininova.org/get/45763/55.degrees.north.s02e01.ws.pdtv.xvid-river.%5BVTV%5D.torrent
for example), btdownloadmanycurses.py creates the video file without an AVI
extension. The should be named
55.degrees.north.s02e01.ws.pdtv.xvid-river.[VTV].avi, but it actually called
55.degrees.north.s02e01.ws.pdtv.xvid-river.[VTV].
Comment 1 Paul Howarth 2005-05-23 09:11:10 EDT
The problem appears to affect btdownloadmanycurses.py and btdownloadmany.py.

The problem does not appear to affect btdownloadcurses.py or btdownloadgui.py.

I've now reported the problem upstream; we'll see what the author has to say,
Comment 2 Paul Howarth 2005-05-23 17:08:54 EDT
Comments from upstream:

--------------------------------------------------------------------------

(I assume the person who reported this bug to you meant btlaunchmany*.py, as
there is no btdownloadmany*.py )

This is not a bug per se but rather possibly an issue with the default behavior
being wrong.

Checking the --help output, I see:

--saveas_style <arg>
          How to name torrent downloads (1 = rename to torrent name, 2 = save
          under name in torrent, 3 = save in directory under torrent name)
          (defaults to 1)

So the default behavior of btlaunchmany*.py is to save a torrent named

foo.bar.baz.torrent 

as

foo.bar.baz

even if the .torrent file says that the filename is 

foo.bar.baz.ext
or
foo.bar.ext

To get the behavior that you were expecting, you would have to add the
command line option --saveas_style 2, which would save

foo.bar.baz.torrent 

as

foo.bar.baz.ext (or whatever the .torrent file specifies)

I'm not sure which behavior is the best. Both --saveas_style #1 and #2 have
unexpected failure cases. #1 has this case you have noticed, and #2 has the case
where

foo.bar.baz.torrent

contains a file called:

one.two.ext

and when the user looks in the directory, there is no way for them to
know/remember that one.two.ext came from foo.bar.baz.torrent.

--saveas_style 3 seems a bad default because it would create a bunch
of vacuous directories, but it perhaps is the most secure and
error-free.

--------------------------------------------------------------------------

So I'm inclined to suggest that you use "--saveas_style 2" and close this one as
"not a bug". What do you think?
Comment 3 jeroen 2005-05-24 03:43:16 EDT
Right, btlaunchmanycurses.py. Only issue i have with this is the behavior
*changed* since 4.0 (i think). The default behavior used to be --saveas_style 2.

Additionally, after a torrent has finished, you have to rename the file to the
proper extension (PITA). One could argue that someone might not remember/know
what kind of filetype/mimetype the file he downloaded was. So i'd advocate
making --saveas_style 2 the default value.
Comment 4 Paul Howarth 2005-05-24 05:50:32 EDT
I don't think the change came in after 4.0.0; the defaultargs.py in 4.0.0 and
4.0.1 have the same default (1) for saveas_style.

I agree that the default doesn't seem very sensible (I'd personally advocate
style 3 as a better default) but that's what the upstream authors have chosen.
It's probably best to try arguing for a change upstream, as I'd rather keep the
RPM package reflecting upstream policy.

Are you OK with explictly using "--saveas_style 2" and now closing this bug?
Comment 5 jeroen 2005-05-24 06:12:44 EDT
Sure, thanks.
Comment 6 Paul Howarth 2005-06-02 11:33:44 EDT
FWIW, it's changed again in 4.1.x:

--saveas_style <arg>
          How to name torrent downloads: 1: use name OF torrent file (minus
          .torrent); 2: use name encoded IN torrent file; 3: create a directory
          with name OF torrent file (minus .torrent) and save in that directory
          using name encoded IN torrent file; 4: if name OF torrent file (minus
          .torrent) and name encoded IN torrent file are identical, use that
          name (style 1/2), otherwise create an intermediate directory as in
          style 3; CAUTION: options 1 and 2 have the ability to overwrite files
          without warning and may present security issues. (defaults to 4)

Note You need to log in before you can comment on or make changes to this bug.