cy99 / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

"errno" module needed - is platform-dependent #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
CPython has an "errno" module, which is just a table of the constants from 
"errno.h".  It's a built-in; there is no "errno.py".  The problem is that the 
error numbers are platform-dependent.  So it has to be built for each platform, 
hopefully as part of Shed Skin's library. 

(I'm trying to get more of the standard modules to work, starting at the 
bottom.  My current goal is to work up to urllib2 and process web pages.)

Original issue reported on code.google.com by na...@animats.com on 8 Nov 2010 at 6:42

GoogleCodeExporter commented 9 years ago
Wrote a program to generate "errno.py. Attached.

Original comment by na...@animats.com on 8 Nov 2010 at 6:15

Attachments:

GoogleCodeExporter commented 9 years ago
thanks! I think it is probably a better approach to include handwritten 
lib/errno.?pp files though, similar to how the 'signal' module is supported at 
the moment. that way it should also work on each platform, without having to 
first build the library. 

is this something you'd be interested in looking into further? 

Original comment by mark.duf...@gmail.com on 8 Nov 2010 at 8:52

GoogleCodeExporter commented 9 years ago
That's up to you.  I'd be inclined to generate "errno.py" automatically during 
installation.  You should never have to tell the computer something it already 
knows.

Original comment by na...@animats.com on 8 Nov 2010 at 8:58

GoogleCodeExporter commented 9 years ago
I don't really understand your point. the computer "knows" everything in 
errno.h, and using this, it's simply a matter of autogenerating lib/errno.* 
once.. autogenerating on installation could also be viewed as telling the 
computer something it already knows :P 

this issue was marked as an 'easy task' in the wiki section. I'm thinking about 
permanently leaving a fixed amount of easy issues open, to encourage newcomers 
to look into fixing issues.. please let me know if you'd like me to fix an 
issue quickly though. I'd be happy to make an exception on request.

Original comment by mark.duf...@gmail.com on 14 Nov 2010 at 12:05

GoogleCodeExporter commented 9 years ago

Original comment by mark.duf...@gmail.com on 25 Jun 2011 at 8:14

GoogleCodeExporter commented 9 years ago

Original comment by mark.duf...@gmail.com on 16 Jul 2011 at 9:58