summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
Commit message (Expand)AuthorAgeFilesLines
* (Merge 3.4) Issue #11453, #18174: Fix leak of file descriptor in test_asyncoreVictor Stinner2014-07-281-0/+4
|\
| * Issue #11453, #18174: Fix leak of file descriptor in test_asyncoreVictor Stinner2014-07-281-0/+4
* | Issue #21566: Make use of socket.listen() default backlog.Charles-François Natali2014-07-231-1/+1
* | (Merge 3.4) Issue #11453: asyncore: emit a ResourceWarning when an unclosedVictor Stinner2014-06-271-0/+16
|\ \ | |/
| * Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapperVictor Stinner2014-06-271-0/+16
* | (Merge 3.4) Closes #21582: Cleanup test_asyncore. Patch written by diana.Victor Stinner2014-06-271-36/+17
|\ \ | |/
| * Closes #21582: Cleanup test_asyncore. Patch written by diana.Victor Stinner2014-06-271-36/+18
* | fix isuse #13248: remove previously deprecated asyncore.dispatcher __getattr_...Giampaolo Rodola'2014-04-291-17/+0
* | Issue #7221: remove redundant tests in test_asyncore. Patch by Jessica McKel...Antoine Pitrou2014-04-191-6/+1
|/
* Issue #18571: Implementation of the PEP 446: file descriptors and file handlesVictor Stinner2013-08-271-1/+6
* Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as poss...Antoine Pitrou2013-08-211-3/+2
* Issue #17992: Add timeouts to asyncore and asynchat tests so that they won't ...Giampaolo Rodola'2013-05-161-3/+10
* test_asyncore: wait explicitly for a thread termination (this dangling threadCharles-François Natali2013-01-131-1/+1
|\
| * test_asyncore: wait explicitly for a thread termination (this dangling threadCharles-François Natali2013-01-131-1/+1
| |\
| | * test_asyncore: wait explicitly for a thread termination (this dangling threadCharles-François Natali2013-01-131-0/+1
* | | #16896: merge with 3.3.Ezio Melotti2013-01-101-16/+8
|\ \ \ | |/ /
| * | #16896: test_asyncore now works with unittest test discovery. Patch by Zacha...Ezio Melotti2013-01-101-16/+8
* | | Issue #16717: get rid of socket.error, replace with OSErrorAndrew Svetlov2012-12-181-3/+3
|/ /
* | Set a time threshold in test_asyncore.capture_server so that tests don'tKristján Valur Jónsson2012-04-061-3/+4
* | attempt to fix asyncore buildbot failureGiampaolo Rodola'2012-03-231-5/+9
|\ \ | |/
| * attempt to fix asyncore buildbot failureGiampaolo Rodola'2012-03-231-3/+7
* | fix failing asyncore test as per http://bugs.python.org/issue10340#msg156586Giampaolo Rodola'2012-03-231-10/+12
* | merge 79422b3684f1 in 3.3 branch (issue 10340)Giampaolo Rodola'2012-03-221-0/+16
|\ \ | |/
| * fix #10340: properly handle EINVAL on OSX and also avoid to call handle_conne...Giampaolo Rodola'2012-03-221-0/+16
| * Merged revisions 88604 via svnmerge fromGiampaolo Rodolà2011-02-251-1/+1
* | test_asyncore: Actually try to received OOB data.Charles-François Natali2011-11-021-0/+1
* | test_asyncore: Enable tests of Unix domain sockets with poll().Charles-François Natali2011-10-311-2/+9
* | Issue #5661: on EPIPE/ECONNRESET, OS X returns the FD with the POLLPRI flag...Charles-François Natali2011-10-291-0/+4
* | Issue #5661: Add a test for ECONNRESET/EPIPE handling to test_asyncore. PatchCharles-François Natali2011-10-291-0/+28
* | Issue #12656: Really fix test_asyncore failures on Windows buildbots...Charles-François Natali2011-08-241-1/+2
* | Issue #12656: Fix test_asyncore failures on Windows buildbots.Charles-François Natali2011-08-241-5/+7
* | Issue #12656: Add tests for IPv6 and Unix sockets to test_asyncore.Charles-François Natali2011-08-241-46/+85
* | Issue 11177: asyncore's create_socket() arguments can now be omitted.Giampaolo Rodolà2011-02-251-10/+10
* | (issue 11214) - fix asyncore.strerror test failure on AIXGiampaolo Rodolà2011-02-251-1/+1
|/
* #10273: Rename assertRegexpMatches and assertRaisesRegexp to assertRegex and ...Ezio Melotti2010-12-011-2/+2
* fix leaking socketsBenjamin Peterson2010-10-311-0/+2
* have test_asyncore properly close files.Brett Cannon2010-10-291-2/+4
* Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module,Antoine Pitrou2010-10-141-1/+2
* Fix issue 6706: adds new handle_accepted() method to asyncore.dispatcherGiampaolo Rodolà2010-10-041-5/+28
* #9354: Provide getsockopt() in asyncore file_wrapper(). Patch by Lukas Langa.Georg Brandl2010-07-281-0/+13
* With skipUnless there is no need to add test classes conditionally.Ezio Melotti2010-07-271-6/+3
* Use proper skips and assert* methods in test_asyncore.Ezio Melotti2010-07-271-96/+97
* Merged revisions 81294 via svnmerge fromGiampaolo Rodolà2010-05-181-0/+9
* Merged revisions 81102 via svnmerge fromGiampaolo Rodolà2010-05-121-6/+2
* Merged revisions 81043 via svnmerge fromGiampaolo Rodolà2010-05-101-1/+275
* Merged revisions 80875 via svnmerge fromGiampaolo Rodolà2010-05-061-0/+17
* Merged revisions 80552-80556,80564-80566,80568-80571 via svnmerge fromVictor Stinner2010-04-281-1/+6
* Merged revisions 75826 via svnmerge fromAntoine Pitrou2009-10-271-25/+29
* Merged revisions 71553 via svnmerge fromR. David Murray2009-04-131-4/+1
* Merged revisions 70873,70904,70934,71490 via svnmerge fromR. David Murray2009-04-121-38/+22
ss="hl opt">); /* * Write array attribute. */ ret = H5Awrite(attr1, H5T_NATIVE_FLOAT, matrix); /* * Create scalar attribute. */ aid2 = H5Screate(H5S_SCALAR); attr2 = H5Acreate2(dataset, "Integer attribute", H5T_NATIVE_INT, aid2, H5P_DEFAULT, H5P_DEFAULT); /* * Write scalar attribute. */ ret = H5Awrite(attr2, H5T_NATIVE_INT, &point); /* * Create string attribute. */ aid3 = H5Screate(H5S_SCALAR); atype = H5Tcopy(H5T_C_S1); H5Tset_size(atype, 5); H5Tset_strpad(atype, H5T_STR_NULLTERM); attr3 = H5Acreate2(dataset, ANAMES, atype, aid3, H5P_DEFAULT, H5P_DEFAULT); /* * Write string attribute. */ ret = H5Awrite(attr3, atype, string); /* * Close attribute and file dataspaces, and datatype. */ ret = H5Sclose(aid1); ret = H5Sclose(aid2); ret = H5Sclose(aid3); ret = H5Sclose(fid); ret = H5Tclose(atype); /* * Close the attributes. */ ret = H5Aclose(attr1); ret = H5Aclose(attr2); ret = H5Aclose(attr3); /* * Close the dataset. */ ret = H5Dclose(dataset); /* * Close the file. */ ret = H5Fclose(file); /* * Reopen the file. */ file = H5Fopen(H5FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT); /* * Open the dataset. */ dataset = H5Dopen2(file, "Dataset", H5P_DEFAULT); /* * Attach to the scalar attribute using attribute name, then read and * display its value. */ attr = H5Aopen(dataset, "Integer attribute", H5P_DEFAULT); ret = H5Aread(attr, H5T_NATIVE_INT, &point_out); printf("The value of the attribute \"Integer attribute\" is %d \n", point_out); ret = H5Aclose(attr); //! [H5Oget_info3_snip] /* * Find string attribute by iterating through all attributes */ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS); for (i = 0; i < (unsigned)oinfo.num_attrs; i++) { attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)i, H5P_DEFAULT, H5P_DEFAULT); atype = H5Aget_type(attr); type_class = H5Tget_class(atype); if (type_class == H5T_STRING) { atype_mem = H5Tget_native_type(atype, H5T_DIR_ASCEND); ret = H5Aread(attr, atype_mem, string_out); printf("Found string attribute; its index is %d , value = %s \n", i, string_out); ret = H5Tclose(atype_mem); } ret = H5Aclose(attr); ret = H5Tclose(atype); } //! [H5Oget_info3_snip] /* * Get attribute info using iteration function. */ ret = H5Aiterate2(dataset, H5_INDEX_NAME, H5_ITER_INC, NULL, attr_info, NULL); /* * Close the dataset and the file. */ H5Dclose(dataset); H5Fclose(file); return 0; } /* * Operator function. */ static herr_t attr_info(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *opdata) { hid_t attr, atype, aspace; /* Attribute, datatype and dataspace identifiers */ int rank; hsize_t sdim[64]; herr_t ret; int i; size_t npoints; /* Number of elements in the array attribute. */ float *float_array; /* Pointer to the array attribute. */ /* avoid warnings */ (void)opdata; /* * Open the attribute using its name. */ attr = H5Aopen(loc_id, name, H5P_DEFAULT); /* * Display attribute name. */ printf("\nName : %s\n", name); /* * Get attribute datatype, dataspace, rank, and dimensions. */ atype = H5Aget_type(attr); aspace = H5Aget_space(attr); rank = H5Sget_simple_extent_ndims(aspace); ret = H5Sget_simple_extent_dims(aspace, sdim, NULL); /* * Display rank and dimension sizes for the array attribute. */ if (rank > 0) { printf("Rank : %d \n", rank); printf("Dimension sizes : "); for (i = 0; i < rank; i++) printf("%d ", (int)sdim[i]); printf("\n"); } /* * Read array attribute and display its type and values. */ if (H5T_FLOAT == H5Tget_class(atype)) { printf("Type : FLOAT \n"); npoints = H5Sget_simple_extent_npoints(aspace); float_array = (float *)malloc(sizeof(float) * (int)npoints); ret = H5Aread(attr, atype, float_array); printf("Values : "); for (i = 0; i < (int)npoints; i++) printf("%f ", float_array[i]); printf("\n"); free(float_array); } /* * Release all identifiers. */ H5Tclose(atype); H5Sclose(aspace); H5Aclose(attr); return 0; }