foliant-docs / foliant

Comprehensive markdown-based documentation toolkit
https://foliant-docs.github.io/docs/
MIT License
160 stars 9 forks source link

foliantcontrib.confluence - RuntimeError: Build failed: 'NoneType' object has no attribute 'encode' #73

Closed laual closed 10 months ago

laual commented 10 months ago

Hi,

On windows when running foliant make confluence, a couple exceptions were raised which are probably related to encoding of read and write to file. I remain with this exception.

Traceback (most recent call last):
  File "C:\Users\P12075\AppData\Local\Programs\Python\Python310\lib\site-packages\foliant\backends\confluence\confluence.py", line 262, in make
    return self._build()
  File "C:\Users\P12075\AppData\Local\Programs\Python\Python310\lib\site-packages\foliant\backends\confluence\confluence.py", line 203, in _build
    result.append(uploader.upload(md_source))
  File "C:\Users\P12075\AppData\Local\Programs\Python\Python310\lib\site-packages\foliant\backends\confluence\uploader.py", line 147, in upload
    self.page.upload_content(new_content, title, minor_edit)
  File "C:\Users\P12075\AppData\Local\Programs\Python\Python310\lib\site-packages\foliant\backends\confluence\wrapper.py", line 316, in upload_content
    self.update_hash(new_content, title)
  File "C:\Users\P12075\AppData\Local\Programs\Python\Python310\lib\site-packages\foliant\backends\confluence\wrapper.py", line 325, in update_hash
    'value': self._calculate_hash(content, title)
  File "C:\Users\P12075\AppData\Local\Programs\Python\Python310\lib\site-packages\foliant\backends\confluence\wrapper.py", line 177, in _calculate_hash
    _hash.update(title.encode())
AttributeError: 'NoneType' object has no attribute 'encode'

Could you help me out? Thanks, Laurent

laual commented 10 months ago

Everything solved by installing and running foliant in MSYS2. Probably the default encoding on Windows messing with me.