Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#3883 closed defect (fixed)

Filename saved with full path?

Reported by: rafi Owned by: Radek Bartoň
Priority: high Component: DownloadsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

When I upload a file through this plugin, the file gets save as (full local path of file).* Does this happen for everybody? Is there any way around this?

Thanks!

Attachments (0)

Change History (10)

comment:1 Changed 16 years ago by Radek Bartoň

Status: newassigned

No it probably happens on Windows sytem only. I had similar issue in ScreenshotsPlugin IIRC. I'll try to search the solution.

comment:2 Changed 16 years ago by Radek Bartoň

Please check if r4516 fixes the issue. I can't.

comment:3 Changed 16 years ago by anonymous

This problem only occurs with IE. Uploading a file with firefox is okay. Problem still exists in r4516. But with r4516 you broke something related to TagsPlugin. So I had to turn it off:

AttributeError: 'str' object has no attribute 'realm'

comment:4 Changed 16 years ago by Radek Bartoň

Hmm, that doesn't tell me much without a line number. Please try to reproduce with r4558 and send me a debug log. It would be also helpful if you can check the ScreenshotsPlugin upload too. Thanks.

comment:5 Changed 16 years ago by anonymous

If there is something missing please ask again...

2008-10-22 13:46:12,420 Trac[__init__] DEBUG: context: <Context <Resource 'downloads-admin'>> page: downloads action: post-add
2008-10-22 13:46:12,421 Trac[__init__] DEBUG: modes: ['downloads-post-add', 'admin-downloads-list']
2008-10-22 13:46:12,421 Trac[__init__] DEBUG: C:\Dokumente und Einstellungen\Oliver\Eigene Dateien\Downloads\freetz-1.0.tar.bz2
2008-10-22 13:46:12,421 Trac[__init__] DEBUG: C:\Dokumente und Einstellungen\Oliver\Eigene Dateien\Downloads\freetz-1.0.tar.bz2
2008-10-22 13:46:12,422 Trac[__init__] DEBUG: INSERT INTO download (description, author, tags, component, platform, version, architecture, file, time, type, size) VALUES (, oliver, None, download, None, freetz-1.0, None, C:\Dokumente und Einstellungen\Oliver\Eigene Dateien\Downloads\freetz-1.0.tar.bz2, 1224675972, 2, 1854434)
2008-10-22 13:46:12,431 Trac[__init__] DEBUG: SELECT id, file, description, size, time, count, author, tags, component, version, architecture, platform, type FROM download WHERE time = 1224675972
2008-10-22 13:46:12,435 Trac[__init__] DEBUG: ext: bz2
2008-10-22 13:46:12,435 Trac[__init__] DEBUG: filepath: /var/www/trac/downloads/26/C:\Dokumente und Einstellungen\Oliver\Eigene Dateien\Downloads\freetz-1.0.tar.bz2
2008-10-22 13:46:12,435 Trac[__init__] DEBUG: path: /var/www/trac/downloads/26
2008-10-22 13:46:12,465 Trac[__init__] DEBUG: SELECT id, file, description, size, time, count, author, tags, component, version, architecture, platform, type FROM download WHERE id = 0
2008-10-22 13:46:12,467 Trac[__init__] DEBUG: SELECT id, file, description, size, time, count, author, tags, component, version, architecture, platform, type FROM download ORDER BY id ASC
2008-10-22 13:46:12,472 Trac[__init__] DEBUG: SELECT id, name, description FROM architecture WHERE id = None
2008-10-22 13:46:12,474 Trac[__init__] DEBUG: SELECT id, name, description FROM platform WHERE id = None
2008-10-22 13:46:12,477 Trac[__init__] DEBUG: SELECT id, name, description FROM download_type WHERE id = 2
2008-10-22 13:46:12,481 Trac[__init__] DEBUG: SELECT id, name, description FROM architecture WHERE id = None
2008-10-22 13:46:12,483 Trac[__init__] DEBUG: SELECT id, name, description FROM platform WHERE id = None
2008-10-22 13:46:12,486 Trac[__init__] DEBUG: SELECT id, name, description FROM download_type WHERE id = 2
2008-10-22 13:46:12,489 Trac[__init__] DEBUG: SELECT name, description FROM component
2008-10-22 13:46:12,491 Trac[__init__] DEBUG: SELECT name, description FROM version
2008-10-22 13:46:12,496 Trac[__init__] DEBUG: SELECT id, name, description FROM architecture ORDER BY id ASC
2008-10-22 13:46:12,498 Trac[__init__] DEBUG: SELECT id, name, description FROM platform ORDER BY id ASC
2008-10-22 13:46:12,499 Trac[__init__] DEBUG: SELECT id, name, description FROM download_type ORDER BY id ASC
2008-10-22 13:46:12,502 Trac[__init__] DEBUG: Prepare chrome data for request

