Skip to content

Python 3 - Allow ScryptFile mode 'r' as long as underlying file is 'rb'. #4

@ricmoo

Description

@ricmoo

Just an idea for a future enhancement.

Basically on Python 3, the binary file must be opened with the 'rb' mode and I check that the ScryptFile mode matches the file pointer mode.

Since Python 3 makes a distinction between what things like read() return, (bytes for 'rb', strings for 'r') it would be convenient to have the underlying file object opened as 'rb' (which it must be, since the encrypted file is binary) but specify the ScryptFile mode as 'r'. Then read could perform whatever text conversion the built-in file object performs in the case of 'r' vs 'rb'.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions