Commit graph

2804 commits

Author SHA1 Message Date
Tim Peters
855fe88b24 Implemented a Wiki suggestion:
{timetz,datetimetz}.{utcoffset,dst}() now return a timedelta (or None)
instead of an int (or None).

tzinfo.{utcoffset,dst)() can now return a timedelta (or an int, or None).

Curiously, this was much easier to do in the C implementation than in the
Python implementation (which lives in the Zope3 code tree) -- the C code
already had lots of hair to extract C ints from offset objects, and used
C ints internally.
2002-12-22 03:43:39 +00:00
Martin v. Löwis
9c36c29156 Use wcscoll for _locale.strcoll if available. 2002-12-21 18:34:06 +00:00
Tim Peters
328fff7214 format_utcoffset(): The natural type of the buflen arg is size_t, so
used that.

wrap_strftime():  Removed the most irritating uses of buf.

TestDate.test_ordinal_conversions():  The C implementation is fast enough
that we can afford to check the endpoints of every year.  Also added
tm_yday tests at the endpoints.
2002-12-20 01:31:27 +00:00
Neal Norwitz
dfb8086760 Fix another long vs int mismatch. test_datetime now passes on alpha 2002-12-19 02:30:56 +00:00
Tim Peters
0b0f41cf1f Fixed typo in string. 2002-12-19 01:44:38 +00:00
Neal Norwitz
c296c63c73 Fix crash on alphas due to mismatch between 'l' format and int variables. 2002-12-19 00:42:03 +00:00
Tim Peters
ba873472d2 delta_str(): Purged last uses of sprintf (in favor of PyOS_snprintf). 2002-12-18 20:19:21 +00:00
Jack Jansen
51cd8a2d24 "time_second" is apparently a #define on MacOSX. Renamed the (static)
routine to py_time_second.
2002-12-17 20:57:24 +00:00
Guido van Rossum
bd43e9195b Fix GCC warnings. It turns out two out of three pointed to real bugs! 2002-12-16 20:34:55 +00:00
Tim Peters
2a799bf77a datetime escapes the sandbox. The Windows build is all set. I leave it
to others to argue about how to build it on other platforms (on Windows
it's in its own DLL).
2002-12-16 20:18:38 +00:00
Raymond Hettinger
866964c3a3 Apply SF patch 652930: Add optional base argument to math.log(x[, base]). 2002-12-14 19:51:34 +00:00
Guido van Rossum
0847c5c6c7 execve(), spawnve(): add some extra sanity checking to env;
PyMapping_Check() doesn't guarantee that PyMapping_Size() won't raise
an exception, nor that keys and values are lists.

Also folded some long lines and did a little whitespace normalization.

Probably a 2.2 backport candidate.
2002-12-13 18:36:22 +00:00
Jack Jansen
747c3d3f02 We need macglue on MacPython-OS9 too. 2002-12-13 15:20:53 +00:00
Martin v. Löwis
7d1349553b Always initialize objc. 2002-12-12 19:05:48 +00:00
Marc-André Lemburg
b28de0d79f Patch to make _codecs a builtin module. This is necessary since
Python 2.3 will support source code encodings which rely on the
builtin codecs being available to the parser.

Remove struct dependency from codecs.py
2002-12-12 17:37:50 +00:00
Greg Ward
b69bb3d019 Typo fix. 2002-12-12 17:35:45 +00:00
Martin v. Löwis
b5bfb9f38c Support threads-enabled Tcl installations. 2002-12-12 17:07:58 +00:00
Martin v. Löwis
135594648f This is not used anymore. 2002-12-11 19:55:48 +00:00
Greg Ward
3d9994d3b0 Add OSS mixer interface (from Nicholas FitzRoy-Dale <wzdd@lardcave.net>):
* add oss_mixer_t and OSSMixerType
  * add newossmixerobject(), oss_mixer_dealloc(), ossopenmixer()
  * add _do_ioctl_1_internal() to support mixer ioctls
  * add mixer methods: oss_mixer_{close,fileno,channels,stereo_channels,
    rec_channels,getvol,setvol,getrecsrc,setrecsrc}()
  * add oss_mixer_methods list
  * add oss_mixer_getattr() (why?!)
  * export SOUND_MIXER_* constants from soundcard.h
2002-12-11 15:12:01 +00:00
Greg Ward
da9f853b49 Prepare for the coming mixer support patch: change _do_ioctl_0() and
_do_ioctl_1() so they take a file descriptor rather than an oss_t
pointer.
2002-12-11 14:49:59 +00:00
Greg Ward
8c6b6a9f1e Finish expunging the 'linuxaudiodev' name:
* rename oss_t to lad_t, Ladtype to OSSType,
  * rename lad_*() methods to oss_*()
  * rename lad_methods list to oss_methods
Patch and impetus supplied by Nicholas FitzRoy-Dale <wzdd@lardcave.net>.
2002-12-11 14:43:13 +00:00
Martin v. Löwis
cf8f47ea95 Patch #650422: Use Posix AF_ constants instead of PF_ ones. 2002-12-11 13:10:57 +00:00
Martin v. Löwis
33ec3ba217 Remove C++ comment. Silence unsigned char* cast warning. 2002-12-07 14:57:11 +00:00
Martin v. Löwis
2fb661fb80 Remove C++ comment. 2002-12-07 14:56:36 +00:00
Tim Peters
4e52ca82ae A patch from Kevin Jacobs, plugging several leaks discovered when
running the sandbox datetime tests.

Bugfix candidate.
2002-12-07 02:43:28 +00:00
Martin v. Löwis
9e43730ca3 Don't include <ioctl.h> unless on __VMS. 2002-12-06 12:57:26 +00:00
Martin v. Löwis
79acb9edfa Patch #614055: Support OpenVMS. 2002-12-06 12:48:53 +00:00
Jason Tishler
d0ebd7edb1 Patch #649060: Cygwin bz2module patch
This patch enables the bz2 module to build cleanly under Cygwin.
2002-12-05 20:31:53 +00:00
Martin v. Löwis
e07e18d41b Decode untyped strings from UTF-8. 2002-12-04 19:54:36 +00:00
Skip Montanaro
56643679f4 correct wording of comments about old bsddb (now bsddb185) module 2002-12-02 00:27:10 +00:00
Greg Ward
9a568eb245 Expunge any remaining mentions of linuxaudiodev -- it's ossaudiodev now! 2002-11-30 23:20:09 +00:00
Greg Ward
97708bc6f8 Rename LinuxAudioError to OSSAudioError ('ossaudiodev.error').
Use OSSAudioError much less frequently -- all real I/O errors (ie. any
time open(), read(), write(), ioctl(), or select() return an error)
become IOError.  OSSAudioError is only used now for bad open() mode.
2002-11-30 23:17:10 +00:00
Greg Ward
1e0f57d0bb Added mode 'rw' for full-duplex (play and record at the same time) mode.
Added _EXPORT_INT macro to export an integer constant to Python-space.
Use it for all the AFMT_* constants, and update the list of AFMT_*
constants to match what's in Linux 2.4: add AFMT_{QUERY,IMA_ADPCM,
MPEG,AC3}.  This should probably be tested with older versions of OSS,
eg. with Linux 2.2 and 2.0.