As I remember I observed the same issue with screenshots plugin. But I can't test atm because I discovered that screenshot "reuse numbers"-feature is not working...

2008-10-22 13:50:06,467 Trac[__init__] WARNING: 500 Trac Error (Error storing file. Is directory specified in path config option in [screenshots] section of trac.ini existing? Original message was: [Errno 17] Die Datei existiert bereits: '/var/www/trac/screenshots/4')
2008-10-22 13:50:48,005 Trac[__init__] WARNING: 500 Trac Error (Error storing file. Is directory specified in path config option in [screenshots] section of trac.ini existing? Original message was: [Errno 17] Die Datei existiert bereits: '/var/www/trac/screenshots/5')

comment:6 Changed 16 years ago by anonymous

With DownloadTags enabled I get this in browser:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7581-py2.5.egg/trac/web/api.py", line 367, in send_error
    'text/html')
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7581-py2.5.egg/trac/web/chrome.py", line 715, in render_template
    return stream.render(method, doctype=doctype)
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/core.py", line 179, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/output.py", line 60, in encode
    return _encode(u''.join(list(iterator)))
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/output.py", line 311, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/output.py", line 753, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/output.py", line 592, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/output.py", line 698, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/output.py", line 532, in __call__
    for ev in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7581-py2.5.egg/trac/web/chrome.py", line 767, in _strip_accesskeys
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7581-py2.5.egg/trac/web/chrome.py", line 756, in _generate
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/markup.py", line 298, in _match
    ctxt, start=idx + 1, **vars):
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/markup.py", line 298, in _match
    ctxt, start=idx + 1, **vars):
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/markup.py", line 245, in _match
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 533, in _eval
    for event in substream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 496, in _eval
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 551, in _flatten
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/path.py", line 141, in _generate
    subevent = stream.next()
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/markup.py", line 234, in _strip
    event = stream.next()
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 533, in _eval
    for event in substream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 496, in _eval
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 551, in _flatten
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/path.py", line 141, in _generate
    subevent = stream.next()
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 569, in _include
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/markup.py", line 234, in _strip
    event = stream.next()
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 520, in _eval
    result = _eval_expr(data, ctxt, **vars)
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/base.py", line 286, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/usr/lib/python2.5/site-packages/Genshi-0.5.2dev_r947-py2.5-linux-i686.egg/genshi/template/eval.py", line 180, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7581-py2.5.egg/trac/templates/error.html", line 166, in <Expression u'shorten_line(repr(value))'>
    <td><code>${shorten_line(repr(value))}</code></td>
  File "/usr/lib/python2.5/site-packages/Trac-0.11stable_r7581-py2.5.egg/trac/mimeview/api.py", line 169, in __repr__
    if context.resource.realm: # skip toplevel resource
AttributeError: 'str' object has no attribute 'realm'

comment:7 Changed 16 years ago by Radek Bartoň

Please try r4643, uploads should work now. Concerning last error message, it seems that it's Trac internal error. I'm not sure on what occation it happens but I don't experience this with Trac 0.11.1 stable and lastest TracTags 0.6. Try to update first, if you don't have lastest version. Concerning your "reuse-numbers" problem with ScreenshotsPlugin, please elaborate.

comment:8 Changed 16 years ago by Radek Bartoň

And I forgot to apologize for the delay. I wasn't notified by mail about new reply.

comment:9 Changed 16 years ago by Oliver Metz

Resolution: fixed
Status: assignedclosed

Downloads Plugin is working now as expected. Thank you.

I will investigate this "reuse-numbers" problem further next week and open a new ticket. Until now I can only tell you that a screenshot with a low ID (2) was deleted and now Screenshots-Plugin tries to insert new files at 3,4,5 and so on. But this fails because this IDs are already in use.

comment:10 Changed 16 years ago by Radek Bartoň

OK, I'll port same changes to ScreenshotsPlugin. If you want just workaround problems with already existing screenshot directory, you can just delete it.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Radek Bartoň.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.