Python 3.7.3 - ImportError: dynamic module does not define module export function (PyInit_*)

2019-06-30 Thread gia .
Hi, I was trying to upgrade a python 2 extension in Linux and hit this
error upon trying to import it into python 3.

The weird thing is that I can see the symbol when I use readelf -a, so it
is not missing, it has visibility default and it defines as extern "C"
PyObject* return type (using the macro). I build with g++ 6, global
visibility hidden and inline hidden, would that affect it? does it need to
find other functions?

readelf -d shows that a NEEDED library is my altinstall build of python
3.7.3's libs, so that makes me think g++ found the correct library (there
is an oder system library installed). RUNPATH is configured with a relative
path that leads upwards in the folder tree to the python libs. It points to
the same lib folder as the interpreter's RUNPATH, which is also relative.

The module name starts with a underscore, so that's a point of worry, the
standard mentioned ascii, so I assumed underscore is fine, but maybe it
meant alphanumeric. The module is _mymodule_python3, and the init is
PyInit__mymodule_python3, with the *.so being _mymodule_python3.so and a
python file mymodule.py that loads the module inside using 'import
my.package._mymodule_python3'. The cpp file is encoded in utf8, but the
module name string that goes in the module def is not L"", it is plain char.

I load python3 manually and then import this py file and it finds the so
file, but at the end prints the error, I can exit, load another python3 and
import the so directly and same outputs. sys.path doesnt point to the
system install.

