Skip to content

Python 3.10 alpha 7 introduces new changes to pathlib #4

@alexdelorenzo

Description

@alexdelorenzo

The following works on alpha 6 and below, but alpha 7 introduces this error:

In [1]: from aiopath import AsyncPath                                                                                                                                  
                                                                                                                                                                       
In [2]: home = await AsyncPath.home()                                                                                                                                  
---------------------------------------------------------------------------                                                                                            
TypeError                                 Traceback (most recent call last)                                                                                            
<ipython-input-2-ef16332cd56b> in <module>                                                                                                                             
----> 1 home = await AsyncPath.home()                                                                                                                                  
                                                                                                                                                                       
~/.pyenv/versions/3.10-dev/lib/python3.10/site-packages/aiopath/path.py in home(cls)                                                                                   
    391     returned by os.path.expanduser('~')).                                                                                                                      
    392     """                                                                                                                                                        
--> 393     coro = cls()._flavour.gethomedir(None)                                                                                                                     
    394     homedir: str = await coro                                                                                                                                  
    395                                                                                                                                                                
                                                                                                                                                                       
~/.pyenv/versions/3.10-dev/lib/python3.10/site-packages/aiopath/path.py in __new__(cls, *args, **kwargs)                                                               
    133       cls = AsyncWindowsPath if os.name == 'nt' else AsyncPosixPath                                                                                            
    134 
--> 135     self = cls._from_parts(args, init=False)
    136 
    137     if not self._flavour.is_supported:

TypeError: PurePath._from_parts() got an unexpected keyword argument 'init'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions