Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix >> decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 445: character maps to #79

Open
EngAshDev opened this issue Apr 28, 2024 · 5 comments

Comments

@EngAshDev
Copy link

EngAshDev commented Apr 28, 2024

env> windows 11/ conda / python 3.6 / az 1.3.1 /
used > az -n 10 -d 2015-12-11: -s :3000000 -m play.google.com,appchina
& az -n 1 -d 2020-01-01: -s :5000000 -t 6 -m play.google.com,appchina,PlayDrone
with latest.csv got this error >>

Traceback (most recent call last):
File "C:\Users\anaconda3\envs\az1\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\anaconda3\envs\az1\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\anaconda3\envs\az1\Scripts\az.exe_main
.py", line 7, in
File "C:\Users\anaconda3\envs\az1\lib\site-packages\click\core.py", line 722, in call
return self.main(*args, **kwargs)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\main.py", line 52, in run
az.run(input_file, key, number, criteria, out_dir=out if out else os.getcwd(), metadata=metadata, seed=seed, threads=threads)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\az.py", line 18, in run
random_subset = RandomPicker(seed=seed).get_random_subset(dataset, number)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\services\random_picker.py", line 18, in get_random_subset
for num, apk in enumerate(input_dataset, 1):
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\entities\dataset\filtered_dataset.py", line 27, in next
apk = next(self.source)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\entities\source.py", line 20, in next
line = next(self.reader)
File "C:\Users\anaconda3\envs\az1\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 445: character maps to

used > az -n 10 -d 2015-12-11: -s :3000000 -m play.google.com,appchina
& az -n 1 -d 2020-01-01: -s :5000000 -t 6 -m play.google.com,appchina,PlayDrone
with latest_with-added-date.csv got this error >>
Traceback (most recent call last):
File "C:\Users\anaconda3\envs\az1\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\anaconda3\envs\az1\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\anaconda3\envs\az1\Scripts\az.exe_main
.py", line 7, in
File "C:\Users\anaconda3\envs\az1\lib\site-packages\click\core.py", line 722, in call
return self.main(*args, **kwargs)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\main.py", line 52, in run
az.run(input_file, key, number, criteria, out_dir=out if out else os.getcwd(), metadata=metadata, seed=seed, threads=threads)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\az.py", line 18, in run
random_subset = RandomPicker(seed=seed).get_random_subset(dataset, number)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\services\random_picker.py", line 18, in get_random_subset
for num, apk in enumerate(input_dataset, 1):
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\entities\dataset\filtered_dataset.py", line 23, in next
apk = next(self.source)
File "C:\Users\anaconda3\envs\az1\lib\site-packages\modules\entities\source.py", line 24, in next
return Apk(*line)
TypeError: init() takes from 1 to 12 positional arguments but 13 were given

thanks in advance

@EngAshDev EngAshDev changed the title return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 445: character maps to <undefined> need your help guys Apr 28, 2024
@EngAshDev
Copy link
Author

im getting the same error , but i tried diffrent version of Latest.csv
one gave me this error {{ return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 6662: character maps to }}
the othere one gave me {{ return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 445: character maps to }}

@EngAshDev
Copy link
Author

im using conda env / python 3.6 / az 1.3.1
i also tried az 1.3.0 / 1.2.2 / python 3.6
but still no luck!

@EngAshDev
Copy link
Author

i tried also this
click==8.0.0
setuptools==65.5.1
python_dateutil==2.8.2
PyYAML==6.0
requests==2.27.1
with python = 3.7
no luck!
keep getting the same error
one gave me this error {{ return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 6662: character maps to }}
the othere one gave me {{ return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 445: character maps to }}

@EngAshDev
Copy link
Author

found a fix to my problem
in modules/entities/source.py
just replace whats inside this file with this
{{{
from modules.entities.apk import Apk
from modules.entities.entity import Entity
import csv

class Source(Entity):
def init(self, input_file=None):
if isinstance(input_file, str):
self.input_file = open(input_file, 'r', encoding='utf-8', errors='ignore') # Open in text mode
else:
self.input_file = input_file

    self.reader = csv.reader(self.input_file)
    next(self.reader)  # skip header

def __iter__(self):
    return self

def __next__(self):
    try:
        line = next(self.reader) 
        return Apk(*line)
    except StopIteration: 
        self.input_file.close()
        raise StopIteration

def _key(self):
    pass

}}}
this should bypass the unicode error and starts downloading the apks

@EngAshDev
Copy link
Author

then rebuild az and pip install it

@EngAshDev EngAshDev changed the title need your help guys fix >> decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 445: character maps to Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant