解压大型 dbf 文件时出现 python 2.5 错误
所以,我有一个相当大的压缩形状文件的目录。我目前在 python 2.5 中有代码,可以解压缩大部分文件(即所有 shapefile 组成部分 .shp、.prj、.dbf...),但在解压缩一些 .dbf 文件时偶尔会遇到问题。
当我遇到问题时,这些文件通常会很大(例如 30 MB),但文件大小似乎并不是解压缩过程中的首要问题,因为有时较小的文件将无法工作。
我已经查看了文件路径中可能的特殊字符(包含“-”和“/”),但这似乎不是其他 .dbf 文件的问题。我还查看了文件路径的长度,这也不是问题,因为其他长文件路径不会出现问题。
7Zip 将解压缩 .dbf 文件 我在使用 python unzip 解压缩时遇到问题,因此文件没有损坏。
我知道一个简单的解决方案是在 python 中运行附加处理之前解压缩所有文件,但由于它们位于压缩存档中,因此不必这样做是最方便的。
思想赞赏。
So, I have a directory of rather large, zipped, shapefiles. I currently have code in python 2.5 that will unzip most of the files (i.e. all of the shapefile component parts .shp, .prj, .dbf...) but I run into occational problems unzipping some .dbf files.
These files area generally quite large when I have a problem with them (e.g. 30 MB) but the file size does not sem to be an overarching problem with the unzipping process as sometimes a smaller file will not work.
I have looked at possible special characters in the file path (it contains "-" and "/") but this seems not to be an issue with other .dbf files. I have also looked at the length of the file path, also not an issue as other long file paths do not present a problem.
7Zip will unzip the .dbf files I have issues unzipping with python unzip so the files are not corrupt.
I know a simple solution would be to unzip all of the files prior to running my additional processing in python but as they come in a zipped archive it woukld be most convenient not to have to do this.
Thoughts appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
两个可能的候选问题:要提取的文件为空或大于 2Gb。这两个问题都在 2.6 或 2.7 中得到了修复。
如果这两种情况都不是,将罪魁祸首 zip 档案之一放在公共位置将有助于我们追踪问题。
Two possible candidate problems: the file to extract is either empty, or is larger than 2Gb. Both of these issues were fixed in 2.6 or 2.7.
If neither of these is the case, putting one of the culprit zip archives somewhere public would help us track down the issue.