I read the standard page and it seems everything is set up correctly
(although it obviously isn't or it should be working).

I've had a lot of difficulty debugging the import call because it is frozen
so I can't just edit the _bootstrap.py file, I edit it and it still uses
the frozen code. I even edited the file in the source tree itself by adding
a few print calls then rebuilt cpython, and they seem to be consumed by the
freeze pass, as nothing gets printed, how do you debug it properly? google
is not helping me.

import is failing at _gcd_import (name, package = None, level = 0) -> find
and load. And if I use a different loading method by importing importlib
(used in documentation page), it manages to obtain the spec which looks
okay upon printing it, but fails upon trying to load and return the module
object with spec.loader.create_module.

Appreciate ideas or a proper debugging method for the import function.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Final statement from Steering Council on politically-charged commit messages

2020-08-17 Thread gia
Math should stop being standardized, as it could alienate people of other
colors to it.

Commit should be rewritten as "Remove book advert from comments".

On Mon, Aug 17, 2020 at 1:39 PM Chris Angelico  wrote:

> On Tue, Aug 18, 2020 at 4:34 AM Dylan Distasio 
> wrote:
> >
> > That's quite an interesting ruling by the SC.  I'm not surprised to see
> them bend the knee to PC, but it is disheartening to see they're fine
> opening a can of political worms in a programming language.  I suspect they
> will deplore messages outside of their bubble though.
> >
>
> Yes. I was hoping for "we should rewrite that commit", and would have
> been content with "we won't rewrite it, but we don't want that
> repeated". But the SC said that it is absolutely fine to write commit
> messages like that.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread gia
 That's why I picked Math, it is also universally accepted, it's very
strict, and it leaves the reader to decide its color based on themselves
(it's not white btw :)

On Tue, Aug 18, 2020 at 11:36 AM Tim Daneliuk  wrote:

> On 8/17/20 1:26 PM, Chris Angelico wrote:
> > For context, see this commit:
> >
> >
> https://github.com/python/peps/commit/0c6427dcec1e98ca0bd46a876a7219ee4a9347f4
> >
> > The commit message is highly politically charged and is now a
> > permanent part of the Python commit history. The Python Steering
> > Council has this to say:
> >
> >
> https://github.com/python/steering-council/issues/34#issuecomment-675028005
> >
> > "The SC discussed this and ... we do not deplore the message."
> >
> > So now we know: go ahead and put all the political messages you like
> > into the commit messages, just don't put anything inappropriate into
> > the content. White supremacy has been mentioned; who wants to pick the
> > next hot topic?
> >
> > ChrisA
> >
> Just a few thoughts here ...
>
> - While languages evolve over time, _in any given moment_ there are better
>   and worse ways to express ideas in a given language. "The Elements Of
> Style"
>   remains relevant today because it provides guidance on improving
>   written clarity.  It is not some blind defence of the
>   perfect English.
>
> - Precision of language and precision of thought go hand in hand.  Much
>   of the grousing about languages standards (in this case, hiding in
>   drag as social consciousness) is little more than intellectual laziness.
>   In actual fact, our discipline has burned a lot of intellectual
>   fuel in trying to find ways to be _more precise_ for things like
>   specifications, formal semantics, and the like.
>
> - It is my consistent experience when working with non-native English
>   speakers, that they wish to _improve_ their use and precision of the
>   language, not simplify it.
>
> - Why is English the only target of these social pieties?  You never
>   hear these demands to relax these linguistic standards for, say, French,
>   German, or Spanish.  Similarly, where is the outcry to make
>   Mandarin, Bantu, Swahili, or Arabic more approachable for
>   Westerners?
>
> Methinks there is an ideological skunk in the parlor ...
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread gia
Trafficking of people is a very current problem, and it is not a race
issue, as people of all races are abducted by people of all races. Yes,
right now. If you are so strong about ending that suffering, I suggest you
focus on the present and stop wading in the past.

On Tue, Aug 18, 2020 at 6:36 PM  wrote:

> There are many reasons Elements is a terrible English style guide:
>
> https://www.pure.ed.ac.uk/ws/files/8520953/PULLUM_2010_The_land_of_the_free_and_the_elements_of_style.pdf
>
> I would kindly recommend that folks just educate themselves on what
> white supremacy is & how it continues in both subtle & overt ways to
> this day. Sadly, getting extremely upset after being exposed to the
> accurate term white supremacy is a symptom of what's called 'white
> fragility' by psychologists who study the social pathologies of racism &
> its long-lasting, inter-generational impacts on society.
>
> You need serious help with processing your anger if you look at
> everything that's happening in the world & bubble in anger over a commit
> message that is simply acknowledging a social ill. One of countless
> many. I do hope you get the help you need.
>
> I would also caution against relying on the idea of human rights when
> defending against accusations of being political, since they too are
> political. Life is political. We continue to this day trying to
> redefine, as a society, what human rights are, & who is considered to
> deserve them. That process is politics.
>
> Some people think that being called white is racist. Other people think
> that having their land & children stolen because of their race & being
> forced to write in the language of their captors is racist. One group is
> deflecting blame for the worst atrocities in history, the other is
> acknowledging a real problem & seeking accountability in everyday life.
>
>
> Resources:
>   A People's History of the United States:
> https://mvlindsey.files.wordpress.com/2015/08/peoples-history-zinn-1980.pdf
>   The Invention of the White Race: Volume II:
> http://ouleft.org/wp-content/uploads/Invention-White-Race-Vol2-Allen.pdf
>
>
>
> >   python-list@python.org
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >   https://mail.python.org/mailman/listinfo/python-list
> > or, via email, send a message with subject or body 'help' to
> >   python-list-requ...@python.org
> >
> > You can reach the person managing the list at
> >   python-list-ow...@python.org
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of Python-list digest..."
> >
> > Today's Topics:
> >
> >1. why the connection set with ?keep live? in urllib.request
> >   always set to be?closed, thanks (xuanwu348)
> >2. Final statement from Steering Council on politically-charged
> >   commit messages (Chris Angelico)
> >3. Re: Final statement from Steering Council on
> >   politically-charged commit messages (Dylan Distasio)
> >4. Re: Final statement from Steering Council on
> >   politically-charged commit messages (Chris Angelico)
> >5. Re: Final statement from Steering Council on
> >   politically-charged commit messages (gia)
> >6. Re: why the connection set with ?keep live? in urllib.request
> >   always set to be?closed, thanks (Barry)
> >7. Re:Re: why the connection set with ?keep live? in
> >   urllib.request always set to be?closed, thanks (xuanwu348)
> >8. Error (Thi?n Nguy?n Thanh)
> >9. Re: Final statement from Steering Council on
> >   politically-charged commit messages (thronobu...@gmail.com)
> >   10. Re: Error (Igor Korot)
> >   11. Re: Final statement from Steering Council on
> >   politically-charged commit messages (thronobu...@gmail.com)
> >   12. Re: Error (Thi?n Nguy?n Thanh)
> >   13. Re: Error (Igor Korot)
> >   14. Re: Error (Igor Korot)
> >   15. Re: Final statement from Steering Council on
> >   politically-charged commit messages (justin walters)
> >   16. RE: Final statement from Steering Council on
> >   politically-charged commit messages (David Raymond)
> >   17. Re: Final statement from Steering Council on
> >   politically-charged commit messages (Richard Damon)
> >   18. Re: Final statement from Steering Council on
> >   politically-charged commit messages (Chris Angelico)
> >   19. ANN: Wing Python IDE version 7.2.4 has been released (Wingware)
> >   20. Re: Final statement from Steering Council on
> >   politically-charged commit messages (Robin Becker)
> >   21. Re: Final statement from Steering Council on
> >   politically-charged commit messages (J. Pic)
> >   22. Re: Final statement from Steering Council on
> >   politically-charged commit messages (Igor Korot)
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list