[Bug 1528316] [NEW] pyhton3 flask hangs on file changes using send_from_directory
Benjamin Baez
benbaez4 at gmail.com
Mon Dec 21 18:34:00 UTC 2015
Public bug reported:
I was getting an exception randomly on minetest master-server that I
traced back to "send_from_directory". When I searched on the web I
found the problem was already reported and resolved a few years back.
Similar Error
https://github.com/mitsuhiko/flask/issues/1169
Bug Fix:
https://github.com/mitsuhiko/flask/pull/921
Please update the package with bug fix reported above.
Thank you!
Summary of issue from a user on GitHub:
welshjf commented on May 1
I've hit this problem too; perhaps I can clarify what's going on.
send_from_directory tests for existence based on the safe_join of directory and filename. So if directory is relative, this is relative to the current working directory of the process -- pretty unreliable. send_file, however, expands relative paths based on current_app.root_path, and does not have any existence check.
Thus, if the CWD and root_path do not match, send_from_directory may prematurely raise a 404 for files that do exist, or fail to do so for files that happen to exist in the CWD but not the root_path. In the second case, you get a 500 internal error when os.path.getsize or
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python3-flask (not installed)
ProcVersionSignature: Ubuntu 3.19.0-25.26~14.04.1-generic 3.19.8-ckt2
Uname: Linux 3.19.0-25-generic i686
ApportVersion: 2.14.1-0ubuntu3.19
Architecture: i386
Date: Mon Dec 21 10:20:51 2015
InstallationDate: Installed on 2015-12-09 (12 days ago)
InstallationMedia: Ubuntu-Server 14.04.3 LTS "Trusty Tahr" - Beta i386 (20150805)
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: flask
UpgradeStatus: No upgrade log present (probably fresh install)
** Affects: flask (Ubuntu)
Importance: Undecided
Status: New
** Tags: apport-bug i386 trusty
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to flask in Ubuntu.
https://bugs.launchpad.net/bugs/1528316
Title:
pyhton3 flask hangs on file changes using send_from_directory
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/flask/+bug/1528316/+subscriptions
More information about the Ubuntu-server-bugs
mailing list