Commit Graph

8758 Commits

Author SHA1 Message Date
Alex Knaust 15c250e152 Fix template config.ui naming in create_plugin script. 2020-04-20 00:01:16 -07:00
Calum Lind eb57412601 [Tests] Fix tox, pytest and travis issues
* Error occurring with Pytest 5.4 so pin to below that version.
 * Fix minor issues with Travis config.
 * Use full command-switches for pytest in tox config.
 * Remove pin for pip as issue with pip-wheel-metadata was fixed in 19.3
 * Remove tox-venv as causing issues of incompatible packages installed.
   The latest versions of the virtualenv package should handle these
   duties.
2020-04-12 17:37:42 +01:00
Calum Lind 2f1c008a26 [Console] Fix AttributeError setting config values
GitHub user JohnDoee reported that config settings are not decoded
correctly, this error can be reproduced with a command like

    deluge-console -c /config/ "config --set download_location /downloads"

    > AttributeError: 'str' object has no attribute 'decode'

The tokenize code was using 'string-escape' to decode strings but there
is no direct replacement in Python 3 but also unnecessary. However the
tokenize code is complex and buggy and not really suitable for the task
of evaluating config values.

A better alternative is to evaluate the config values using the json
decoder with some additional logic to allow for previous syntax usage,
such as parentheses.

Added a comprehensive set of tests to check for potential config values
passed in from command line.
2019-11-28 12:38:02 +00:00
minus 5e06aee5c8 [Logging] Fix findCaller with unknown source
In case no source was found, a 3-tuple was returned instead of a 4-tuple
in Python 3
2019-11-19 17:44:48 +01:00
minus 351664ec07 [Logging] Fix Python 3.8 compatibility
Deluge's logger class extends Python's `logging.Logger`. Since Python
3.8, it takes an additional argument `stacklevel`.
The implementation in Deluge does not support that. Work around the
problem by ignoring additional arguments.
2019-11-19 17:44:47 +01:00
Calum Lind 5f1eada3ea [Tests] Skip buggy pytest 5.2.3
Plugins test fails due to:

https://github.com/pytest-dev/pytest/issues/6194
2019-11-15 20:55:22 +00:00
Calum Lind bde4e4443e [Lint] Fix Black and Flake8 issues
For a single element unpack black now also encloses with parentheses to
make it clearer: https://github.com/psf/black/issues/1108

Fix flake8 warnings
2019-11-13 15:44:46 +00:00
Anders Jensen ed4bc5fa17 [Core] Fix potential "dictionary changed size during iteration" on shutdown 2019-11-12 15:40:38 +00:00
Calum Lind 20afc31f3c [Docs] Fix changlog symlink and markdown issue 2019-11-12 15:37:12 +00:00
t0obz 9232a52fd6 [Docs] Update dev environment instructions
I'm going through these instructions on a clean Ubuntu 19.04 VM

