Comments (11)
from lsl-pyoptimizer.
Sure thing
macOS Mojave 10.14.6
Python 2.7.16
Traceback (most recent call last):
File "/GitHub/LSL-PyOptimizer/main.py", line 782, in <module>
ret = main(sys.argv)
File "/GitHub/LSL-PyOptimizer/main.py", line 745, in main
script = script_header + script_timestamp + outs.output(ts, options)
File "/GitHub/LSL-PyOptimizer/lslopt/lsloutput.py", line 556, in output
ret += self.OutCode(node)
File "/GitHub/LSL-PyOptimizer/lslopt/lsloutput.py", line 504, in OutCode
ret += self.OutCode(stmt)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2896: ordinal not in range(128)
LANG="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_CTYPE="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_ALL=
What do you mean with "encoding of your script"?
from lsl-pyoptimizer.
from lsl-pyoptimizer.
Yes, it's UTF-8.
And indeed I am using (few) non-ASCII char's. There are passages like this:
list replace = ["<","<",">",">","&rt;",">",""e;","\"",""","\"","&","&","¢","¢","£","£","¥","¥","€","€","©","©","®","®","'","'"];
and passages like this:
msg = "*❮ [" + legacy_name + "](https://my.secondlife.com/" + legacy_name_dots +")*";
I can try to comb through them, and see what happens.
from lsl-pyoptimizer.
Unfortunately, that didn't solved the problem. I replaced every non-ascii character with llChar(xxxx) and ran the code through https://pages.cs.wisc.edu/~markm/ascii.html to find any non-ascii left over. The code is clean, the error message the same:
Traceback (most recent call last):
File "/GitHub/LSL-PyOptimizer/main.py", line 782, in <module>
ret = main(sys.argv)
File "/GitHub/LSL-PyOptimizer/main.py", line 745, in main
script = script_header + script_timestamp + outs.output(ts, options)
File "/GitHub/LSL-PyOptimizer/lslopt/lsloutput.py", line 556, in output
ret += self.OutCode(node)
File "/GitHub/LSL-PyOptimizer/lslopt/lsloutput.py", line 504, in OutCode
ret += self.OutCode(stmt)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2917: ordinal not in range(128)
from lsl-pyoptimizer.
from lsl-pyoptimizer.
oh, okay - well, since we assume it's the non-ASCII characters, a test case might be easy to put together
from lsl-pyoptimizer.
OK, this is the maximum stripped down that still fails:
list visitor_list_new;
list visitor_list_pos_old;
key owner;
key mygroup;
float xRight;
float xLeft;
float yNear;
float yFar;
float zLow;
float zHigh;
encode_and_send(string msg, key thisAvKey)
{
integer msg_length;
}
key getAvatarGroup (key inAvatar)
{
key result = NULL_KEY;
return (result);
}
default
{
state_entry()
{
mygroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);
}
timer()
{
string msg;
string legacy_name;
string legacy_name_dots;
integer numberOfKeys;
integer i;
key thisAvKey;
vector agentpos;
for (i = 0; i < numberOfKeys; ++i) {
thisAvKey = llList2Key(visitor_list_new,i);
if (TRUE) {
agentpos = llList2Vector(llGetObjectDetails(thisAvKey, [OBJECT_POS]),0);
// and break it down to x-y-z
float avatarx = agentpos.x;
float avatary = agentpos.y;
float avatarz = agentpos.z;
if ((avatarx <= xRight && avatarx >= xLeft && avatary <= yFar && avatary >= yNear && avatarz <= zHigh && avatarz >= zLow) && (getAvatarGroup(thisAvKey) == mygroup)) {
}
}
}
if (TRUE) {
for (i = 0; i < numberOfKeys; i = i + 2) {
if (TRUE) {
thisAvKey = llList2Key(visitor_list_pos_old,i);
legacy_name = llKey2Name(thisAvKey);
if (legacy_name != "") {
if (TRUE) {
msg = "*" + llChar(0x276E) + " [" + legacy_name + "](https://my.secondlife.com/" + legacy_name_dots +")*";
encode_and_send(msg, thisAvKey);
}
}
}
}
}
}
}
from lsl-pyoptimizer.
from lsl-pyoptimizer.
Yep, the new version works without any error message, and produces the expected output. Thank you very much!
For laymen: What was the issue?
from lsl-pyoptimizer.
nvm, found the commit and the explanation
from lsl-pyoptimizer.
Related Issues (20)
- Online version, handling HOT 3
- Inconsistent replacement of NULL_KEY with "" HOT 2
- Setup pre-compiled binaries for different platforms [Enhancement] HOT 3
- Combined lists getting incorrectly spliced HOT 2
- Jump statements with default returns delete the required return value HOT 2
- Provide Python Packaging Information HOT 3
- Integration with Firestorm preprocessor conditional defines HOT 2
- Some float<->string conversions return incorrect results or raise an exception HOT 5
- --postarg is ignored HOT 1
- `integer global=other_global;` raises KeyError when ConstFold is disabled HOT 4
- llChar optimization causing generic lexer error HOT 10
- Avoid defining unnecessary variables while inlining HOT 1
- Concatenate constant strings produces duplicate results HOT 1
- Subtraction replaced by addition of a negative value HOT 6
- AGENT_AUTOMATED constant is missing... HOT 1
- New LSL commands missing HOT 2
- Update needed for PBR and other 2023 LSL Additions. HOT 6
- Dead Code Removal does not remove all dead code HOT 4
- MemoryError in online version 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 lsl-pyoptimizer.