All Questions
4,336 questions
0
votes
0
answers
69
views
How can I use a file .txt to store some passwords for many programs in python?
I have a file called password.txt and I want to store some passwords in it, I use it in a file of functions but I don't know how to make it usable for more than one file, every one having his specific ...
0
votes
0
answers
47
views
Encoding problems with pytest
I have an error asserting equality between two string due to non-ASCII characters.
I am getting the table of contents (toc) of a PDF[1] with mymupdf.get_toc() function.
For the unit testing, I have ...
0
votes
2
answers
71
views
Replacing literal '\uxxxx' in string with corresponding unicode character
I don't want to convert things like \n \r so I can't use unicode_escape directly.
But my code is very slow now, is there any better way?
def only_transform_backslash_u(content):
...
0
votes
1
answer
37
views
Pyasn1 enumerated type encodes as hex, how do I get decimal
I'm trying to code the following using pyasn1
From RFC7906
KeyPurpose ::= ENUMERATED {
n-a (0), -- Not Applicable
A (65), -- Operational
B (66), -- Compatible Multiple Key
...
0
votes
0
answers
60
views
Files encoding changes after mounting to docker-container
The essence of the problem: when connecting via ssh to docker container with a Python environment, all files mounted in it are processed in ASCII encoding for some reason. The files themselves have ...
0
votes
0
answers
25
views
Understanding snn coding (bindsnet)
For the case of using bindsnet encoding methods, can someone please explain the particularities for the case it's needed to encode a 1d simple vector, for example using:
import torch
from bindsnet....
0
votes
1
answer
30
views
Parsing of CSV-File leads to "NBSP" and "SPA" Characters in Windows
I am parsing a CSV document to write a specification in SysML v2, which is essentially just a simple text file.
Parsing it on Linux I get the result I desire. I use a SysOn-Docker to display my SysML ...
0
votes
2
answers
76
views
FastAPI or sqlachemy error encoding in python [closed]
I've made a website with sqlachemy, fastAPI and postgresql in python.
The error is raised when I try to login as a user.
For information, I get the password and the email from an HTML/JS form and my ...
0
votes
2
answers
125
views
Loading Json file in to Python "UnicodeDecodeError ... invalid continuation byte"
I am new to Python/Json. My end goal is to load a json file. From the json file info I want to get it into a database.
My thought is to bring the json file in to python and save it as a dictionary.(I'...
0
votes
0
answers
56
views
How to set PTS value to .mp4 video frames without losing video quality
I have searched for a solution to this problem for a while now, and tried many different approaches without any success.
I have an .mp4 video (no audio) in 30Hz along with a text file timestamps.txt ...
2
votes
2
answers
75
views
os.device_encoding changes when called from a subprocess, causing decoding error on Windows. How to force encoding in subprocess?
I have the following Python 3.7 code in an imported package, not modifiable by myself, that reads and decodes the systems CCompiler name provided by disttools:
subproc.py
import os
import sys
import ...
0
votes
1
answer
50
views
Binary file base64 encode in js and decode in python
I want save an excel file as json in database. It is then downloaded in the python backend later on to create the excel file.
My frontend to save excel file as json:
const fileReader: FileReader ...
0
votes
0
answers
77
views
Python: weird characters in extract_message
I use extract_message from pypi.org/project/extract-msg package to extract outlook messages. It works well until this outlook file causes the error message. I found out that the problem is that the ...
1
vote
2
answers
71
views
How to Handle Both Encoding and Decoding with Custom Error Handler in Python?
I'm working on a scenario where I need to handle encoding and decoding of strings using custom error handling in Python. Specifically, I want to create an error handler that can deal with both ...
-1
votes
1
answer
268
views
How to parse Word files with Hindi text in KrutiDev font using Python in json
I'm trying to parse Word files .docx that contain Hindi text written in the KrutiDev 010 font.
When I process the text using Python and try to encode it into JSON, I get random gibberish instead of ...