These are the changes I needed to make to get Deluge to build/run
2019-11-12 15:36:52 +00:00
Calum Lind 23b3f144fc [#3298|Core] Fix pickle loading non-ascii state error
When trying to load a torrents.state from version 1.3 users were
encountering the following error:

    UnicodeDecodeError: 'ascii' codec can't decode byte

This was due to the way that Python 2 was pickling state with torrent
filenames that contained non-ascii characters and Python 3 was
unpickling the state using ascii encoding and failing. The fix is to
specify utf-8 encoding when loading torrents.state.
2019-11-12 15:21:56 +00:00
Calum Lind 89d62eb509 [GTK] Remove orphaned code
Changes were made to sidebar theming in commit 5a6f202 and this code was
forgotten to be removed.
2019-10-31 10:56:08 +00:00
Christopher Beard 00176ee2cd [Docs] Typo corrections in testing.md 2019-10-31 10:04:30 +00:00
Pere Orga 8737005b82 [GTK] Fix typo in preferences language label 2019-10-31 10:01:40 +00:00
Jack O'Sullivan d08c3f72e9 Fix privilege dropping when setting process ownership
`os.setgid()` should be called to set the GID, and it should be called
before `os.setuid()` to prevent reinstatement of privileges.
2019-10-31 09:57:33 +00:00
Calum Lind 40ebdf3f39 [GTK] Add missing translation markup
Found some text needing marked for translation.
2019-10-31 09:40:59 +00:00
Calum Lind eeeb7fb69b [GTK] Fix Status tab download speed and uploaded
Previous work on the status tab caused these labels to not be in the
correct position so this commit swaps them back..
2019-10-31 09:38:37 +00:00
DjLegolas 3f9ae33793 [Label] Fix Options/Add windows not reopening
When a user clicked ESC key or X button, the Options and Add windows
didn't open again. This happened because the windows were closed and
not hidden, which deleted the instance of those windows.

This fix changed the behavior of the close action to 'hide'.
2019-06-25 11:51:59 +01:00
DjLegolas 0c7f53e305 [WebUI] Fix class-header for Deluge.EditTrackersWindow 2019-06-25 11:51:59 +01:00
Calum Lind 63a4301a8b [Notifications] Fix unhandled TypeErrors on Python 3
- Notify requires GLib.Variant for set_hint
- Twisted defer.fail only accepts Exceptions.

Fixes: #3267
2019-06-25 10:44:51 +01:00
DjLegolas 1b4ac88ce7 [Common] Fix creation of pidfile via command option
Python 3 raises a TypeError for binary file mode and writing text string.

Fixes: #3278
2019-06-25 10:39:49 +01:00
Calum Lind 4b29436cd5 [Core] Fix for peer.client UnicodeDecodeError
Some users have been reporting unhandled UnicodeDecodeErrors and the
traces show it occuring in the call to `peer.client`. Although unable to
replicate it seems prudent to put a try..except around the call to
ensure it does not break the UIs.

Refs: https://github.com/arvidn/libtorrent/issues/3858

Closes: #3279
2019-06-24 16:34:15 +01:00
int3l 833b5a1f30 [Common] Fix show_file unhandled dbus error
If dbus org.freedesktop.FileManager1 service is missing then show_file
raised an unhandled exception. The service is not available on certain
desktop environments e.g. i3wm.

The solution is to fallback to xdg-open.

Fixes: #3272
2019-06-24 11:44:29 +01:00
DjLegolas 24b094a04a [WebUI] Handle torrent add failures
Closes #2253.
2019-06-21 09:09:12 +03:00
Calum Lind 3365201011 [Docs] Fixes for spelling
Running on Ubuntu Xenial results in spelling warnings so update wordlist.
2019-06-18 09:07:48 +01:00
Calum Lind c1ba403d4e [Docs] Add service how-tos 2019-06-18 09:07:48 +01:00
Calum Lind 8b62e50eb8 [Docs] Add spellchecking with pyenchant
- Use sphinxcontrib.spelling with custom wordlist.
- Skip the checking of the modules documents as they raise
false-positives.
- Add a setup.py spellcheck_docs command.
- Fix spelling and other issues.
- Add a doc favicon.
2019-06-15 21:06:27 +01:00
Calum Lind 5b315e90c5 [Docs] Cleanup updating plugin page 2019-06-15 21:01:04 +01:00
Calum Lind b711cd258a Release 2.0.3 2019-06-12 18:47:11 +01:00
Calum Lind e1c4069a72 [Gtk] Refactor presenting window
Include the correct usage for other display servers.

Still not sure how to get the proper timestamp for Wayland or Quartz but
I read that using 0 equals the GDK_CURRENT_TIME which suffices for now.
2019-06-12 16:57:48 +01:00
Calum Lind a2dee79439 [GTK] Improve detecting X11 display server
GdkX11 still imports on Wayland so check display server is X11 before
importing.
2019-06-12 16:05:15 +01:00
Calum Lind 7a54db3179 [Docs] Fix typo and url for Windows install 2019-06-12 14:56:21 +01:00
Calum Lind 03e7952d26 [GTK] Only import wnck on X11 display
Wnck is only supported on X11 and raises errors in Wayland so only load
it when X11 present.

Fixes: #3265
2019-06-12 10:21:23 +01:00
Calum Lind 7ee8750be4 [GTK] Fix peers tab flag tooltip error
Hovering over a country flag resulted in an AttributeError.

This is due to get_tooltip_context now returning a bool value instead of
the tooltip object.

Fixes: #3219
2019-06-12 09:40:51 +01:00
Calum Lind f61001a15d [GTK] Fix missing argument for GtkMenu.popup()
Missed while converting from pygtk to Gtk3

Fixes: #3266
2019-06-12 09:40:14 +01:00
Calum Lind 86ddadacf7 [Extractor] Fix startup error
On Python 3 need to create a copy of the dict to iterate

Fixes: #3264
2019-06-12 09:40:14 +01:00
Calum Lind 632089940c [Web] Fix unable to change password
The hashlib update method requires bytes and raised a TypeError for salt
passed as text.

Added a test for auth change_password

Fixes: #3262
2019-06-11 20:14:11 +01:00
Calum Lind 5d7db3e727 [Web] Change request.base path encoding to utf-8
A user reported a problem with setting base path resulting in this error:

    encoding with 'idna' codec failed (UnicodeError: label too long)

It is likely the base path is longer than 63 chars, which is unusual,
however the idna codec is for domain name not paths so switch to utf-8.

Fixes: #3261
2019-06-11 20:14:11 +01:00
Calum Lind 4dd1f63b8b [Web] Fix TypeError with reverse proxy x-deluge-base header
The request header needs decoded otherwise string comparisons fail.

Fixes: #3260
2019-06-11 20:14:11 +01:00
Calum Lind fc134cdffb [Docs] Add more info to release notes 2019-06-11 20:14:11 +01:00
Calum Lind 36cb4c5a4f [Docs] Updates to release checklist 2019-06-11 20:14:11 +01:00
Calum Lind 676bdb26e0 [Docs] Remove incomplete Windows install instructions
The instructions are in-progress and missing steps so instead point to
the issue ticket for now.
2019-06-11 12:35:04 +01:00
Calum Lind dff778ceeb [i18n] Try loading intl.dll on Windows 2019-06-11 12:35:04 +01:00
Trav Easton bdadd2b515 Fix typo in install instructions for macOS 2019-06-11 12:35:04 +01:00
thelamer a34543100c [Web] Fix peers tab failing to set flag location
The request.country returns bytes not a string so decode.
2019-06-11 12:35:04 +01:00
Calum Lind b8b044f451 [lint] Fix pre-commit config key name 2019-06-10 14:24:47 +01:00
Calum Lind 2d87cde887 Make a 2.0.2 release 2019-06-08 21:34:27 +01:00
Calum Lind 212efc4f52 [Packaging] Move user out of systemd files and add to tarball
With the `deluge` user specified in the unit files it ties it to
that user and makes it unavailable for re-use by systemd user instance.

Remove the user and group from the unit files and put them in a separate
`user.conf` file that should be installed as an override file e.g. for
deluged.service this would be placed as follows:

    /etc/systemd/service/deluge.service.d/user.conf

Add the systemd files to the tarball for package maintainers.

Closes: #2034
2019-06-08 21:31:49 +01:00
Calum Lind 879a397215 [Packaging] Add updated launchd scripts
Copy from Trac UserGuide and updated with proper naming and deluge-web
version.

The bin location is default for brew with pip install.

Closes: #3073
2019-06-08 21:31:49 +01:00
Calum Lind 957cd5dd9c [Core] Fix SimpleNamespace on Python2 2019-06-08 21:31:49 +01:00