Skip to content

Conversation

@francisg-gc
Copy link

This pull request fixes #404

I remembered to:

  • Update or add unit tests if needed
  • Update or add documentation/comments if needed
  • Made sure stray files or whitespace didn't get committed
  • If significant changes, branch from develop and set to merge into develop
  • Read the guidelines for contributing

Changes:

  • async is now a reserved word :(
  • changed 1 line in wpull/driver/process.py calling asyncio.async to using an internal name _async using getattr

@makew0rld
Copy link

makew0rld commented Mar 1, 2020

When running this with Python 3.8.1, I get this error:

❯ wpull --version                                                                
Traceback (most recent call last):
  File "/home/makeworld/.local/bin/wpull", line 11, in <module>
    load_entry_point('wpull==2.0.3', 'console_scripts', 'wpull')()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/makeworld/.local/lib/python3.8/site-packages/wpull/application/main.py", line 4, in <module>
    from wpull.application.builder import Builder
  File "/home/makeworld/.local/lib/python3.8/site-packages/wpull/application/builder.py", line 12, in <module>
    from wpull.application.tasks.download import ProcessTask, ParserSetupTask, ClientSetupTask, ProcessorSetupTask, \
  File "/home/makeworld/.local/lib/python3.8/site-packages/wpull/application/tasks/download.py", line 10, in <module>
    from wpull.processor.coprocessor.phantomjs import PhantomJSParams
  File "/home/makeworld/.local/lib/python3.8/site-packages/wpull/processor/coprocessor/phantomjs.py", line 19, in <module>
    from wpull.driver.phantomjs import PhantomJSDriverParams, PhantomJSDriver
  File "/home/makeworld/.local/lib/python3.8/site-packages/wpull/driver/phantomjs.py", line 17, in <module>
    PhantomJSDriverParams = namedlist.namedtuple(
  File "/home/makeworld/.local/lib/python3.8/site-packages/namedlist.py", line 450, in namedtuple
    type_dict = {'__new__': _make_fn('__new__', _nt_new, fields, defaults),
  File "/home/makeworld/.local/lib/python3.8/site-packages/namedlist.py", line 180, in _make_fn
    code = compile(module_node, '<string>', 'exec')
TypeError: required field "posonlyargs" missing from arguments

Maybe this StackOverflow question can help?

self._stderr_reader = asyncio.async(self._read_stderr())
self._stdout_reader = asyncio.async(self._read_stdout())
_async=getattr(asyncio, 'async')
self._stderr_reader = _async(self._read_stderr())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the right way to do this is self._stderr_reader = asyncio.ensure_future(self._read_stderr())

@trixmoe
Copy link

trixmoe commented Jun 6, 2025

would be great if something newer than python 3.5 (latest is 3.5.10 released in 2015? 10-year old python at this point) was supported

@mweinelt mweinelt mentioned this pull request Jun 8, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python 3.7 compatibility

4 participants