parseListOfPoints sometimes has empty "nums"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Scour |
Fix Released
|
Undecided
|
Patrick Storz |
Bug Description
I get the following traceback
```
scour.py -i lib/images/
Traceback (most recent call last):
File "/home/
out_string = scourString(
File "/home/
cleanPolygo
File "/home/
pts = parseListOfPoin
File "/home/
prev = nums[len(nums)-1]
IndexError: list index out of range
```
and the following fixes it
```
diff scour-fixed.py scour.py
2136,2141c2136,2138
< if len(nums) > 0:
< prev = nums[len(nums)-1]
< if prev[len(prev)-1] in ['e', 'E']:
< nums[len(nums)-1] = prev + '-' + negcoords[j]
< else:
< nums.append( '-'+negcoords[j] )
---
> prev = nums[len(nums)-1]
> if prev[len(prev)-1] in ['e', 'E']:
> nums[len(nums)-1] = prev + '-' + negcoords[j]
```
cynthia@alakazam ~/scour/scour$ ./scour.py -i ~/temp/ cover-chapter- 2.svg -o ~/temp/ cover-chapter- 2.opt.svg --remove-metadata --quiet temp/cover- chapter- 2.opt.svg temp/cover- chapter- 2.svg
cynthia@alakazam ~/scour/scour$ ./scour.py --version
0.26
cynthia@alakazam ~/scour/scour$ ls -la ~/temp/cover*
-rw-rw-r-- 1 cynthia cynthia 26918 Nov 6 13:55 /home/cynthia/
-rw-rw-r-- 1 cynthia cynthia 32477 Nov 6 13:53 /home/cynthia/
I'm not positive this bug still occurs. What version of Scour are you running, and is it the latest code in the Bazaar repository? (See Code, above in Launchpad, to know how to get the code freom Bazaar.)