diff --git a/backtrader/writer.py b/backtrader/writer.py
index <HASH>..<HASH> 100644
--- a/backtrader/writer.py
+++ b/backtrader/writer.py
@@ -171,7 +171,7 @@ class WriterFile(WriterBase):
             if recurse:
                 kline += '- '
 
-            kline += key + ':'
+            kline += str(key) + ':'
 
             try:
                 sclass = issubclass(val, LineSeries)
Addresses #<I> - writer fails with analyzers that have keys which are not strings