Allow readline.__file__ to be missing
See original GitHub issueSee indygreg/PyOxidizer#69 for more info about why, but the tl;dr version is __file__ is an optional attribute and should not be relied upon.
Currently cmd2 fails under PyOxidizer with:
File "cmd2", line 15, in <module>
File "cmd2.cmd2", line 56, in <module>
File "cmd2.rl_utils", line 120, in <module>
AttributeError: module 'readline' has no attribute '__file__'
If sys.oxidized is set, and readline is imported (and isnt libedit), then any symbols needed are in the binary, if that is helpful.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
First line of the file is missing while reading - Stack Overflow
this iterates on the lines of the file, and inside the loop you read the whole file! The fact that the first line...
Read more >Reading file data with PowerShell - SQLShack
The ReadLine() method reads the current line of the file, which in this case is the first line. Since we told the StreamReader...
Read more >The Missing Readline Primer - zwischenzugs
First you're going to see what bash looks like without readline. ... That's because bash normally has an 'autocomplete' function that allows you ......
Read more >How To Work with Files Using Streams in Node.js - DigitalOcean
Streams are an efficient way to handle files in Node.js. In this tutorial, you'll create a command-line program, and then use it with ......
Read more >Read a file line by line - Rosetta Code
Read a file one line at a time, as opposed to reading the entire file at once. Related tasks Read a file character...
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 Free
Top 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

@jayvdb Here are the symbols we use from the readline.so file.
@kmvanbrunt If we do this, I think we should do it in a fairly generic and robust fashion where there is a degraded mode in which we have access to the normal Python
readlinepackage functionality but do not have access to the extended functionality for which we are usingctypesto directly call functions in thereadlinedynamic library which are not wrapped by Python’sreadlinepackage. There should also be a good warning message printed in yellow upon startup of acmd2application functioning in this degraded mode notifying the user that this is happening. Moreover, the Sphinx docs should be updated to explain what features are not available in this degraded mode. This degraded mode shouldn’t be exclusive toPyOxidizer.We may also wish to submit a feature request and/or PR to CPython for wrapping the missing functionality which is necessitating our usage of
ctypes.