Repository: borgbackup/borg

Issue:
0.26.0 binary: borg mount fails with ImportError, can't find "queue" module
While testing binaries that were recently announced on the ML, the fuse mount feature failed. I have actually been getting FUSE errors intermittently with borg-0.25 and attic-0.16 (most recent release), but this error message is different from what I get from borg-0.25.

I have no idea if this is reproducible but here is what I did to get the failure. I have hidden standard output from the successful commands. 

```
$ ./borg-trusty64 init --encryption=repokey test
$ ./borg-trusty64 create -C lz4 test::"notes_$(date -u +"%FT%T%Z")" ~/notes
$ mkdir restore
$ ./borg-trusty64 mount test::notes_2015-09-23T01:30:04UTC restore
borg: loading fuse support failed [ImportError: No module named 'queue']
borg: Exiting with failure status due to previous errors
```

I am testing the binaries distributed here:
https://paste.thinkmo.de/NUoRZ2Vr

Here is all the information requested by the README on that page.

```
$ ./borg-trusty64
usage: borg-trusty64 [-h]
[...]
Borg 0.26.0 - Deduplicated Backups
[...]

$ sha256sum borg-trusty64
8bb7b0659c3ad78a39e115b9a320735af1ef0da101df19ed436ec2dac20b21ae  borg-trusty64

$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    2
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 58
Model name:            Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
Stepping:              9
CPU MHz:               1199.960
CPU max MHz:           3300.0000
CPU min MHz:           1200.0000
BogoMIPS:              5188.17
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0-3

$ uname -a
Linux hostname 4.1.0-2-amd64 #1 SMP Debian 4.1.6-1 (2015-08-23) x86_64 GNU/Linux
# this is Debian testing / Stretch / what will become Debian 9
```



Discussion:
Confirmed, I have the same issue with that binary on Ubuntu 14.04 64bit.
Strange is that I could not find any reference to "queue" in borg or llfuse.
Hmm, it might be triggered by logging stdlib module which is used by llfuse.

This can be solved by:

```
pyinstaller -F -n borg-trusty64 --hidden-import=logging.config borg/__main__.py
```

Note: I suspect the queue module it complains about is pulled in via logging package. Adding logging.config should also indirectly add logging.handlers (and queue).

See new binaries linked from #213 - that should fix the "queue" issue.

Please test and close if it works for you.

This binary fixes the bug.


Resolving patch:
diff --git a/borg/logger.py b/borg/logger.py
--- a/borg/logger.py
+++ b/borg/logger.py
@@ -33,6 +33,10 @@
 import inspect
 import logging
 
+# make it easy for PyInstaller (it does not discover the dependency on this
+# module automatically, because it is lazy-loaded by logging, see #218):
+import logging.config
+
 
 def setup_logging(stream=None):
     """setup logging module according to the arguments provided


Test patch: