Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A backport of fstrings to python<3.6.
pip install future-fstrings
Include the following encoding cookie at the top of your file (this replaces the utf-8 cookie if you already have it):
# -*- coding: future_fstrings -*-
And then write python3.6 fstring code as usual!
# -*- coding: future_fstrings -*-
thing = 'world'
print(f'hello {thing}')
$ python2.7 main.py
hello world
future-fstrings
also includes a cli to show transformed source.
$ future-fstrings-show main.py
# -*- coding: future_fstrings -*-
thing = 'world'
print('hello {}'.format((thing)))
The future-fstrings-show
command can be used to transform source before
distributing. This can allow you to write f-string code but target platforms
which do not support f-strings, such as micropython.
To use this on modern versions of python, install using:
pip install future-fstrings[rewrite]
and then use future-fstrings-show
as above.
For instance:
future-fstrings-show code.py > code_rewritten.py
future-fstrings
has two parts:
codec
which performs source manipulation
codec
first decodes the source bytes using the UTF-8 codeccodec
then leverages
tokenize-rt to rewrite
f-strings..pth
file which registers a codec on interpreter startup.FAQs
A backport of fstrings to python<3.6
We found that future-fstrings demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.