-
Notifications
You must be signed in to change notification settings - Fork 81
Add errors param to $lib.axon.readlines (SYN-6359) #3395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
synapse/lib/stormtypes.py
Outdated
''', | ||
'type': {'type': 'function', '_funcname': 'readlines', | ||
'args': ( | ||
{'name': 'sha256', 'type': 'str', 'desc': 'The SHA256 hash of the file.'}, | ||
{'name': 'errors', 'type': 'str', 'default': None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably make this default to "ignore" ( or at least "surrogatepass") so the intuitive thing happens. ( both here and in the python/telepath API )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I left it as none because we had a test for the current behavior but I agree ignore/surrogatepass makes more sense as the default.
synapse/lib/stormtypes.py
Outdated
if not self.runt.allowed(('axon', 'get')): | ||
self.runt.confirm(('storm', 'lib', 'axon', 'get')) | ||
await self.runt.snap.core.getAxon() | ||
|
||
sha256 = await tostr(sha256) | ||
async for line in self.runt.snap.core.axon.readlines(sha256): | ||
async for line in self.runt.snap.core.axon.readlines(sha256, errors=errors): | ||
yield line | ||
|
||
async def jsonlines(self, sha256): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
csvrows and jsonlines probably need this option too
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3395 +/- ##
==========================================
- Coverage 97.31% 97.20% -0.12%
==========================================
Files 231 231
Lines 46966 46966
==========================================
- Hits 45707 45654 -53
- Misses 1259 1312 +53
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
No description provided.