summary refs log tree commit diff stats
path: root/README.md
diff options
context:
space:
mode:
authorNathan Typanski <ntypanski@gmail.com>2014-06-10 21:02:39 -0400
committerhut <hut@lepus.uberspace.de>2014-06-11 03:53:09 +0200
commit8061eb4c7003acdc1f2ec5ab26c2ec32913e2d09 (patch)
treef105a86867edd3357766a540868fba2a5d827995 /README.md
parentdb2bdb28fe42d5ef9ef1aa6a27a56f3a56b993ad (diff)
downloadranger-8061eb4c7003acdc1f2ec5ab26c2ec32913e2d09.tar.gz
fix crash in sha encode of previews
When opening certain filetypes, for which Ranger can't render a preview
(they appear as 0 bytes), Ranger will crash on the sha1_encode:

    Traceback (most recent call last):
    File "~/ranger/ranger/core/main.py", line 139, in main
        cacheimg = os.path.join(ranger.CACHEDIR, self.sha1_encode(path))
    File "~/ranger/ranger/core/actions.py", line 821, in sha1_encode
        sha1(path.encode('utf-8')).hexdigest()) + '.jpg'
    AttributeError: 'NoneType' object has no attribute 'encode'

This solves that by checking at the beginning of get_preview() that
`file.realpath` is not None, and returning early if it is None.
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions
010-04-01 18:47:06 +0200 committer hut <hut@lavabit.com> 2010-04-01 18:47:06 +0200 reverted a part of 45cf5174. Allow "source ranger ranger" again' href='/akspecs/ranger/commit/ranger.py?h=v1.9.3&id=8fa8705476d5023083bc27a3fddaee8402ac94e5'>8fa87054 ^
a66c4a26 ^
8fa87054 ^
a2853ab6 ^




8fa87054 ^


a66c4a26 ^

f027adc0 ^
b289f679 ^

5c210a96 ^

3de15ddd ^

fb275079 ^

5c210a96 ^
3d566884 ^
e30d16cb ^
621a1a39 ^
c44b726e ^
465bff73 ^




f8e96a97 ^
b289f679 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56