KeyviDev/keyvi

No errors from `WriteToFile` when output path contains non existent folder

Closed this issue · 0 comments

Describe the bug
When you call WriteToFile and specify output path with folder that doesn't exists, WriteToFile silently do nothing

To Reproduce

import os
import keyvi.compiler


c = keyvi.compiler.JsonDictionaryCompiler()
c.Add(b'1', b'123')
c.Compile()

output_path = '/tmp/thispathdoesntexists/test.kv'
c.WriteToFile(output_path)

assert os.path.exists(output_path)  # will fail, because file doesn't exists

Expected behavior

Exception on WriteToFile