Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Kakakuona Forum

  1. Home
  2. General Discussion
  3. Twisted has a new version which causes failure #SYNAPSE

Twisted has a new version which causes failure #SYNAPSE

Scheduled Pinned Locked Moved General Discussion
1 Posts 1 Posters 29 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • darwinD Offline
    darwinD Offline
    Darwin Kingáni
    wrote on last edited by darwin
    #1
    Error Message: AttributeError: 'Headers' object has no attribute '_encodeName'

    Workaround: Replace this code: [ Mine was from here: synapse-3.8/env/lib/python3.8/site-packages/synapse/http/proxy.py line 72 ]

    if hasattr(Headers, "_canonicalNameCaps"):                                      
        # Twisted < 24.7.0rc1                                                       
        _canonicalHeaderName = Headers()._canonicalNameCaps  # type: ignore[attr-defined]                                                                           
    else:                                                                           
        # Twisted >= 24.7.0rc1                                                      
        # But note that `_encodeName` still exists on prior versions,               
        # it just encodes differently                                               
        _canonicalHeaderName = Headers()._encodeName 
    
    

    With this:

    def _canonicalHeaderName(name):                                                 
        if isinstance(name, unicode):                                               
            return name.lower().encode('iso-8859-1')                                
        return name.lower() 
    
    

    ICTO

    1 Reply Last reply
    0

    • Login

    • Don't have an account? Register

    Powered by NodeBB Contributors
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups