_check_trash() was added (in #3304) because TrashPermissionError didn't
exist, yet.
Now that it does, we can use it, and stop guessing what will cause a
permission problem.
Closes: #3374
This commit updates the super usage. Because Python 2 is not supported
anymore, super usage can be updated such that super is called without
any arguments in the default case where super is called with the class
name and self.
Note that all usage of super has not been updated - a few cases which
smelled funny have been ignored.
On Python 3, the default source file encoding for Python files is utf-8
and because Python 2 is no longer supported, the utf8 coding cookies can
be removed
* This is a potential fix to issue #4669. The fix simply catches the
recusrive symlink error and moves on. It is possibble that the
try/except belongs in the utils but I wanted to limit the scope.
* It looks like too many levels is error number 40 on linux.
* Switch to using errno instead of hardcoding the number.
* Fix spelling, smarter assert methods
* Log unrecognised errors and continue listing directory
* Skip recursive symlink test entirely on Windows
* Fix which test is skipped on Windows
Co-authored-by: Thomas Kluyver <thomas@kluyver.me.uk>
* Check for invalid characters prior to rename
On Windows platforms, rename operations containing ':' are problematic
since the operation succeeds, but creates an unintended "alternate data
stream" that gives the user the impression their file contents have been
deleted. This change performs cursory validation of the destination
name on platforms in which issues can occur. Currently, non-Windows
systems don't require this level of validation.
Fixes#5190
* Apply changes per review comments
instead of the monkeypatch we did to keep the backport patch small
requiring tornado 5 simplifies things a ton because tornado.concurrent.Future is asyncio.Future
This allows slower contents managers to not block the event loop by allowing
more of their API to return futures.
Other usages of contents manager functions are already wrapped in maybe_future,
including a use of `file_exists` in contents/handlers.py
It appears that the Windows backend of send2trash can't guarantee that
files won't actually be deleted. There are some hints that this happens
in particular when you delete a lot of data at once. So this returns to
refusing to delete folders unless they're empty (or contain only ipynb
checkpoints).
Closes gh-3631
* Added a flag to allow access of hidden files
The flag '--allow-hidden' will allow Tornado to access hidden files
such as '.images/my_img.jpg'
* Fixed jupyterlab not following allow-hidden
Jupyterlab stores its options in a different location than the
standard notebook. Added the ability to check there as well.
* Updated implementation for any app
Previously I was accessing the settings dict based on the name of
the app that was being used. ex 'NotebookApp', or 'LabApp'.
Now the setting is passed directly into the Tornado settings, and
can be accessed via a more general method.
* Added/fixed unit tests for test_hidden_files
Fixed broken unit tests by setting the default to allow_hidden=False
then added unit test in FilesTest:test_hidden_files that checks for
the accessibility of files with allow_hidden=True
* allow-hidden now works everywhere
Previously allow-hidden flag only allowed hidden files to be accessed via
tornado. Now you can use the allow-hidden flag to access hidden directories and
files via the filebrowser.
* Remove --allow-hidden alias
* Move allow_hidden option onto ContentsManager
* Use try/finally to ensure allow_hidden option is set back to False after test
* Allow access to hidden files, but don't list them for now
* Simplify hidden check for listing again
* Fix indentation