Comments (7)
Hi @mjohnson767, thank you for reporting the problem!
This might be related to running on Windows, as I can't seem to be able to reproduce the problem on Linux:
$ curl -LO https://github.com/zalando-incubator/transformer/files/4372250/ppmi_v2.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 576 100 576 0 0 3490 0 --:--:-- --:--:-- --:--:-- 3490
100 2155k 100 2155k 0 0 840k 0 0:00:02 0:00:02 --:--:-- 1113k
$ unzip ppmi_v2.zip
Archive: ppmi_v2.zip
inflating: ppmi_v2.har
$ pipx run --spec har-transformer transformer --version
1.2.6
$ pipx run --spec har-transformer transformer ppmi_v2.har >test.py
2020-03-24 14:08:27,804 INFO No ppmi_v2.weight provided for ppmi_v2.har: assigning default weight 1 ([Errno 2] No such file or directory: 'ppmi_v2.weight')
$ head test.py
# File automatically generated by Transformer v1.2.6:
# https://github.com/zalando-incubator/Transformer
import re
from locust import HttpLocust
from locust import TaskSequence
from locust import TaskSet
from locust import seq_task
from locust import task
class ppmi_v2_har_829294038(TaskSequence):
@seq_task(1)
Here is the full test.py
that was produced: test.py.zip.
I'll try again on Windows as soon as I can, but I don't have a development environment there, so that might take some time. If you have any more clues, I'll gladly hear about them!
Have a nice day!
from transformer.
hi, Same here, har file was stored on windows with google chrome.
With running "transformer file.har > file.py" i see an error with decoding.
Traceback (most recent call last):
File "[MASKED]\lib\site-packages\transformer\scenario.py", line 316, in from_har_file
har = json.load(file)
File "[MASKED]\python39\lib\json_init_.py", line 293, in load
return loads(fp.read(),
File "[MASKED]\python39\lib\encodings\cp1250.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 251566: character maps to
from transformer.
as workaround i have modified locally:
In:
@classmethod
def from_har_file
...
try:
with path.open(encoding="utf8") as file:
And file was generated properly
from transformer.
I've installed har-transformer via pip; is the change needed in the actual har-transformer.har file?
Can you provide the steps to fix?
Great find.
from transformer.
Hi @mjohnson767, actually you need to do modification in your package installed in python directory.
[your python directory] \lib\site-packages\transformer\scenario.py
Find mentioned file and modify the file line as mentioned above. Nothing more is needed.
Then try to run transformer.
This is workaround only to point where is the issue.
Fix is needed from transformer team as requires some more coding to be bulletproof :)
from transformer.
I believe this should be addressed by #79, i.e. v2.0.0. Please let me know if that is not the case. 🙂
from transformer.
Hi @thilp
Getting this error for fiddler generated .har files:
WARNING while searching for HAR files, skipping {file_name}: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
Thanks to the comments I was able to fix it locally by changing
encoding="utf-8"
to encoding="utf-8-sig"
inside
def from_har_file
...
try:
with path.open(encoding="utf-8-sig") as file:
This is just an FYI in case others want to fix it
Awesome tool btw!
from transformer.
Related Issues (20)
- Expose all HAR "entry" fields in each corresponding Task2 instance HOT 6
- Replace our homegrown plugin system with pluggy
- Transformer crashes on our example HAR files
- In the documentation, links to compare releases are broken HOT 2
- Har files containing PATCH http requests make transformer crash HOT 1
- Impossible to use plugins following cli documentation HOT 4
- Move tests to a separate directory
- Invalid Sequential Taskset HOT 1
- Invalid locustfile created when transforming a HAR without an associated weight file HOT 5
- Exported HAR works in 0.14.6 but not 1.0.0-1.0.2, cannot import name 'TaskSequence' HOT 9
- Unable to generate the locust file in Windows system
- Got an Error when transforming a HAR file generated for an Angular Application
- Getting error while running the HAR file using CLI HOT 6
- Could not convert HAR using library HOT 1
- Make .urlignore ignore based on whole URL instead of just hostname HOT 2
- Drop support for Locust 0.x, and make use of SequentialTaskSet optional, etc
- Enable making editable installations
- Plugin hook for final text HOT 1
- error when transform from har to py using command line HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transformer.