Giter VIP home page Giter VIP logo

Comments (15)

blueyed avatar blueyed commented on July 18, 2024

The error appears to come from /usr/share/lua/5.2/lgi/override/cairo.lua:673.

Can you paste it and its surrounding context?
Does commenting it fix or improve/change the issue for you? (as a workaround)

from awesome.

TaylanTatli avatar TaylanTatli commented on July 18, 2024
   if cairo.version >= (info.since or 0) then
      local name = info[1]
      local obj = assert(cairo[name], name)
      obj._parent = info.parent
      if info.methods then
     -- Go through description of the methods and create functions
     -- from them.
     obj._method = {}
     local cprefix = 'cairo_' ..
        (info.cprefix or
         name:gsub('([%l%d])([%u])', '%1_%2'):lower() .. '_')
     local self_arg = { obj }
     for method_name, method_info in pairs(info.methods) do
        if cairo.version >= (method_info.since or 0) then
           method_info.name = 'cairo.' .. name .. '.' .. method_name
           method_info.addr = assert(                      <-- This line 673
          cairo._module[
             method_info.cname or (cprefix .. method_name)])
           if not method_info.static then
          table.insert(method_info, 1, self_arg)
           end
           method_info.ret = method_info.ret or ti.void
           obj._method[method_name] = core.callable.new(method_info)
        end
     end
      end

I don't know which lines to comment. :/

from awesome.

blueyed avatar blueyed commented on July 18, 2024

Which one is line 673? (there are two assert statements in what you've pasted).

I don't know which lines to comment. :/

I've meant the assert statement that's causing problems.
But that won't help probably. You might have to debug it, e.g. add print statements there to see what's going on: what is different there when using LANG=C (or what you've used) compared to using your system settings.

from awesome.

TaylanTatli avatar TaylanTatli commented on July 18, 2024

I wrote " <-- This line 673"

Sorry, my English is not good.Can you explain me what to do simply?

from awesome.

blueyed avatar blueyed commented on July 18, 2024

I cannot help you much further. I was just trying to help you debug it.

The problem appears to be that some cairo module is not available:

> cairo._module[method_info.cname or (cprefix .. method_name)]

You could add the following code before the assert and then see what gets printed:

print(method_info)
print(cprefix)
print(method_name)

But you might want to wait for someone else to help with that - I might be on a totally wrong track.

from awesome.

TaylanTatli avatar TaylanTatli commented on July 18, 2024

A big update: I don't need to use LC_ALL anymore, because just changing LC_CTYPE to english is working. Awesome starts and all programs are Turkish. :) But i don't know what is LC_CTYPE for?

from awesome.

blueyed avatar blueyed commented on July 18, 2024

According to man locale it's for "Character classification and case conversion.".

from awesome.

TaylanTatli avatar TaylanTatli commented on July 18, 2024

So it's not important so much? Anyway, at least it's working.:)

from awesome.

blueyed avatar blueyed commented on July 18, 2024

I'm glad it's working for you!

It does not seem to be important, and probably triggers a bug somewhere, where upper-/lowercasing is an issue.

from awesome.

psychon avatar psychon commented on July 18, 2024

I can reproduce this issue and it is not in awesome, but in lgi (as one could already guess before):

$ lua -e 'print(os.setlocale("tr_TR.UTF8")) ; print(require("lgi").cairo)' 
tr_TR.UTF8
lua: /usr/share/lua/5.1/lgi/override/cairo.lua:673: assertion failed!
stack traceback:
    [C]: in function 'assert'
    /usr/share/lua/5.1/lgi/override/cairo.lua:673: in main chunk
    [C]: in function 'require'
    /usr/share/lua/5.1/lgi/namespace.lua:176: in function </usr/share/lua/5.1/lgi/namespace.lua:148>
    (tail call): ?
    (command line):1: in main chunk
    [C]: ?

from awesome.

psychon avatar psychon commented on July 18, 2024

And here is some more compact, self-standing example demonstrating the problem:

$ lua -e 'function f() s = "I" ; return s:lower() end ; print(os.setlocale("")) ; print(f()) ; print(os.setlocale("tr_TR.UTF8")) ; print(f()) '
de_DE.UTF-8
i
tr_TR.UTF8
I

(Technical details: lgi has the strings "ImageSurface" and "get_width" and it tries to generate the name of the corresponding C function which is cairo_image_surface_get_width. However, in a turkish locale it ends up with cairo_Image_surface_get_width. The following assertion failure is just the resulting "whoops, there is no such function"-error.)

@TaylanTatli Since you seem to know turkish, can you tell us why "i" is not the lower-case version of "I"?

I reported this issue to LGI and thus will close this one.
Upstream issue: lgi-devs/lgi#97

from awesome.

psychon avatar psychon commented on July 18, 2024

http://en.wikipedia.org/wiki/Dotted_and_dotless_I

from awesome.

TaylanTatli avatar TaylanTatli commented on July 18, 2024

You found the answer on wikipedia. :) That İ and ı are really problem for us. Lots of app lives problem with them. Thank you. :)

from awesome.

psychon avatar psychon commented on July 18, 2024

This was now fixed in LGI upstream

from awesome.

TaylanTatli avatar TaylanTatli commented on July 18, 2024

Thanks.

from awesome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.