| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
| |
Make logging functions synchronous.
They were not calling any async functions, and wrapping them in
maybe_coroutine caused reactor to be imported before gtkui could
install the gtk reactor.
Closes: https://github.com/deluge-torrent/deluge/pull/353
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Have the log dir be a protected windows folder and Deluge crashes.
Windows blocks access to the dir and so it fails. It will fail trying to write
to any protected folder. Should probably just pass on the error maybe
and maybe log to stdout and log a message saying access was blocked or
something.
.\deluge-debug -L debug -l E:\Documents\deluge.log
...
Failed to execute script 'deluge-debug-script' due to unhandled exception!
Closes: https://dev.deluge-torrent.org/ticket/3502
Closes: https://github.com/deluge-torrent/deluge/pull/358
|
|
|
|
|
|
|
|
| |
Added pyupgrade utility with manual stage to pre-commit and run on all
files.
Ref: https://github.com/asottile/pyupgrade
Closes: deluge-torrent/deluge#326
|
|
|
|
|
|
|
|
|
| |
* Removed all __future__ imports from code
* Removed all six dependencies
* Removed all future_builtins imports
* Removed all Python 2 related code
Closes: deluge-torrent/deluge#325
|
|
|
|
|
|
|
| |
A quick fix of some of the mistakes caught by codespell.
Updated readme with new IRC server
Useful to add it as part of linting checks.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The modification of Python logging _findCaller args in Python 3.8 raises
TypeError in our custom Twisted Logger with Twisted <= 19 versions.
The actual issue for the custom logger was fixed in 18.9 so added a
version check to avoid usage.
Refs:
- https://twistedmatrix.com/trac/ticket/7927
- https://github.com/twisted/twisted/commit/6b894744e4d2439c1a4436d1e0e0b2a6cdff68e4
|
|
|
|
|
| |
In case no source was found, a 3-tuple was returned instead of a 4-tuple
in Python 3
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
The findCaller method returns a 4-element tuple on Python 3 whereas it
was a 3-element tuple on Python 2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The move to using auto-formatter makes it easier to read, submit and
speeds up development time. https://github.com/ambv/black/
Although I would prefer 79 chars, the default line length of 88 chars
used by black suffices. The flake8 line length remains at 120 chars
since black does not touch comments or docstrings and this will require
another round of fixes.
The only black setting that is not standard is the use of double-quotes
for strings so disabled any formatting of these. Note however that
flake8 will still flag usage of double-quotes. I may change my mind on
double vs single quotes but for now leave them.
A new pyproject.toml file has been created for black configuration.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Some new flake8 checkers were added so fix these new warnings and
any issues uncovered.
Use add-trailing-comma to fix missing trailing commas. It does not
format it as well as I would like however it was fast to change and
helps with git changes in future.
Removed pylint from tox due to large number of warnings.
|
|
|
|
|
|
|
|
|
|
| |
* Continuation of updating code to Python 3 with Python 2 fallback.
* Using io.open allows files to be encoded and decoded automatically on write and read. This
maintains the python boundaries of unicode in code and bytes for output/files so less
explicit encoding or decoding.
* io.StringIO is the replacement for StringIO and will only accept unicode strings.
* io.BytesIO is used where bytes output is required by the enclosing method.
* Update bencode for full compatibility.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added `from __future__ import unicode_literals` to every file so
now all strings in code are forced to be unicode strings unless
marked as byte string `b'str'` or encoded to byte string `'str'.encode('utf-8')`.
This is a large change but we have been working towards the goal of unicode
strings passed in the code so decoding external input and encoding
output as byte strings (where applicable).
Note that in Python 2 the `str` type still refers to byte strings.
* Replaced the use of `str` for `basestring` in isinstance comparison as
this was the original intention but breaks code when encoutering unicode strings.
* Marked byte strings in gtkui as the conversion to utf8 is not always handled, mostly
related to gobject signal names.
|
| |
|
| |
|
|
|
|
|
|
| |
From pep8-naming:
* N802: function name should be lowercase
* N803: argument name should be lowercase
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* A rather disruptive change but for a few reasons such as easier to read,
easier type, keep consistent and javascript code uses single quotes.
* There are a few exceptions for the automated process:
* Any double quotes in comments
* Triple double quotes for docstrings
* Strings containing single quotes are left e.g. "they're"
* To deal with merge conflicts from feature branches it is best to follow
these steps for each commit:
* Create a patch: `git format-patch -1 <sha1>`
* Edit the patch and replace double quotes with single except those in
comments or strings containing an unescaped apostrophe.
* Check the patch `git apply --check <patchfile>` and fix any remaining
issues if it outputs an error.
* Apply the patch `git am < <patchfile>`
|
|
|
|
|
|
| |
Add wrapper around the stream passed to the loggers streamhandler
when no log file is specified. Console in interactive mode now
ignores the log output with no logfile specified.
|
| |
|
|
|
|
| |
* Added parameter log.setup_logger to prevent output noise in unit tests
|
|
|
|
|
|
|
|
| |
* Ensure all file descriptors are closed. Using the with statement ensures
closure.
* The main problem was with thousands of unclosed file desciptors from
tracker_icons mkstemp.
* Use a prefix 'deluge_ticon.' to identify created tracker_icon tmp files.
|
|
|
|
| |
Includes a commented out test to replicate the issue.
|
|
|
|
|
|
|
| |
Remove warnings from ignore list in .pylintrc:
* super-on-old-class
* pointless-except
* non-parent-init-called
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason errors are logged by twisted as
'Unhandled error in Deferred', but without a following
stacktrace. This can happen in a deferred callback that e.g.
raises an ImportError. Without an excplicit error handler for a
deferred to log such errors, finding the error can be very tricky.
Fix this by using a custom twisted.python.log.PythonLoggingObserver,
PythonLoggingObserver, that also logs the traceback in addition to
the error message.
|
| |
|
| |
|
|
|
|
|
|
|
| |
* Replace Popen with reactor.spawnProcess and read process
output with twisted.internet.protocol.ProcessProtocol
* Implement support for running custom script code
* Now logs to stdout instead of stderr when not logging to file
|
| |
|
|
|
|
|
|
|
|
| |
* Fix for pluginmanager multiple inheritance which in this case is using super incorrectly.
* Explicitly disable pylint 'pointless-except' and 'super-on-old-class' that prospector
tool somehow runs.
* Make __all__ a tuple to supress pep257 warning.
* Add a noqa for older versions of pyflakes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Selected Warning messages disabled in pylintrc:
* unused-argument: Quite a large and disruptive change if enabled.
* broad-except: Most required in-depth investigation to determine type.
* fixme: Not important
* protected-access: Complicated to fix
* import-error: Too many false-positives
* unidiomatic-typecheck: Should be fixed in the next round of checks.
* unused-variable: Again large and disruptive changes.
* global-statement: Most usage is required.
* attribute-defined-outside-init: Should be fixed in next round of checks.
* arguments-differ: Possible false-positives, needs revisited.
* no-init, non-parent-init-called, super-init-not-called: False-positives?
* signature-differs: False-positives?
|
|
|
|
| |
Broke the retrieval of logging lines.
|
|
|
|
| |
* Use the inline '# NOQA' to supress N802 lower-case warnings
|
|
|
|
|
|
| |
* Added N802 to flake8 ignore as certain inherited funcs cannot be changed
to lowercase and this unresolved warning hides other errors/warnings.
* Include new header
|
| |
|
| |
|
|
|
|
|
| |
Since the plugins namespace was merged into master, calling "logging.getLogger(__name__)" will result in a properly named logger for plugins which will allow logging filtering.
The previous workaround "getPluginLogger()", is now deprecated.
|
|
|
|
| |
logger instead of using `getPluginLogger()`
|
|
|
|
| |
width and its easier to read this way
|
| |
|
| |
|
| |
|
|
|
|
| |
find out which was the caller module. This might also happen on other platforms although I was unable to reproduce it on x86. Anyway, handle it cleanly.
|
| |
|
|
|
|
| |
Removed log message that caused error. It was never logged anyway, even on the master branch before the improved logging branch was created.
|
| |
|
| |
|
|
|
|
| |
python 2.6.
|