Page 1 of 2
Problems with importing libraries.
Posted: 24.03.2018 1:25
by Seinken
import pymysql
will return
Code: Select all
ValueError: source code string cannot contain null bytes
Originally, I thought source had null bytes. Looking in Notepad++ and regex replace null byte does not resolve the issue. Is there a problem with importlib machinery?
Re: Problems with importing libraries.
Posted: 24.03.2018 12:28
by nah nah
try to
from py_stealth import * or from py_stealth import py_stealth
and launch your script not through the stealth.
what is a python version you are using?
Re: Problems with importing libraries.
Posted: 24.03.2018 15:28
by Seinken
3.6, i will try that in another IDE.
This error only happens when I run a script inside stealth.
Re: Problems with importing libraries.
Posted: 25.03.2018 13:00
by Seinken
Tested in PyCharm, script loads fine. Any idea why I get the error in Stealth?
Re: Problems with importing libraries.
Posted: 25.03.2018 15:30
by nah nah
it the problem is in py34.py. Not a correct modify of the python import system. i will fix soon
Re: Problems with importing libraries.
Posted: 27.03.2018 7:29
by Seinken
I have updated to 8.7.4, and now, no python executes.
print('test') == no console result, only 'Found Python Version'
Re: Problems with importing libraries.
Posted: 27.03.2018 10:55
by nah nah
what py version, 32 or 64,
what filename? if it is test.py - this should not works, cause python have test module in standart library
Re: Problems with importing libraries.
Posted: 27.03.2018 12:54
by Seinken
https://i.imgur.com/d5x340z.png
Figure a picture says more than words.
Py version 64 bit, testing.py.
Re: Problems with importing libraries.
Posted: 27.03.2018 14:35
by nah nah
python x64, but 32 was found
if you use the stealth code editor, you need to define an ansi encoding.
try
this
Re: Problems with importing libraries.
Posted: 27.03.2018 17:00
by Seinken
Now python works, but print is cutting characters off
print('test') = return 'est'
Re: Problems with importing libraries.
Posted: 27.03.2018 17:32
by nah nah
show me your py_stealth\_datatypes.py line:65
Re: Problems with importing libraries.
Posted: 27.03.2018 20:04
by Seinken
Re: Problems with importing libraries.
Posted: 27.03.2018 20:23
by nah nah
hm... it must works fine. with those stealth and py_stealth packet it must works fine, without missing symbol. by the way, you can use AddToSystemJournal instead print function. it will fix the empty line after using a print.
for example
Code: Select all
print = AddToSystemJournal
print(1, '2', [3], key1='value', sep='my separator', end='end of line')
Re: Problems with importing libraries.
Posted: 29.03.2018 12:46
by Seinken
Even changing function print to addtosystemjournal has the missing character problem, additionally now tracebacks will not show where the error occured.
Re: Problems with importing libraries.
Posted: 29.03.2018 14:48
by nah nah
its not pythonic way to use scripts from stealth. this was added for supporting a old and simple pyhin scripts. but anyway, it does not work. will fix this, but you should use external scripts