Export all SNDCTL_* ioctl numbers (where "all" is the set found in
/usr/include/linux/soundcard.h on my Debian 3.0 system -- again
Linux 2.4).  Again needs to be tested with older OSS versions.
2002-11-30 23:05:26 +00:00
Greg Ward
131bce035a * Don't put the device in non-blocking mode at open() time; this makes
it impossible to access blocking mode!

* Rename write() to writeall(), and add a write() method that just
  does one write().

* Rearrange/simplify writeall(): in particular, don't supply a timeout
  to select().  Let it block forever if it has to.

* Add a bunch of simple ioctl() wrappers: nonblock(), setfmt(),
  getfmts(), channels(), speed(), sync(), reset(), post().  These
  wrap, respectively, SNDCTL_DSP_NONBLOCK, SNDCTL_DSP_SETFMT,
  SNDCTL_DSP_GETFMTS, etc.

* Reduce flush() (which was a wrapper for the SNDCTL_DSP_SYNC ioctl) to
  an alias for sync().

* Rearrange the lad_methods list to reflect the order in which the
  methods are defined, and add some grouping comments.
2002-11-30 22:56:44 +00:00
Greg Ward
04613a9308 ossaudiodev -- Python interface to the OSS (Open Sound System) API.
This module is a replacement for linuxaudiodev, which will eventually
be deprecated.

Initial revision is rev 2.20 of linuxaudiodev.c, with a rewritten
header comment.
2002-11-30 22:47:45 +00:00
Greg Ward
a34b1a0749 Allow the device name to be passed to linuxaudiodev.open(), for
consistency with the built-in open() (and every other sane open()
function, for that matter).  The two valid ways to call this open() are
now open(mode) and open(device, mode).

For backwards compatibility, retain the old open(mode) calling syntax --
this makes the error message when you call open(device) a bit confusing,
but oh well.

This is the first half of SF patch #644977.
2002-11-27 22:19:15 +00:00
Martin v. Löwis
4ec2e7071e Avoid including tclInt.h. 2002-11-26 22:12:12 +00:00
Martin v. Löwis
8c8aa5d666 Rename want_objects to wantobjects throughout, for consistency. 2002-11-26 21:39:48 +00:00
Martin v. Löwis
ffad633af9 Patch #518625: Return objects in Tkinter. 2002-11-26 09:28:05 +00:00
Martin v. Löwis
52ea7e9244 Patch #632973: Implement _getdefaultlocale for OS X. 2002-11-26 09:05:36 +00:00
Martin v. Löwis
b5c980b802 Add unidata_version. Bump generator version number. 2002-11-25 09:13:37 +00:00
Martin v. Löwis
d5169bad94 Regenerate from Unicode 3.2.0 to include all First/Last ranges. 2002-11-24 23:10:08 +00:00
Martin v. Löwis
8d93ca1383 Verify that the code in CJK UNIFIED IDEOGRAPH- actually denotes an ideograph. 2002-11-23 22:10:29 +00:00
Martin v. Löwis
677bde2dd1 Patch #626485: Support Unicode normalization. 2002-11-23 22:08:15 +00:00
Martin v. Löwis
ef7fe2e813 Implement names for CJK unified ideographs. Add name to KeyError output.
Verify that the lookup for an existing name succeeds.
2002-11-23 18:01:32 +00:00
Martin v. Löwis
2f4be4e38a Fix off-by-one error. 2002-11-23 17:11:06 +00:00
Martin v. Löwis
7d41e29c58 Patch #626548: Support Hangul syllable names. 2002-11-23 12:22:32 +00:00
Martin v. Löwis
b2c7affbaa Merge with bsddb3 2002.11.23.10.42.36 2002-11-23 11:26:07 +00:00
Martin v. Löwis
e17af7b3db Include Python.h first. 2002-11-23 09:16:19 +00:00
Neal Norwitz
8d4c9817a2 Fix SF # 640557, '64-bit' systems and the dbm module
datum.dsize can apparently be long on some systems.
Ensure we pass an int* to PyArg_Parse("s#"), not &datum.dsize

Will backport.
2002-11-22 23:29:31 +00:00