[Python-announce] ANN: A new version (0.5.0) of python-gnupg has been released.
What Changed? = This is an enhancement and bug-fix release, and all users are encouraged to upgrade. Brief summary: * Fixed #181: Added the ability to pass file paths to encrypt_file, decrypt_file, sign_file, verify_file, get_recipients_file and added import_keys_file. * Fixed #183: Handle FAILURE and UNEXPECTED conditions correctly. Thanks to sebbASF for the patch. * Fixed #185: Handle VALIDSIG arguments more robustly. * Fixed #188: Remove handling of DECRYPTION_FAILED from Verify code, as not required there. Thanks to sebbASF for the patch. * Fixed #190: Handle KEY_CREATED more robustly. * Fixed #191: Handle NODATA messages during verification. * Fixed #196: Don't log chunk data by default, as it could contain sensitive information (during decryption, for example). * Added the ability to pass an environment to the gpg executable. Thanks to Edvard Rejthar for the patch. This release [2] has been signed with my code signing key: Vinay Sajip (CODE SIGNING KEY) Fingerprint: CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86 Recent changes to PyPI don't show the GPG signature with the download links. The source code repository is at [1]. An alternative download source where the signatures are available is at [4]. Documentation is available at [5]. As always, your feedback is most welcome (especially bug reports [3], patches and suggestions for improvement, or any other points via this group). Enjoy! Cheers Vinay Sajip [1] https://github.com/vsajip/python-gnupg [2] https://pypi.org/project/python-gnupg/0.5.0 [3] https://github.com/vsajip/python-gnupg/issues [4] https://github.com/vsajip/python-gnupg/releases/ [5] https://docs.red-dove.com/python-gnupg/ ___ Python-announce-list mailing list -- python-announce-list@python.org To unsubscribe send an email to python-announce-list-le...@python.org https://mail.python.org/mailman3/lists/python-announce-list.python.org/ Member address: arch...@mail-archive.com
ANN: A new version (0.5.0) of python-gnupg has been released.
What Changed? = This is an enhancement and bug-fix release, and all users are encouraged to upgrade. Brief summary: * Fixed #181: Added the ability to pass file paths to encrypt_file, decrypt_file, sign_file, verify_file, get_recipients_file and added import_keys_file. * Fixed #183: Handle FAILURE and UNEXPECTED conditions correctly. Thanks to sebbASF for the patch. * Fixed #185: Handle VALIDSIG arguments more robustly. * Fixed #188: Remove handling of DECRYPTION_FAILED from Verify code, as not required there. Thanks to sebbASF for the patch. * Fixed #190: Handle KEY_CREATED more robustly. * Fixed #191: Handle NODATA messages during verification. * Fixed #196: Don't log chunk data by default, as it could contain sensitive information (during decryption, for example). * Added the ability to pass an environment to the gpg executable. Thanks to Edvard Rejthar for the patch. This release [2] has been signed with my code signing key: Vinay Sajip (CODE SIGNING KEY) Fingerprint: CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86 Recent changes to PyPI don't show the GPG signature with the download links. The source code repository is at [1]. An alternative download source where the signatures are available is at [4]. Documentation is available at [5]. As always, your feedback is most welcome (especially bug reports [3], patches and suggestions for improvement, or any other points via this group). Enjoy! Cheers Vinay Sajip [1] https://github.com/vsajip/python-gnupg [2] https://pypi.org/project/python-gnupg/0.5.0 [3] https://github.com/vsajip/python-gnupg/issues [4] https://github.com/vsajip/python-gnupg/releases/ [5] https://docs.red-dove.com/python-gnupg/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Mutating an HTML file with BeautifulSoup
On 2022-08-22 19:27:28 -, Jon Ribbens via Python-list wrote: > On 2022-08-22, Peter J. Holzer wrote: > > On 2022-08-22 00:45:56 -, Jon Ribbens via Python-list wrote: > >> With the offset though, BeautifulSoup made an arbitrary decision to > >> use ISO-8859-1 encoding and so when you chopped the bytestring at > >> that offset it only worked because BeautifulSoup had happened to > >> choose a 1-byte-per-character encoding. Ironically, *without* the > >> "\xed\xa0\x80\xed\xbc\x9f" it wouldn't have worked. > > > > Actually it would. The unit is bytes if you feed it with bytes, and > > characters if you feed it with str. > > No it isn't. If you give BeautifulSoup's 'html.parser' bytes as input, > it first chooses an encoding and decodes the bytes before sending that > output to html.parser, which is what provides the offset. So the offsets > it gives are in characters, and you've no simple way of converting that > back to byte offsets. Ah, I see. It "worked" for me because "\xed\xa0\x80\xed\xbc\x9f" isn't valid UTF-8. So Beautifulsoup decided to ignore the "" I had inserted before and used ISO-8859-1, providing me with correct byte offsets. If I replace that gibberish with a correct UTF-8 sequence (e.g. "\x4B\xC3\xA4\x73\x65") the UTF-8 is decoded and I get a character offset. > >> It looks like BeautifulSoup is doing something like that, yes. > >> Personally I would be nervous about some of my files being parsed > >> as UTF-8 and some of them ISO-8859-1 (due to decoding errors rather > >> than some of the files actually *being* ISO-8859-1 ;-) ) > > > > Since none of the syntactically meaningful characters have a code >= > > 0x80, you can parse HTML at the byte level if you know that it's encoded > > in a strict superset of ASCII (which all of the ISO-8859 family and > > UTF-8 are). Only if that's not true (e.g. if your files might be UTF-16 > > (or Shift-JIS or EUC, if I remember correctly) then you have to know > > the the character set. > > > > (By parsing I mean only "create a syntax tree". Obviously you have to > > know the encoding to know whether to display =ABc3 bc=BB as =AB=FC=BB or = > >=AB=C3=BC=BB.) > > But the job here isn't to create a syntax tree. It's to change some of > the content, which for all we know is not ASCII. We know it's URLs, and the canonical form of an URL is ASCII. The URLs in the files may not be, but if they aren't you'll have to deal with variants anyway. And the start and end of the attribute can be determined in any strict superset of ASCII including UTF-8. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature -- https://mail.python.org/mailman/listinfo/python-list
xarry netcdf message
Hi, I'm reading my netcdf data air.2m.mon.ltm.nc. I used the netcdf4 and I didn't have message when i read my data. But if I use the xarray I had this message: /home/conrado/.conda/envs/meuambi/lib/python3.8/site-packages/xarray/backends/plugins.py:61: RuntimeWarning: Engine 'cfgrib' loading failed: module 'cfgrib.messages' has no attribute 'DEFAULT_INDEXPATH' warnings.warn(f"Engine {name!r} loading failed:\n{ex}", RuntimeWarning) /home/conrado/.conda/envs/meuambi/lib/python3.8/site-packages/xarray/coding/times.py:673: SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime) /home/conrado/.conda/envs/meuambi/lib/python3.8/site-packages/xarray/core/indexing.py:423: SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range return np.asarray(array[self.key], dtype=None) What can I do to solve this message. Thanks, Conrado -- https://mail.python.org/mailman/listinfo/python-list
[Python-announce] GF4 Graphics Calculator V1.11 Announced
GF4 is a program to display two-dimensional data, such as time series data, and to perform mathematical operations on the data or between two related data sets. The program aims to make data exploration easy and enjoyable. The program's interface is modeled after hand-held calculators of the "reverse polish notation" (RPN) style. This kind of calculator was made famous by Hewlett-Packard, starting with their HP-35 and HP-45 calculators. GF4 works with waveforms in place of the numbers manipulated by those hand calculators. Thus, a waveform can be scaled, squared, have its logarithm taken, integrated and differentiated, be normalized and rectified, and so on. A discrete Fast Fourier Transform is provided that is not limited to powers of two in data length. Data can be trimmed or padded. Curve fitting and smoothing of several varieties can be done. Two waveforms can be added, subtracted, multiplied, and divided (where possible), correlated or convolved together, among others. A certain number of basic waveforms can be generated, including a delta function, step, ramp, sine and damped sine, Gaussian PDF and CDF distributions, and more. Altogether there are nearly 80 different operations available. Like RPN calculators, GF4 operations are organized around a stack of data sets. Unlike those calculators, the various stack levels can be accessed directly as well. GF4 is complementary to programs like CodraFT, though there is some degree of overlap. GF4 is written in Python 3, and makes use of MatPlotLib, NumPy, Scipy, and some other standard libraries. GF4 is available from a Github repository at https://github.com/tbpassin/gf4-project. The current release is the 1.1 branch; the most recent changes are in the devel branch. User documentation (still in progress) is at http://tompassin.net/gf4/docs/GF4_Users_Guide.html. A QuickStart section of the User Guide is at http://tompassin.net/gf4/docs/quickstart.html. There is a blog at http://tompassin.net/gf4/blogsite. Please direct correspondence to g...@tompassin.net. ___ Python-announce-list mailing list -- python-announce-list@python.org To unsubscribe send an email to python-announce-list-le...@python.org https://mail.python.org/mailman3/lists/python-announce-list.python.org/ Member address: arch...@mail-archive.com