Move from optparse to argparse
See original GitHub issueThe optparse module has been deprecated since 3.2
in lieu of argparse.
At the time of this writing, we only have 3 modules that use it directly:
- https://github.com/scrapy/scrapy/blob/master/scrapy/cmdline.py
- https://github.com/scrapy/scrapy/blob/master/scrapy/commands/__init__.py
- https://github.com/scrapy/scrapy/blob/master/tests/test_commands.py
I’m filing this ticket to keep track of this task. In addition there were several attempts on this in the past that hasn’t pushed through:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Converting optparse to argparse - python
Fire up an interactive shell, define a couple of parsers, and play with the different arguments. And of course print the outputs ('opts','args', ......
Read more >Migration to argparse from optparse #5392 - PyCQA/pylint
To do this I think it makes the most sense to do some initial preparation, namely convert all options to a new class...
Read more >Easily Convert Optparse to Argparse Python - YouTube
Optparse is deprecated, learn how to switch to argparse (which is the standard) with minimal code edits. This is useful for legacy projects ......
Read more >optparse — Parser for command line options
When optparse sees the option string -f , it consumes the next argument, foo.txt , and stores it in options.filename . So, after...
Read more >441 Move from "optparse" to "argparse". - Docutils
Deprecated since version 3.2: The optparse module is deprecated and will not be developed further; development will continue with the argparse ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kawishqayyum @LusiferAjay you don’t need a permission to work on any issue
I created a pull request #5382 to solve this. It is very similar to #5374 above but this commit solves the issue in scrapy/commands/view.py where “–header” option is to be removed. Still need an admin to approve workflows for codecov to run coverage tests. This is my first commit to open source and look forward to hearing any feedback. Thanks.