当前位置:网站首页>[Q&A]AttributeError: module ‘signal‘ has no attribute ‘SIGALRM‘
[Q&A]AttributeError: module ‘signal‘ has no attribute ‘SIGALRM‘
2022-07-07 10:28:00 【镰刀韭菜】
问题描述:
当使用spellpy对日志文件进行解析时,出现如下错误:
执行的代码为:
for log_name in ['openstack_abnormal.log', 'openstack_normal2.log', 'openstack_normal1.log']:
parser.parse(log_name)
错误信息为:
Traceback (most recent call last):
File "preprocess.py", line 62, in <module>
parser.parse(log_name)
File "D:\Anaconda\lib\site-packages\spellpy\spell.py", line 188, in parse
self.load_data()
File "D:\Anaconda\lib\site-packages\spellpy\spell.py", line 300, in load_data
self.df_log = self.log_to_dataframe(os.path.join(self.path, self.logname), regex, headers, self.logformat)
File "D:\Anaconda\lib\site-packages\spellpy\spell.py", line 316, in log_to_dataframe
signal.signal(signal.SIGALRM, self._log_to_dataframe_handler)
AttributeError: module 'signal' has no attribute 'SIGALRM'
问题分析
spell调用了signal模块,该模块可以在linux下正常使用,但在windows下却有一些限制:
“On Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, or SIGTERM. A ValueError will be raised in any other case.”
在Windows环境下只有这个几个信号类型允许被使用:
- SIGABRT
- SIGFPE
- SIGILL
- SIGINT
- SIGSEGV
- SIGTERM
边栏推荐
- Fleet tutorial 14 basic introduction to listtile (tutorial includes source code)
- Sonar:Cognitive Complexity认知复杂度
- Is it safe to open Huatai's account in kainiu in 2022?
- What is a LAN domain name? How to parse?
- @What happens if bean and @component are used on the same class?
- PowerShell cs-utf-16le code goes online
- 让数字管理好库存
- 对话PPIO联合创始人王闻宇:整合边缘算力资源,开拓更多音视频服务场景
- Time bomb inside the software: 0-day log4shell is just the tip of the iceberg
- idea 2021中文乱码
猜你喜欢
Idea 2021 Chinese garbled code
解密GD32 MCU产品家族,开发板该怎么选?
"Series after reading" my God! It's so simple to understand throttling and anti shake~
Minimalist movie website
即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战
2022 8th "certification Cup" China University risk management and control ability challenge
Epp+dis learning path (1) -- Hello world!
The hoisting of the upper cylinder of the steel containment of the world's first reactor "linglong-1" reactor building was successful
ps链接图层的使用方法和快捷键,ps图层链接怎么做的
wallys/Qualcomm IPQ8072A networking SBC supports dual 10GbE, WiFi 6
随机推荐
idea 2021中文乱码
idm服务器响应显示您没有权限下载解决教程
什么是ESP/MSR 分区,如何建立ESP/MSR 分区
File upload vulnerability - upload labs (1~2)
How much does it cost to develop a small program mall?
Zero shot, one shot and few shot
Unity中SmoothStep介绍和应用: 溶解特效优化
如何理解服装产业链及供应链
30. Feed shot named entity recognition with self describing networks reading notes
Processing strategy of message queue message loss and repeated message sending
TypeScript 接口继承
wallys/Qualcomm IPQ8072A networking SBC supports dual 10GbE, WiFi 6
Up meta - Web3.0 world innovative meta universe financial agreement
Minimalist movie website
Introduction and application of smoothstep in unity: optimization of dissolution effect
108. Network security penetration test - [privilege escalation 6] - [windows kernel overflow privilege escalation]
(to be deleted later) yyds, paid academic resources, please keep a low profile!
2022 8th "certification Cup" China University risk management and control ability challenge
顶级域名有哪些?是如何分类的?
Apache installation problem: configure: error: APR not found Please read the documentation