#jython IRC Log

Index

IRC Log for 2017-01-19

Timestamps are in GMT/BST.

[2:45] * deepa (deepy@wrongplanet/deepa) has joined #jython
[2:49] * MightyJoe (~joe@2605:de00:1:1:4a:c:0:12c) has joined #jython
[2:53] * Matsv- (~Matsv@i.am.matsv.nl) has joined #jython
[2:53] * jimbaker` (~jbaker@8.44.156.98) has joined #jython
[2:54] * xemdetia (~xemdetia@129.42.208.174) Quit (*.net *.split)
[2:54] * deepy (deepy@wrongplanet/deepa) Quit (*.net *.split)
[2:54] * jimbaker (~jbaker@8.44.156.98) Quit (*.net *.split)
[2:54] * lazybear (~lazybear@radium.atom.fi) Quit (*.net *.split)
[2:54] * cyraxjoe (~joe@2605:de00:1:1:4a:c:0:12c) Quit (*.net *.split)
[2:54] * dyce (~otr@unaffiliated/dyce) Quit (*.net *.split)
[2:54] * Matsv (~Matsv@i.am.matsv.nl) Quit (*.net *.split)
[3:00] * xemdetia (~xemdetia@129.42.208.174) has joined #jython
[3:02] * dyce (~otr@unaffiliated/dyce) has joined #jython
[3:13] * lazybear (~lazybear@radium.atom.fi) has joined #jython
[4:00] * xemdetia (~xemdetia@129.42.208.174) Quit (Ping timeout: 276 seconds)
[6:05] * deepa is now known as deepy
[15:40] * xemdetia (~xemdetia@129.42.208.174) has joined #jython
[16:09] * jimbaker` is now known as jimbaker
[16:09] * jimbaker (~jbaker@8.44.156.98) Quit (Changing host)
[16:09] * jimbaker (~jbaker@python/psf/jimbaker) has joined #jython
[16:09] * ChanServ sets mode +o jimbaker
[16:34] * offbyone (~offbyone@ec2-52-42-218-253.us-west-2.compute.amazonaws.com) has joined #jython
[16:34] <offbyone> Hey, owners. I'd like to troubleshoot why the `site` module isn't loading sitecustomize in my (admittedly hacked up and very weird) jython deployment?
[16:35] <offbyone> I acknowledge in advance that I'm doing some weird shit with layout.
[16:35] <offbyone> (specifically, I'm modifing sysconfig.py to find paths in different places, because that's what we're doing. Don't ask...)
[16:36] <offbyone> So, it's not so much "your stuff is broken" but instead "I'm doing unexpected weird shit and I was hoping someone might be able to walk me through the site init process so that I can figure out where/why my weird shit is breaking"
[16:46] <jimbaker> offbyone, in looking at site.py vs its diff from cpython 2.7, it is nearly stock. most of the differences are 1) add completer support (so no expected impact, that would be extremely surprising); 2) add some more conditional logic for jython, such as how to find site-packages
[16:46] <jimbaker> still there might be something there
[16:47] <offbyone> The behaviour I'm seeing is that if I run jython -msite it shows the right sys.path
[16:47] <jimbaker> i'm not sure for example makepath needs that conditional logic
[16:47] <offbyone> But if I run jython directly, I can't import things from the sys.path entries that I added in sitecustomize.py
[16:49] <jimbaker> hmmm, that's an unusual way to import the site module
[16:49] <jimbaker> usually it's a question of using -S or not
[16:49] <offbyone> -msite is just a way to print out the site details
[16:49] <jimbaker> got it
[16:50] <offbyone> What I can't tell is if the site is simply not being imported, or it's breaking.
[16:54] <jimbaker> offbyone, it's unusual to me. i guess i never thought about the implications of a module that is imported by default as part of the usual bootstrapping; and can be simultaneously run as a script
[16:55] <jimbaker> but of course it's documented as having that capability
[16:55] <offbyone> Aye. I'd call that a bit of a red herring, though; -msite just runs a script that dumps out the site state, which is mostly for information. What that *is* suggesting to me, though, is that the site module itself is not being imported unless I run that script... which is weird.
[16:56] <jimbaker> offbyone, you can tell. sys.modules will have an entry for it
[16:56] <offbyone> So my first step is to try to get to ground on where/how site is being imported.
[16:56] <offbyone> Good call!
[16:56] <offbyone> Huh. It does, in fact, have an entry for site.
[16:56] <jimbaker> so normal startup, you will see something like >>> sys.modules['site']
[16:56] <jimbaker> <module 'site' from '/Users/jbaker/jythondev/jython27/dist/Lib/site$py.class'>; otherwise you will get a KeyError
[16:57] <offbyone> But no entry for sitecustomize...
[16:57] <jimbaker> offbyone, yeah, that could be your problem
[16:57] <jimbaker> in circumstances like this, i suggest apply full instrumentation :)
[16:58] <jimbaker> i like putting print statements, etc in the modules i'm debugging, just to see what's going on
[16:58] <offbyone> I think I'm going to have to do that.
[16:58] <jimbaker> the startup process is poorly documented *at best*
[16:58] <offbyone> I'm confirming that CPython includes the sitecustomize.py module in sys.modules
[16:59] <jimbaker> for stuff like this, we usually run cpython side by side with jython
[16:59] <offbyone> Yep
[16:59] <offbyone> And cpython *does* have sitecustomize in sys.modules.
[16:59] <jimbaker> cool, so that's the best approach. we got a ref impl. we don't have a spec
[16:59] <jimbaker> at least for this sort of stuff
[16:59] <offbyone> So... why is it picking it up in the script but not in the site import?
[16:59] <offbyone> Hm.
[16:59] <offbyone> Well, we'll see :)
[16:59] <jimbaker> it's possible that it occurs too early
[16:59] <jimbaker> and stuff gets dropped
[17:00] <jimbaker> iirc site.py doesn't necessarily report import problems
[17:01] <offbyone> I believe that's the case. I'm going to patch it in place an see what I can see.
[17:03] <offbyone> Huh
[17:03] <offbyone> ImportError: 'unable to handle'
[17:03] <jimbaker> offbyone, yeah. so the working theory then is as follows: sitecustomize.py depends on some functionality not yet available in the startup process. site.py attempts import, which fails quietly
[17:06] <offbyone> I'm trying to track down which sitecustomize.py is being loaded. Because it's not the one I think should be.
[17:10] <offbyone> Huh. Weirdly, I don't seem to have the site-packages directory from my interpreter on sys.path when site tries to import sitecustomize.
[17:12] <offbyone> Ah...
[17:12] <offbyone> I think I'm starting to see the issue
[17:12] <offbyone> sys.prefix is at fault.
[17:13] <offbyone> We set python.home to a directory that is writeable in our installation, because as far as I can tell, that informs where the class caches are written (might be wrong on thsi one)
[17:15] <offbyone> And I hate to say this, but my GOD does the Jython "Lib" naming convention play merry goddamn hob with the way we install :)
[17:15] <jimbaker> offbyone, good you have a handle on this. the sys module is something that we have worked on quite a bit. but it's still a mess. anyway, i got an irc meeting
[17:16] <offbyone> No worries
[17:16] <offbyone> Thanks
[22:13] * xemdetia_ (~xemdetia@129.42.208.174) has joined #jython
[22:15] * xemdetia (~xemdetia@129.42.208.174) Quit (Ping timeout: 252 seconds)
[23:07] * xemdetia_ (~xemdetia@129.42.208.174) Quit (Ping timeout: 240 seconds)
[23:33] * KaliLinuxGR (~KaliLinux@unaffiliated/kalilinuxgr) Quit (Ping timeout: 240 seconds)
[23:39] * KaliLinuxGR (~KaliLinux@unaffiliated/kalilinuxgr) has joined #jython
[23:40] * KaliLinuxGR (~KaliLinux@unaffiliated/kalilinuxgr) Quit (Read error: Connection reset by peer)
[23:44] * KaliLinuxGR (~KaliLinux@unaffiliated/kalilinuxgr) has joined #jython

Index

These logs were automatically created by JythonLogBot on irc.freenode.net using a slightly modified version of the Java IRC LogBot.