Skip to content

Code Quality, Unicode Safe Read #11

Open
@ajinabraham

Description

@ajinabraham

Lot of places have open file pointers like
https://github.com/torque59/Nosql-Exploitation-Framework/blob/master/dbattacks/utils.py#L116
close all the file pointers after use.
This will save memory.

Also replace open with io.open which is unicode safe.
usingwith will handle file pointers efficiently and you don't have to close them explicitly.

example code

with io.open(file_path, mode='r', encoding="utf8", errors="ignore") as f:
     dat = f.read()

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions